qat.qiskit.converters.qiskit_to_qaptiva

qat.qiskit.converters.qiskit_to_qaptiva(quantum_circuit: qiskit.circuit.QuantumCircuit, gates_dict: dict | None = None, sep_measures: bool = False, limit: int = 2)

Converts a Qiskit circuit into a Qaptiva circuit. If a gate is defined by a circuit implementation, this gate can be replaced by its equivalent circuit in the result returned by this method (this technique is called inlining)

Parameters:
  • qiskit_circuit – The Qiskit circuit to convert

  • gates_dict (dict) – A dictionary mapping specific qiskit gates

  • sep_measures (bool, optional) –

    Separates measures from the circuit:

    • if set to True, measures won’t be included in the resulting circuit. This method will then return a tuple composed of the circuit with no measument, and the list of measured qubits.

    • if set to False, measures will be converted normally (Default, set to False)

  • limit (int, optional) – inlining recursion limit

  • **kwargs – Additional parameters passed to the method to_circ(), to generate a Qaptiva Circuit object

Returns:

If sep_measures is set to:

  • True: the result is a tuple composed of a Circuit and a list of qubits that should be measured

  • False: the result is a Circuit

Return type:

tuple or Circuit