# CrossResonanceHamiltonian¶

class CrossResonanceHamiltonian(qubits, flat_top_widths, backend=None, cr_gate=None, **kwargs)[source]

Cross resonance Hamiltonian tomography experiment.

Overview

This experiment assumes the two qubit Hamiltonian in the form

$H = \frac{I \otimes A}{2} + \frac{Z \otimes B}{2}$

where $$A$$ and $$B$$ are linear combinations of the Pauli operators $$\in {X, Y, Z}$$. The coefficient of each Pauli term in the Hamiltonian can be estimated with this experiment.

This experiment is performed by stretching the pulse duration of a cross resonance pulse and measuring the target qubit by projecting onto the x, y, and z bases. The control qubit state dependent (controlled-) Rabi oscillation on the target qubit is observed by repeating the experiment with the control qubit both in the ground and excited states. The fit for the oscillations in the three bases with the two control qubit preparations tomographically reconstructs the Hamiltonian in the form shown above. See Ref. [1] for more details.

More specifically, the following circuits are executed in this experiment.

(X measurement)

┌───┐┌────────────────────┐
q_0: ┤ P ├┤0                   ├────────
└───┘│  cr_tone(duration) │┌───┐┌─┐
q_1: ─────┤1                   ├┤ H ├┤M├
└────────────────────┘└───┘└╥┘
c: 1/═════════════════════════════════╩═
0

(Y measurement)

┌───┐┌────────────────────┐
q_0: ┤ P ├┤0                   ├───────────────
└───┘│  cr_tone(duration) │┌─────┐┌───┐┌─┐
q_1: ─────┤1                   ├┤ Sdg ├┤ H ├┤M├
└────────────────────┘└─────┘└───┘└╥┘
c: 1/════════════════════════════════════════╩═
0

(Z measurement)

┌───┐┌────────────────────┐
q_0: ┤ P ├┤0                   ├───
└───┘│  cr_tone(duration) │┌─┐
q_1: ─────┤1                   ├┤M├
└────────────────────┘└╥┘
c: 1/════════════════════════════╩═
0


The P gate on the control qubit (q_0) indicates the state preparation. Since this experiment requires two sets of sub experiments with the control qubit in the excited and ground state, P will become X gate or just be omitted, respectively. Here cr_tone is implemented by a single cross resonance tone driving the control qubit at the frequency of the target qubit. The pulse envelope is the flat-topped Gaussian implemented by the parametric pulse GaussianSquare.

This experiment scans the flat-top width of the GaussianSquare envelope with the fixed rising and falling edges. The total pulse duration is implicitly computed to meet the timing constraints of the target backend. The edge duration is usually computed as

$\tau_{\rm edges} = 2 r \sigma,$

where the $$r$$ is the ratio of the actual edge duration to $$\sigma$$ of the Gaussian rising and falling edges. Note that actual edge duration is not identical to the net duration because of the smaller pulse amplitude of the edges.

The net edge duration is an extra fitting parameter with initial guess

$\tau_{\rm edges}' = \sqrt{2 \pi} \sigma,$

which is derived by assuming a square edges with the full pulse amplitude.

References

[1] Sarah Sheldon, Easwar Magesan, Jerry M. Chow, Jay M. Gambetta, Procedure for systematically tuning up crosstalk in the cross resonance gate, Phys. Rev. A 93, 060302 (2016), doi: 10.1103/PhysRevA.93.060302 (open)

Tutorials

Qiskit Textbook 6.7 (open)

Analysis Class Reference

CrossResonanceHamiltonianAnalysis

Experiment Options

These options can be set by set_experiment_options() method.

Parameters:
• flat_top_widths (np.ndarray) – The total duration of the square part of cross resonance pulse(s) to scan, in units of dt. This can start from zero and take positive real values representing the durations. Pulse edge effect is considered as an offset to the durations.

• amp (complex) – Amplitude of the cross resonance tone.

• amp_t (complex) – Amplitude of the cancellation or rotary drive on target qubit.

• sigma (float) – Sigma of Gaussian rise and fall edges, in units of dt.

• risefall (float) – Ratio of edge durations to sigma.

Transpiler Options

This option can be set by set_transpile_options() method.

This option is used for circuit optimization. See the documentation of qiskit.transpile for available options.

Backend Run Options

This option can be set by set_run_options() method.

This option is used for controlling job execution condition. Note that this option is provider dependent. See provider’s backend runner API for available options. See the documentation of IBMQBackend.run for the IBM Quantum Service.

Initialization

Create a new experiment.

Parameters:
• qubits (Tuple[int, int]) – Two-value tuple of qubit indices on which to run tomography. The first index stands for the control qubit.

• flat_top_widths (Iterable[float]) – The total duration of the square part of cross resonance pulse(s) to scan, in units of dt. The total pulse duration including Gaussian rising and falling edges is implicitly computed with experiment parameters sigma and risefall.

• backend (Optional[Backend]) – Optional, the backend to run the experiment on.

• cr_gate (Optional[Type[Gate]]) – Optional, circuit gate instruction of cross resonance pulse.

• kwargs – Pulse parameters. See experiment_options() for details.

Raises:

QiskitError – When qubits length is not 2.

Attributes

 CrossResonanceHamiltonian.analysis Return the analysis instance for the experiment CrossResonanceHamiltonian.analysis_options Return the analysis options for run() analysis. CrossResonanceHamiltonian.backend Return the backend for the experiment CrossResonanceHamiltonian.experiment_options Return the options for the experiment. CrossResonanceHamiltonian.experiment_type Return experiment type. CrossResonanceHamiltonian.num_pulses CrossResonanceHamiltonian.num_qubits Return the number of qubits for the experiment. CrossResonanceHamiltonian.physical_qubits Return the device qubits for the experiment. CrossResonanceHamiltonian.run_options Return options values for the experiment run() method. CrossResonanceHamiltonian.transpile_options Return the transpiler options for the run() method.

Methods

 Return a list of experiment circuits. Return the config dataclass for this experiment Return a copy of the experiment Initialize an experiment from experiment config CrossResonanceHamiltonian.run([backend, ...]) Run an experiment and perform analysis. Set the experiment options. Set options values for the experiment run() method. Set the transpiler options for run() method.