-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Pasqal updates] Updated gate set #3160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Sorry for the wait on this @HGSilveri - I was distracted in the last two days with an event. Will be back to this in the coming days. |
|
No worries @balopat , thanks for all your help! By the way, I believe that the failed CI check is unrelated to this PR. |
balopat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good, two small comments
| (cirq.ops.HPowGate, cirq.ops.CNotPowGate, cirq.ops.CZPowGate, | ||
| cirq.ops.CCZPowGate, cirq.ops.CCXPowGate)): | ||
| expo = op.gate.exponent | ||
| valid_op = np.isclose(expo, np.around(expo, decimals=0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would this work with parametrized gates? The type of exponent is Union[float, sympy.Basic] - it could be parametrized. I think you should make sure you're handling that here and cover that flow with tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I made the appropriate changes.
cirq/pasqal/pasqal_device.py
Outdated
| (cirq.ops.HPowGate, cirq.ops.CNotPowGate, cirq.ops.CZPowGate, | ||
| cirq.ops.CCZPowGate, cirq.ops.CCXPowGate)): | ||
| expo = op.gate.exponent | ||
| if not isinstance(expo, sympy.Basic): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Use
cirq.is_parametrized(op)- that should take care of other parameters as well. - Is the Pasqal device going to handle non-integer exponent and/or parametrized gates from PhasedXPowGate, XPowGate, YPowGate, ZPowGate? If not, then maybe we should just bring up the parametrization check further up, to the beginning in this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Ok, will do.
- Yes, we'll handle non-integer exponents for these. As for the parametrization, we won't necessarily handle that, but we support the parameter substitution for actual values in
PasqalSampler.run_sweep, so we have to allow those here.
This is the fifth child-PR of #3126, following #3160. `PasqalVirtualDevice`, which enforces the constraints typically found in a physical device, is added to the module. These constraints were present in `PasqalDevice` before its generalisation in #3141 . They are now reincorporated here. This is the last code PR of the Pasqal updates, after which all that is left is to incorporate the documentation.
This the fourth child-PR of quantumlib#3126 , following quantumlib#3141 and in parallel with quantumlib#3160 . `ThreeDGridQubit` is removed from the `pasqal` module, as all dependencies have been eliminated and it can be fully replaced by `ThreeDQubit`.
This the third child-PR of quantumlib#3126 , following quantumlib#3141 . - The accepted gate set is updated to: - Accept only specific multi-qubit gates - Accept the Hadamard gate - The noise model is updated accordingly and is now device dependent, in preparation for the addition of new devices whose noise model will naturally differ from the standard - A specific converter for non-native gate decomposition is adapted from the `neutral_atoms` module
This is the fifth child-PR of quantumlib#3126, following quantumlib#3160. `PasqalVirtualDevice`, which enforces the constraints typically found in a physical device, is added to the module. These constraints were present in `PasqalDevice` before its generalisation in quantumlib#3141 . They are now reincorporated here. This is the last code PR of the Pasqal updates, after which all that is left is to incorporate the documentation.
This the third child-PR of #3126 , following #3141 .
neutral_atomsmodule