qpu_programs module

class qpu_programs.EPLDistillationProgram(num_qubits=None, parallel=True, qubit_mapping=None)[source]

Bases: QuantumProgram

Quantum program for entanglement purification using EPL.

This program applies a CNOT gate between two qubits and measures the target qubit to determine whether the distillation step succeeds.

Parameters:

default_num_qubits (int, optional) – Number of qubits used by the program (default: 2).

Notes

  • Control qubit acts as the source.

  • Target qubit is measured with result stored in m_target.

default_num_qubits = 2

default number of qubits program requires. If -1 it can run on any number of qubits.

Type:

int

program()[source]

Program to be executed.

Override this method to add additional control logic.

By default runs a single sequences of instructions that have been added using apply().

Notes

Returns a generator.

class qpu_programs.EmitProgram(num_qubits=None, parallel=True, qubit_mapping=None)[source]

Bases: QuantumProgram

Quantum program that initializes a qubit and emits an entangled photon.

This program uses two qubits: one is initialized, and then an emit instruction is applied to create an emitted qubit pair.

Notes

  • Uses INSTR_INIT on the first qubit.

  • Applies INSTR_EMIT on a pair of qubits.

program()[source]

Program to be executed.

Override this method to add additional control logic.

By default runs a single sequences of instructions that have been added using apply().

Notes

Returns a generator.

class qpu_programs.SwapProgram(num_qubits=None, parallel=True, qubit_mapping=None)[source]

Bases: QuantumProgram

Quantum program that performs a SWAP operation between two qubits.

Parameters:

default_num_qubits (int, optional) – Number of qubits used by the program (default: 2).

Notes

  • Applies the INSTR_SWAP gate between the two allocated qubits.

default_num_qubits = 2

default number of qubits program requires. If -1 it can run on any number of qubits.

Type:

int

program()[source]

Program to be executed.

Override this method to add additional control logic.

By default runs a single sequences of instructions that have been added using apply().

Notes

Returns a generator.

class qpu_programs.XCorrection(num_qubits=None, parallel=True, qubit_mapping=None)[source]

Bases: QuantumProgram

Quantum program that applies an X (bit-flip) correction.

Parameters:

default_num_qubits (int, optional) – Number of qubits used by the program (default: 1).

Notes

  • Single-qubit X gate applied to the selected qubit.

default_num_qubits = 1

default number of qubits program requires. If -1 it can run on any number of qubits.

Type:

int

program()[source]

Program to be executed.

Override this method to add additional control logic.

By default runs a single sequences of instructions that have been added using apply().

Notes

Returns a generator.

class qpu_programs.YCorrection(num_qubits=None, parallel=True, qubit_mapping=None)[source]

Bases: QuantumProgram

Quantum program that applies a Y (bit and phase-flip) correction.

Parameters:

default_num_qubits (int, optional) – Number of qubits used by the program (default: 1).

Notes

  • Single-qubit Y gate applied to the selected qubit.

default_num_qubits = 1

default number of qubits program requires. If -1 it can run on any number of qubits.

Type:

int

program()[source]

Program to be executed.

Override this method to add additional control logic.

By default runs a single sequences of instructions that have been added using apply().

Notes

Returns a generator.