-
Notifications
You must be signed in to change notification settings - Fork 982
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
Add documentation for cirq.google devices #2636
Add documentation for cirq.google devices #2636
Conversation
dstrain115
commented
Dec 11, 2019
- Add sub-directory for Google-specific documentation.
- Add documentation explaining grid devices, best practices.
- Add documentation about Sycamore, Bristlecone, and Foxtail.
- Add sub-directory for Google-specific documentation. - Add documentation explaining grid devices, best practices. - Add documentation about Sycamore, Bristlecone, and Foxtail.
Ping. This is documentation and should be easy to review! |
docs/google/devices.md
Outdated
Measurement takes much longer than other gates. Currently, the only supported | ||
configuration is to have terminal measurement in the final moment of a circuit. | ||
|
||
Most devices have a limited number of gates that can applied to the device. Gates not |
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.
"number of gates" here might be confused with how many gates can be applied in succession in a given circuit. Might be better to say "set of gates". Could separately note that there is also an overall restriction on the length of the circuit.
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.
missing "be"
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.
applied on the device? applied with the device? "to" sounds ood
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.
Done.
docs/google/devices.md
Outdated
|
||
### Use built-in optimizers as a first pass | ||
|
||
Using built-in optimizers will allow you to compile to the correct . As they are |
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 the correct gate set"?
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.
Done
docs/google/devices.md
Outdated
|
||
Using built-in optimizers will allow you to compile to the correct . As they are | ||
automated solutions, they will not always perform as well as a hand-crafted solution, but | ||
it provides a good starting point for creating a circuit that is likely to run successfully |
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.
nit: "but they provide..."
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.
Done.
docs/google/devices.md
Outdated
### Good moment structure | ||
|
||
In an attempt to fulfill the user's desire, quantum devices will respect the moment | ||
structure of circuits to the greatest extent possible. |
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.
Might want to specify what this means, e.g. "All gates in a moment will be executed at the same on hardware, after all gates in the previous moment and before any gates in the next moment."
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.
Done.
docs/google/devices.md
Outdated
|
||
## General limitations | ||
|
||
Qubits on Google devices are laid out in a grid structure. Connectivity is limited to |
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.
nit: One space after period throughout (so says the chicago manual of style, anyway :-))
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 can use two spaces in a monospaced font, as it provides visual separation between sentences. The trouble began when people stopped using typewriters and started using word processors with variable-width fonts and continued to use two spaces.
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.
I was always taught to use two spaces, but I changed it to one space.
docs/google/devices.md
Outdated
|
||
### Keep qubits busy | ||
|
||
Qubits that remain idle for long periods tend to dephase and decoher. Inserting a |
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.
typo: "decohere"
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.
Done
docs/google/devices.md
Outdated
``` | ||
|
||
It can be accessing by using `cirq.google.Sycamore`. This device has two possible | ||
two-qubits that can be used. |
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.
"two-qubit gates"
docs/google/devices.md
Outdated
7 --EFGHIJKL-- | ||
8 ---GHIJKL--- | ||
9 ----IJKL---- | ||
0 -----KL----- |
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.
last row number should be 10
docs/google/devices.md
Outdated
In the current NISQ (noisy intermediate scale quantum) era, gates and devices still | ||
have significant error. Both gate errors and T1 decay rate can cause long circuits | ||
to have noise that overwhelms any signal in the circuit. Also, circuits that are | ||
much too long can even be rejected due to various limits in the system. |
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.
I would suggest describing the overall circuit length limit separately, e.g. in the section above on "General Limitations". Here can just talk about the coherence limit, which is typically more restrictive.
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.
Moved this up to general limitation and modified the wording a bit. Let me know if you think it is okay.
Since quantum hardware is an active area of research, hardware specifications and best | ||
practices are constantly evolving in an attempt to continuously improve performance. | ||
While this information should be a solid base for beginning your quantum application, | ||
please work with your Google sponsor to obtain the latest information on devices that |
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.
is "Google sponsor" the terminology we're using?
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.
I think so? We'll probably need to revamp this as we determine the process a bit better. Did you have a suggestion on how to change this, or do you think it's okay to leave as it for now?
docs/google/devices.md
Outdated
|
||
## General limitations | ||
|
||
Qubits on Google devices are laid out in a grid structure. Connectivity is limited to |
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 can use two spaces in a monospaced font, as it provides visual separation between sentences. The trouble began when people stopped using typewriters and started using word processors with variable-width fonts and continued to use two spaces.
docs/google/devices.md
Outdated
Measurement takes much longer than other gates. Currently, the only supported | ||
configuration is to have terminal measurement in the final moment of a circuit. | ||
|
||
Most devices have a limited number of gates that can applied to the device. Gates not |
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.
missing "be"
docs/google/devices.md
Outdated
Measurement takes much longer than other gates. Currently, the only supported | ||
configuration is to have terminal measurement in the final moment of a circuit. | ||
|
||
Most devices have a limited number of gates that can applied to the device. Gates not |
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.
applied on the device? applied with the device? "to" sounds ood
docs/google/devices.md
Outdated
Using built-in optimizers will allow you to compile to the correct . As they are | ||
automated solutions, they will not always perform as well as a hand-crafted solution, but | ||
it provides a good starting point for creating a circuit that is likely to run successfully | ||
on hardware. |
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.
put something that no matter which optimizers you use; you should inspect your circuit to make sure nothing crazy is happening
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.
Done.
docs/google/devices.md
Outdated
To this end, it is important that the moment structure of the circuit is kept as | ||
short and concise as possible. The length of a moment will generally be the length | ||
of the longest gate in the moment, so keeping gates with similar durations together | ||
will generally benefit the performance. |
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.
"help performance"
it benefits the user. performance don't care
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.
Changed to "...keeping gates with similar durations together
will shorten the duration of the circuit and likely reduce the noise incurred"
docs/google/devices.md
Outdated
will generally benefit the performance. | ||
|
||
In particular, keep measurement gates in the same moment and make sure that any | ||
circuit optimizers run do not alter this by pushing measurements forward. This |
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.
nix "run"
In particular, keep measurement gates in the same moment and make sure that any | ||
circuit optimizers run do not alter this by pushing measurements forward. This | ||
behavior can be avoided by measuring all qubits with a single gate or by adding | ||
the measurement gate after all optimizers have run. |
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.
link to a github issue to provide better utilities for this?
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.
Which github issue? Did you want me to add an example of cirq.measure for different qubits? Or appending the circuit with an insert strategy?
docs/google/devices.md
Outdated
|
||
The recommended gate depths vary significantly with the structure of the circuit itself | ||
and will likely increase as the devices improve. However, circuits with more than | ||
50 moments will generally struggle to retain any information. |
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.
is this true?
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.
(I don't think it is)
Performance generally depends on width * depth
A rough guide can be found by multiplying together gate fidelities to get a sense for the probability of success for an algorithm. For example, if you have 20 moments on 20 qubits, you can roughly estimate circuit fidelity as (0.995)^(20*20)
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.
Thanks. This is much more precise. I'll link to calibration metrics once we release them.
docs/google/devices.md
Outdated
|
||
Devices generally operate in the Z basis, so that rotations around the Z axis will become | ||
book-keeping measures rather than physical operations on the device. These operations | ||
should be aggregated into their own moment, if possible. |
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.
open or link to github issue requesting better cirq features to do this
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 have an internal bug for this, but no cirq issue. I am going to punt on creating a GH issue for this until we decide what we want. I want to keep general advice separate from creating automated functionality to do these optimizations.
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.
Thanks for the detailed comments! Please take another look when you get a chance.
docs/google/devices.md
Outdated
To this end, it is important that the moment structure of the circuit is kept as | ||
short and concise as possible. The length of a moment will generally be the length | ||
of the longest gate in the moment, so keeping gates with similar durations together | ||
will generally benefit the performance. |
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.
Changed to "...keeping gates with similar durations together
will shorten the duration of the circuit and likely reduce the noise incurred"
docs/google/devices.md
Outdated
|
||
## General limitations | ||
|
||
Qubits on Google devices are laid out in a grid structure. Connectivity is limited to |
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.
I was always taught to use two spaces, but I changed it to one space.
docs/google/devices.md
Outdated
Measurement takes much longer than other gates. Currently, the only supported | ||
configuration is to have terminal measurement in the final moment of a circuit. | ||
|
||
Most devices have a limited number of gates that can applied to the device. Gates not |
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.
Done.
docs/google/devices.md
Outdated
|
||
### Use built-in optimizers as a first pass | ||
|
||
Using built-in optimizers will allow you to compile to the correct . As they are |
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.
Done
docs/google/devices.md
Outdated
|
||
Using built-in optimizers will allow you to compile to the correct . As they are | ||
automated solutions, they will not always perform as well as a hand-crafted solution, but | ||
it provides a good starting point for creating a circuit that is likely to run successfully |
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.
Done.
In particular, keep measurement gates in the same moment and make sure that any | ||
circuit optimizers run do not alter this by pushing measurements forward. This | ||
behavior can be avoided by measuring all qubits with a single gate or by adding | ||
the measurement gate after all optimizers have run. |
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.
Which github issue? Did you want me to add an example of cirq.measure for different qubits? Or appending the circuit with an insert strategy?
docs/google/devices.md
Outdated
|
||
### Keep qubits busy | ||
|
||
Qubits that remain idle for long periods tend to dephase and decoher. Inserting a |
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.
Done
docs/google/devices.md
Outdated
In the current NISQ (noisy intermediate scale quantum) era, gates and devices still | ||
have significant error. Both gate errors and T1 decay rate can cause long circuits | ||
to have noise that overwhelms any signal in the circuit. Also, circuits that are | ||
much too long can even be rejected due to various limits in the system. |
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.
Moved this up to general limitation and modified the wording a bit. Let me know if you think it is okay.
docs/google/devices.md
Outdated
|
||
The recommended gate depths vary significantly with the structure of the circuit itself | ||
and will likely increase as the devices improve. However, circuits with more than | ||
50 moments will generally struggle to retain any information. |
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.
Thanks. This is much more precise. I'll link to calibration metrics once we release them.
docs/google/devices.md
Outdated
|
||
Devices generally operate in the Z basis, so that rotations around the Z axis will become | ||
book-keeping measures rather than physical operations on the device. These operations | ||
should be aggregated into their own moment, if possible. |
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 have an internal bug for this, but no cirq issue. I am going to punt on creating a GH issue for this until we decide what we want. I want to keep general advice separate from creating automated functionality to do these optimizations.
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.
thanks!
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.
LGTM