-
Notifications
You must be signed in to change notification settings - Fork 42
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
2Q RB generated by cross-resonance CNOT #276
base: main
Are you sure you want to change the base?
Conversation
* Calibrate readout pulses and optimize state discrimination. | ||
* Calibrate and optimize qubit XY pulses. Single qubit operations are based on x90, -x90, x180, y90, -y90, and y180. | ||
* Our two qubit RB is based on CNOT as the entangling operation which is implemented by direct CR gate. Replace the pertinent lines in the definition of the function `play_sequence` in [run_two_qubit_rb_CR_CNOT.py](run_two_qubit_rb_CR_CNOT.py) (switch case 49) if echoed CR is to be used. | ||
* No baking will be directly called by the user. The user can easily customize their gates, especially the two-qubit gate pulses. |
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 we can delete this note since not everyone is familiar with baking. Maybe we can write:
The user can easily customize their gates, especially the two-qubit gate pulses.
* Calibrate and optimize qubit XY pulses. Single qubit operations are based on x90, -x90, x180, y90, -y90, and y180. | ||
* Our two qubit RB is based on CNOT as the entangling operation which is implemented by direct CR gate. Replace the pertinent lines in the definition of the function `play_sequence` in [run_two_qubit_rb_CR_CNOT.py](run_two_qubit_rb_CR_CNOT.py) (switch case 49) if echoed CR is to be used. | ||
* No baking will be directly called by the user. The user can easily customize their gates, especially the two-qubit gate pulses. | ||
* Running gate sequences other than those for RB is also allowed if one manually set the `sequence_list`. (See ##### TEST EXAMPLE in [run_two_qubit_rb_CR_CNOT.py](run_two_qubit_rb_CR_CNOT.py).) |
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.
(See example in run_two_qubit_rb_CR_CNOT.py.)
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.
correcting myself:
(See TEST EXAMPLE in run_two_qubit_rb_CR_CNOT.py.)
The configuration consists of 4 elements: | ||
* `rr1` and `rr2` send readout pulses and measure the transmitted signal for each qubit | ||
* `q1_xy` and `q2_xy` send drive XY pulses to each qubit | ||
* `cr_drive_c1t2`, `cr_drive_c2t1` send cross-resonance drive to the control qubit (at target frequency) |
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.
Let's add - In cr_drive_c1t2
, qubit 1 acts as the control qubit, and qubit 2 as the target. Conversely, in cr_drive_c2t1
, qubit 2 is the control qubit, and qubit 1 is the target.
* `rr1` and `rr2` send readout pulses and measure the transmitted signal for each qubit | ||
* `q1_xy` and `q2_xy` send drive XY pulses to each qubit | ||
* `cr_drive_c1t2`, `cr_drive_c2t1` send cross-resonance drive to the control qubit (at target frequency) | ||
* `cr_cancel_c1t2`, and `cr_cancel_c2t1` send cancellation drive the target qubit (also at target frequency) |
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.
Let's add - In cr_cancel_c1t2, qubit 1 acts as the control qubit, and qubit 2 as the target. Conversely, in cr_cancel_c2t1, qubit 2 is the control qubit, and qubit 1 is the target.
|
||
The qubit elements `q1_xy` and `q2_xy` have several operations defined that correspond to X/2, Y/2, -X/2, -Y/2, X and Y gates. The envelopes are Gaussian (although this can be changed by the user), with optional Gaussian DRAG corrections, parameters (amplitudes, lengths, Gaussian sigmas, etc.), that need to be calibrated. | ||
|
||
The qubit element `cr_drive_c1t2` and `cr_drive_c2t1` have square pulse and blackman function options for the CR envelopes. |
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.
The qubit elements
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.
Hey, the README file looks really great!
I went over it and left some comments.
I think that it's also missing some figures at the end.
# Only played the depth corresponding to target_depth | ||
|
||
with for_(n, 0, n < n_avg_, n + 1): | ||
align() |
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.
no need for this align :)
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 am waiting for your comment regarding the error, so I will be able to run it and test that it's working on my end :)
depth_list = [0, 1, 5, 7, 14, 20, 26, 32] | ||
np.random.seed(seed=int(time.time()%1*1e8)) | ||
# np.random.seed(seed = 0) # can set the seed for consistent comparison | ||
sequence_list, len_list = pre_generate_sequence(num_of_sequences, depth_list) # standard RB |
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.
When running this lune I get an error "TypeError: LineQubit.new() missing 1 required positional argument: 'x'"
After a bit of debugging it looks like it comes from the function generate_sequence_list
inside the file TwoQ_RB_Sequence_Generation_CNOT_CR
. Seems like that these lines create the error:
with open('2q_Clifford_gen_CNOT_circuit.pkl', 'rb') as file:
circuit_list = pickle.load(file)
are you familiar with it? maybe it's the cirq version? which one are you 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 updated my cirq to 1.4.1 and reran the clifford generation code. Now it's working.
@@ -0,0 +1,363 @@ | |||
|
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.
Can you put a reference paper?
instruct.extend(instruct_list[sequence_ints[d_]]) | ||
unitary = cirq.unitary(circuit) | ||
for c_ in range(11520): | ||
if abs((unitary @ unitary_list[c_]).trace())>3.95: |
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.
can you please explain about this loop?
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.
should add a comment
### 3.2 Play multiple random sequences with different depths | ||
|
||
#### 3.2.1 Stacking all `instruct_integers` into `sequence_list` | ||
It appears that we cannot let qm loop over an numpy array. However, we have one `instruct_integers` for each randomization and for each different depth. The preferable way is to use a single list to store all `instruct_integers` from different randomizations and for different `depth`'s. This is done by the function `pre_generate_sequence`. |
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.
It is possible to loop over the an array in QUA using for_each_
and then the logic of the loop would be a bit different. (you can read more about it here - https://docs.quantum-machines.co/latest/docs/Guides/features/#for_each) but since it's a bit less efficient I think that the logic of what you did is great.
We can just remove the comment since it's might be confusing and keep the explanation of the logic.
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 just added a few comments :)
align(qt_xy, qc_xy, cr_drive, cr_cancel) | ||
frame_rotation_2pi(+0.25, qc_xy) | ||
# check the sign before 0.25 -- could be either way depending on cr_drive_phase | ||
play('y90' * amp(0.00001), qc_xy, duration=1) |
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.
what is this step for?
Hi Michal and Kevin,
cc @bornman-nick
This is the pull request to upload our homemade 2q RB code for cross-resonance CNOT gates. These codes describe our method to get around the baker library which we found less convenient.
To summarize, a new folder named "Use_Case_1_Two_qubit_RB_without_baking" has been added into directory
/qua-platform/qua-libs/tree/main/Quantum-Control-Applications/Superconducting/Two-Fixed-Coupled-Transmons/
Please let me know if you have any comments!
Best,
Ziwen