-
Notifications
You must be signed in to change notification settings - Fork 989
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
[Pasqal updates] PasqalDevice class generalization #3141
Conversation
Hi @balopat ! Here is the second PR. Also, I was wondering: is it okay to do two PR's simultaneously if they are unrelated? I suppose it is not recommended, I was just wondering since it could help speed up the process. |
Absolutely, feel free to open multiple ones! I'll have a look at this one today! |
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 looks good to me, with some comments on documentation and error messages mostly.
cirq/pasqal/pasqal_device.py
Outdated
|
||
|
||
@cirq.value.value_equality | ||
class PasqalDevice(cirq.devices.Device): | ||
"""A Pasqal Device with qubits placed on a 3D grid.""" | ||
"""A generic Pasqal device.""" |
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.
A bit more documentation here would be very helpful (you can just rephrase a bunch of the text you had in the documentation) for users to understand the intent of this class: When is this useful? Why would someone want to use an unconstrained Pasqal device vs the 3D one?
cirq/pasqal/pasqal_device.py
Outdated
|
||
for q in qubits: | ||
if not isinstance(q, ThreeDGridQubit): | ||
if not isinstance(q, self.supported_qubit_type): | ||
raise TypeError('Unsupported qubit type: {!r}'.format(q)) |
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.
To make the error message more helpful, you could list the supported qubit types.
|
||
@property | ||
def maximum_qubit_number(self): | ||
return 100 |
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.
we are so in the NISQ era ;)
cirq/pasqal/pasqal_device.py
Outdated
if not isinstance(qub, ThreeDGridQubit): | ||
raise ValueError('{} is not a 3D grid qubit ' | ||
if not isinstance(qub, self.supported_qubit_type): | ||
raise ValueError('{} is not a valid qubit ' |
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.
Similar to init, please clarify what are the accepted types for this device.
This the third child-PR of #3126 , following #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 #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 second child-PR of quantumlib#3126 , following quantumlib#3133 . - Generalizes `PasqalDevice`, removing ties to the physical placement of the qubits. - `PasqalDevice` now serves as the parent class of all future Pasqal devices, only enforcing constraints expected to exist on all future devices. - `PasqalDevice`can also be used as the device for submission of explicitly unconstrained circuits to Pasqal's devices. A new device class, `PasqalVirtualDevice`, will subclass the new `PasqalDevice` and recover the hardware constraints of the current `PasqalDevice` on a future PR.
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 second child-PR of #3126 , following #3133 .
PasqalDevice
, removing ties to the physical placement of the qubits.PasqalDevice
now serves as the parent class of all future Pasqal devices, only enforcing constraints expected to exist on all future devices.PasqalDevice
can also be used as the device for submission of explicitly unconstrained circuits to Pasqal's devices.A new device class,
PasqalVirtualDevice
, will subclass the newPasqalDevice
and recover the hardware constraints of the currentPasqalDevice
on a future PR.