qiskit_conversion
Module to convert qiskit objects.
attributePAULI_EVOLUTION_EQUIVALENT= {'rx', 'ry', 'rz', 'rxx', 'ryy', 'rzz', 'rxy', 'rxz', 'ryz'}attributeVALID_PAULI_GATES= PAULI_EVOLUTION_EQUIVALENT.union({'PauliEvolution'})funcfrom_qiskit_operator(qiskit_op, *, atol=1e-08, force_real=False) -> PauliOperatorConvert a Qiskit operator to a PauliOperator.
paramqiskit_opSparsePauliOpA qiskit Pauli operator.
paramatolfloat= 1e-08Absolute tolerance for the simplify() run first, which drops smaller terms.
paramforce_realbool= FalseCast the coefficients to real, raising if any is not numerically real.
Returns
monoprop.pauli.PauliOperatorfuncto_qiskit_operator(pauli_dict) -> SparsePauliOpConvert a dictionary of Pauli strings with their coefficients to a Qiskit operator.
parampauli_dictdict[str, complex] | dict[str, float]Pauli strings in monoprop order (leftmost letter on qubit 0); each key is reversed into qiskit's little-endian label order.
Returns
qiskit.quantum_info.SparsePauliOpfuncfrom_qiskit_circuit(circuit, initial_state) -> CircuitConvert a Qiskit circuit to a Circuit.
The qiskit circuit must hold only PauliEvolutionGates (or the equivalent rotations in
PAULI_EVOLUTION_EQUIVALENT) with commuting operators; barriers are ignored. Each gate
becomes one ExpGate driven by its own angle (the identity parameter
mapping), with the generator's coefficients negated so the angles carry through unchanged (see
_negated).
paramcircuitQuantumCircuitparaminitial_statelist[int]Returns
monoprop.circuit.Circuitfuncto_qiskit_circuit(circuit, num_qubits) -> QuantumCircuitConvert a Circuit to a Qiskit circuit.
The result holds only PauliEvolutionGates. Each gate's evolution time is taken from the
circuit's parameters via its parameter mapping, and each generator's coefficients are
negated to turn monoprop's exp(+i theta H) back into qiskit's exp(-i t H) (see
_negated). Pass the observable's num_qubits as the width of the result.
paramcircuitCircuitparamnum_qubitsintReturns
qiskit.QuantumCircuit