![]() |
Options for calibrating a PhasedFSim-like gate using XEB.
Inherits From: XEBCharacterizationOptions
cirq.experiments.XEBPhasedFSimCharacterizationOptions(
characterize_theta: bool = True,
characterize_zeta: bool = True,
characterize_chi: bool = True,
characterize_gamma: bool = True,
characterize_phi: bool = True,
theta_default: Optional[float] = None,
zeta_default: Optional[float] = None,
chi_default: Optional[float] = None,
gamma_default: Optional[float] = None,
phi_default: Optional[float] = None
)
Used in the notebooks
Used in the tutorials |
---|
You may want to use more specific subclasses like SqrtISwapXEBOptions
which have sensible defaults.
Attributes | |
---|---|
characterize_theta
|
Whether to characterize θ angle. |
characterize_zeta
|
Whether to characterize ζ angle. |
characterize_chi
|
Whether to characterize χ angle. |
characterize_gamma
|
Whether to characterize γ angle. |
characterize_phi
|
Whether to characterize φ angle. |
theta_default
|
The initial or default value to assume for the θ angle. |
zeta_default
|
The initial or default value to assume for the ζ angle. |
chi_default
|
The initial or default value to assume for the χ angle. |
gamma_default
|
The initial or default value to assume for the γ angle. |
phi_default
|
The initial or default value to assume for the φ angle. |
Methods
defaults_set
defaults_set() -> bool
Whether the default angles are set.
This only considers angles where characterize_{angle} is True. If all such angles have {angle}_default set to a value, this returns True. If none of the defaults are set, this returns False. If some defaults are set, we raise an exception.
get_initial_simplex_and_names
get_initial_simplex_and_names(
initial_simplex_step_size: float = 0.1
) -> Tuple[np.ndarray, List[str]]
Get an initial simplex and parameter names for the optimization implied by these options.
The initial simplex initiates the Nelder-Mead optimization parameter. We
use the standard simplex of x0 + s*basis_vec
where x0 is given by the
xxx_default
attributes, s is initial_simplex_step_size
and basis_vec
is a one-hot encoded vector for each parameter for which the parameterize_xxx
attribute is True.
We also return a list of parameter names so the Cirq param_resovler
can be accurately constructed during optimization.
get_parameterized_gate
get_parameterized_gate()
The parameterized gate to use.
should_parameterize
@staticmethod
should_parameterize( op: 'cirq.Operation' ) -> bool
Whether to replace op
with a parameterized version.
with_defaults_from_gate
with_defaults_from_gate(
gate: 'cirq.Gate',
gate_to_angles_func=cirq.experiments.xeb_fitting.phased_fsim_angles_from_gate
)
A new Options class with {angle}_defaults inferred from gate
.
This keeps the same settings for the characterize_{angle} booleans, but will disregard any current {angle}_default values.
__eq__
__eq__(
other
)