Skip to content

Conversation

HGSilveri
Copy link
Collaborator

Significant modifications to the first version of the pasqal module. Most relevantly:

  • PasqalDevice was modified to be the parent class of all Pasqal devices. Also allows submission of nearly unconstrained circuits to Pasqal processors.
  • PasqalVirtualDevice enforces the constraints of a near-term Pasqal QPU.
  • ThreeDGridQubit was renamed ThreeDQubit (and TwoDQubit was created as a subclass).
  • More flexibility in the accepted qubits (PasqalVirtualDevice can also work with GridQubit and LineQubit)
  • More adequate accepted gate set, now consistent with the hardware

New additions:

  • Documentation (docs/pasqal) and "getting_started" tutorial

HGSilveri and others added 30 commits April 6, 2020 18:25
@HGSilveri
Copy link
Collaborator Author

Hi @balopat, thank you very much for the remarks! You are absolutely right, these are all accidental and unrelated to our classes. I will clean up every change that didn't come from our side ASAP, thank you for your patience.

@HGSilveri
Copy link
Collaborator Author

Hi again @balopat, it should be okay now. I apologise for the trouble!

@HGSilveri HGSilveri requested a review from balopat July 9, 2020 09:56
Copy link
Contributor

@balopat balopat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the cleanup, I did have another little review - and I have questions!

@HGSilveri HGSilveri requested a review from balopat July 10, 2020 07:32
Copy link
Contributor

@balopat balopat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the cleanups and explanations!
Now, in order to get this change in, the fastest way will be (though might be unintuitive) to break it up into smaller chunks. We still have 28 files changed here. If we could limit each "child-PR" to <10 or even below that, that would be great.

You do have distinct features that could serve as a natural cutting point:

  1. PasqalDevice was modified to be the parent class of all Pasqal devices. Also allows submission of nearly unconstrained circuits to Pasqal processors.
  2. PasqalVirtualDevice enforces the constraints of a near-term Pasqal QPU.
  3. ThreeDGridQubit was renamed ThreeDQubit (and TwoDQubit was created as a subclass).
  4. More flexibility in the accepted qubits (PasqalVirtualDevice can also work with GridQubit and LineQubit)
  5. More adequate accepted gate set, now consistent with the hardware
  6. docs

Maybe 1+2, 3+4, 5 and 6?

The reason this strategy will work faster is that most of the team members and experts have typically small amount of times throughout the day for reviews, scattered around their other work. If we can do the nitpicking in isolation and small batches, we'll get a higher quality code altogether and make partial progress faster.

I hope you don't mind the extra toil around that. Thank you!

@HGSilveri
Copy link
Collaborator Author

Hi again @balopat, thank you for your time and help so far. Regarding your recommendation, I understand your point. However, these changes are very much intertwined, so it is easier said that done. Let me elaborate on what I think, realistically, can be done:

  • Separating the docs is an easy split, which should already remove 8 files from the PR.
  • The remaining 20 are all interconnected and it is essentially impossible to contain a change to only 10 (e.g. changing ThreeDGridQubit to ThreeDQubit alone will touch nearly all of them). However, I should point out that out of these 20 files, 11 are small changes related to json serialization (either files that are deleted, added or very slightly changed) and are thus very straightforward to review.
  • That being said, an effort could still be made into focusing each PR on specific changes. I agree with your division, but in reality points 1-4 are very hard to dissociate. If you insist, I believe we could make 5. into a separate PR though.

To summarise, I suggest we divide the PR into a big PR (points 1-4 or 1-5), followed by one or two smaller PR's (just 6 or 5 and 6). I understand this is not ideal, but it is really impossible to naturally dissociate the changes in the Qubit classes and the Device classes, since they influence one another. Plus, forcing this split would still entail a disappointingly small reduction in the number of files per PR.

@balopat
Copy link
Contributor

balopat commented Jul 10, 2020

Hey @HGSilveri,

Thanks for thinking this through with me! This sounds good, let's do 1-4, 5, 6 separately then. It is not only about the number of files. It is also about the number of concepts that change or are introduced in a PR. Last year when I developed the QASM Importer, I ran into the same issue with only 11 files that I broke out and got much faster reviews - well it still took some time, but at the end it was really easier on the reviewers (https://github.com/quantumlib/Cirq/pulls?q=is%3Apr+is%3Aclosed+author%3Abalopat+qasm+import). Thank you!

@HGSilveri
Copy link
Collaborator Author

As discussed above, the PR will be closed in favour of a split into smaller PR's.

@HGSilveri HGSilveri closed this Jul 13, 2020
CirqBot pushed a commit that referenced this pull request Jul 15, 2020
This the first child-PR of #3126 .

- Introduces new Pasqal qubit classes: `ThreeDQubit`and `TwoDQubit` (a subclass of `ThreeDQubit`)
- These new classes are intended to replace the original `ThreeDGridQubit`, which will be deleted on the next PR (where other classes' dependencies will be resolved).
- In comparison with `ThreeDGridQubit`, these new classes allow for arbitrary placement of qubits in 3D or 2D space, instead of restricting them to a grid. This more closely resembles the capabilities of Pasqal devices.
CirqBot pushed a commit that referenced this pull request Jul 20, 2020
This the second child-PR of #3126 , following #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.
CirqBot pushed a commit that referenced this pull request Jul 22, 2020
This the fourth child-PR of #3126 , following #3141  and in parallel with #3160 .

`ThreeDGridQubit` is removed from the `pasqal` module, as all dependencies have been eliminated and it can be fully replaced by `ThreeDQubit`.
CirqBot pushed a commit that referenced this pull request Jul 29, 2020
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
CirqBot pushed a commit that referenced this pull request Jul 31, 2020
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.
tonybruguier pushed a commit to tonybruguier/Cirq that referenced this pull request Aug 23, 2020
This the first child-PR of quantumlib#3126 .

- Introduces new Pasqal qubit classes: `ThreeDQubit`and `TwoDQubit` (a subclass of `ThreeDQubit`)
- These new classes are intended to replace the original `ThreeDGridQubit`, which will be deleted on the next PR (where other classes' dependencies will be resolved).
- In comparison with `ThreeDGridQubit`, these new classes allow for arbitrary placement of qubits in 3D or 2D space, instead of restricting them to a grid. This more closely resembles the capabilities of Pasqal devices.
tonybruguier pushed a commit to tonybruguier/Cirq that referenced this pull request Aug 23, 2020
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.
tonybruguier pushed a commit to tonybruguier/Cirq that referenced this pull request Aug 23, 2020
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`.
tonybruguier pushed a commit to tonybruguier/Cirq that referenced this pull request Aug 23, 2020
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
tonybruguier pushed a commit to tonybruguier/Cirq that referenced this pull request Aug 23, 2020
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Makes googlebot stop complaining.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants