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
Create a workflow to perform FSim based z-phase calibration #6568
base: main
Are you sure you want to change the base?
Conversation
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 a great start, Nour!! Thanks for all of your amazing work.
) -> Tuple[xeb_fitting.XEBCharacterizationResult]: | ||
"""Perform z-phase calibration for fermionic gates. | ||
|
||
For a given fermionic two-qubit gate we assume an error model that can be described |
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.
Same comment as above.
atol: float = 1e-3, | ||
pool: Optional[Union[multiprocessing.Pool, concurrent.futures.ThreadPoolExecutor]] = None, | ||
) -> Tuple[xeb_fitting.XEBCharacterizationResult]: | ||
"""Perform z-phase calibration for fermionic gates. |
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 call it a "number-conserving two-qubit gate" instead of a "fermionic two-qubit gate"
1: ───Rz(b)───two_qubit_gate───Rz(d)─── | ||
for some angles a, b, c, and d. | ||
|
||
Since the two-qubit gate is a fermionic-gate, it can be represented by an FSimGate and the |
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.
Same comment as above.
results = xeb_utils.execute_with_progress_par( | ||
closure, | ||
subselected_dfs, | ||
pool=pool, | ||
progress_bar=tqdm.tqdm, | ||
desc='characterize fsim parameters', | ||
) |
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 step took 30 minutes to run when I tested it (colab). I know that the gate_cal_and_checks
code is also slow like this, but the internal XEB calibration is fast, so hopefully there is a way to make this faster.
options: The XEB-fitting options. If None, calibrate all 5 PhasedFSimGate parameters, | ||
using the representation of a two-qubit gate as an FSimGate for the initial guess. |
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 the default behavior should be to characterize the three
options: The XEB-fitting options. If None, calibrate all 5 PhasedFSimGate parameters, | ||
using the representation of a two-qubit gate as an FSimGate for the initial guess. |
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 tried this out, and it didn't seem to characterize any of the angles (colab).
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.
fixed, it should work now
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.
btw to speed things up, run the calibration method in a multiprocessing pool e.g.
with mulitprocessing.Pool(10) as pool:
result_zphase = cirq.experiments.calibrate_z_phases(sampler, qubits, pool=pool)
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.
Could we make it create a pool by default?
This should probably go in a separate PR, but I think the next step after this is to write a transformer that replaces the two-qubit gates in a circuit with ones that correct for these z-phases. |
No description provided.