-
Notifications
You must be signed in to change notification settings - Fork 984
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
[XEB] Allow default angles to be inferred from a gate #4092
Conversation
'phi_default': 0.0, | ||
} | ||
if gate == SQRT_ISWAP: | ||
defaults['theta_default'] = -np.pi / 4 |
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 should set also phi_default to np.pi / 24 here and below. This might improve the optimization speed? I'll try this setting as soon I have a chance. We can change this in a follow-up.
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 this would be a dangerous semantic to introduce in cirq-core
, which is where this function currently lives. Please be aware that if you set characterize_phi=False
, the fixed value will be set to phi_default
. I don't know if this would help or hurt when you're only optimizing phases.
Options:
- [my preference] have a wrapper like
SqrtISwapXEBOptions
(GoogleSqrtISwapXEBOptions
) that sets {angle}_default values and tell users to use it instead of the automatically-determine-from-gate when you're using SqrtIswap on a google processor because it can help with phi characterization - Inject a different
phased_fsim_angles_from_gate
if you're running viacirq_google.workflow
- [radical] Introduce a new sqrt-iswap-like gate defined to ideally have phi of np.pi/24 and have people write their algorithms with this gate. Then the angle determination would work automatically. You could still treat it as an iswap gate but you'd have to explicitly neglect the small conditional phase
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 like option 2 but maybe let's play with this future a little bit if that would make any difference at all?
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 included the gate-angle-inference function as an argument to the method to support option 2
I manually checked notebooks as well since I was suspicious they didn't require any changes, but they all use |
Instead of defaulting angles to 0.0 -- which is a very sharp edge that can cause optimization to fail -- default to `None` and either require the user fully specify the angle settings or provide a gate to get sensible defaults from. In `xeb_wrapper` this gate is already around as the calibration request gate.
Instead of defaulting angles to 0.0 -- which is a very sharp edge that can cause optimization to fail -- default to
None
and either require the user fully specify the angle settings or provide a gate to get sensible defaults from. Inxeb_wrapper
this gate is already around as the calibration request gate.