qibocal.protocols.two_qubit_interaction.chsh package#
Submodules#
qibocal.protocols.two_qubit_interaction.chsh.circuits module#
Auxiliary functions to run CHSH using circuits.
- qibocal.protocols.two_qubit_interaction.chsh.circuits.create_bell_circuit(theta=0.7853981633974483, bell_state=0)[source]#
Creates the circuit to generate the bell states and with a theta-measurement bell_state chooses the initial bell state for the test: 0 -> |00>+|11> 1 -> |00>-|11> 2 -> |10>-|01> 3 -> |10>+|01> Native defaults to only using GPI2 and GPI gates.
- qibocal.protocols.two_qubit_interaction.chsh.circuits.create_bell_circuit_native(theta=0.7853981633974483, bell_state=0)[source]#
Creates the circuit to generate the bell states and with a theta-measurement bell_state chooses the initial bell state for the test: 0 -> |00>+|11> 1 -> |00>-|11> 2 -> |10>-|01> 3 -> |10>+|01> Native defaults to only using GPI2 and GPI gates.
- qibocal.protocols.two_qubit_interaction.chsh.circuits.create_chsh_circuits(theta=0.7853981633974483, bell_state=0, native=True, readout_basis=['ZZ', 'ZX', 'XZ', 'XX'])[source]#
Creates the circuits needed for the 4 measurement settings for chsh. Native defaults to only using GPI2 and GPI gates. rerr adds a readout bitflip error to the simulation.
qibocal.protocols.two_qubit_interaction.chsh.protocol module#
Protocol for CHSH experiment using both circuits and pulses.
- qibocal.protocols.two_qubit_interaction.chsh.protocol.CLASSICAL_BOUND = 2#
Classical limit of CHSH,
- qibocal.protocols.two_qubit_interaction.chsh.protocol.QUANTUM_BOUND = 2.8284271247461903#
Quantum limit of CHSH.
- qibocal.protocols.two_qubit_interaction.chsh.protocol.MITIGATION_MATRIX_FILE = 'mitigation_matrix'#
File where readout mitigation matrix is stored.
- class qibocal.protocols.two_qubit_interaction.chsh.protocol.CHSHParameters(bell_states: list, ntheta: int, native: Optional[bool] = False, apply_error_mitigation: Optional[bool] = False)[source]#
Bases:
Parameters
CHSH runcard inputs.
- class qibocal.protocols.two_qubit_interaction.chsh.protocol.CHSHData(bell_states: list, thetas: list, data: dict[typing.Union[str, int], typing.Union[str, int], int, tuple, str] = <factory>, mitigation_matrix: dict[tuple[typing.Union[str, int], ...], numpy.ndarray[typing.Any, numpy.dtype[+_ScalarType_co]]] = <factory>)[source]#
Bases:
Data
CHSH Data structure.
- mitigation_matrix: dict[tuple[typing.Union[str, int], ...], numpy.ndarray[typing.Any, numpy.dtype[+_ScalarType_co]]]#
Mitigation matrix computed using the readout_mitigation_matrix protocol.
- _to_npz(path: Path, filename: str)#
Helper function to use np.savez while converting keys into strings.
- property pairs#
Access qubit pairs ordered alphanumerically from data structure.
- property params#
Convert non-arrays attributes into dict.
- property qubits#
Access qubits from data structure.
- class qibocal.protocols.two_qubit_interaction.chsh.protocol.CHSHResults(chsh: dict[tuple[typing.Tuple[typing.Union[str, int], typing.Union[str, int]], int], float] = <factory>, chsh_mitigated: dict[tuple[typing.Tuple[typing.Union[str, int], typing.Union[str, int]], int], float] = <factory>)[source]#
Bases:
Results
CHSH Results class.
- qibocal.protocols.two_qubit_interaction.chsh.protocol._acquisition_pulses(params: CHSHParameters, platform: Platform, targets: list[list[Union[str, int]]]) CHSHData [source]#
Data acquisition for CHSH protocol using pulse sequences.
- qibocal.protocols.two_qubit_interaction.chsh.protocol._acquisition_circuits(params: CHSHParameters, platform: Platform, targets: list[Tuple[Union[str, int], Union[str, int]]]) CHSHData [source]#
Data acquisition for CHSH protocol using circuits.
- qibocal.protocols.two_qubit_interaction.chsh.protocol._plot(data: CHSHData, fit: CHSHResults, target: Tuple[Union[str, int], Union[str, int]])[source]#
Plotting function for CHSH protocol.
- qibocal.protocols.two_qubit_interaction.chsh.protocol._fit(data: CHSHData) CHSHResults [source]#
Fitting for CHSH protocol.
- qibocal.protocols.two_qubit_interaction.chsh.protocol.chsh_circuits = Routine(acquisition=<function _acquisition_circuits>, fit=<function _fit>, report=<function _plot>, update=<function _dummy_update>, two_qubit_gates=True)#
CHSH experiment using circuits.
- qibocal.protocols.two_qubit_interaction.chsh.protocol.chsh_pulses = Routine(acquisition=<function _acquisition_pulses>, fit=<function _fit>, report=<function _plot>, update=<function _dummy_update>, two_qubit_gates=True)#
CHSH experiment using pulses.
qibocal.protocols.two_qubit_interaction.chsh.pulses module#
Auxialiary functions to run CHSH using pulses.
- qibocal.protocols.two_qubit_interaction.chsh.pulses.create_bell_sequence(platform, qubits, theta=0.7853981633974483, bell_state=0)[source]#
Creates the pulse sequence to generate the bell states and with a theta-measurement bell_state chooses the initial bell state for the test: 0 -> |00>+|11> 1 -> |00>-|11> 2 -> |10>-|01> 3 -> |10>+|01>
qibocal.protocols.two_qubit_interaction.chsh.utils module#
Auxiliary functions to run CHSH protocol.