quri_parts.circuit.transpile package#
- class quri_parts.circuit.transpile.CircuitTranspilerProtocol(*args, **kwargs)#
Bases:
Protocol
Protocol of callable class that transpiles NonParametricQuantumCircuit to NonParametricQuantumCircuit.
- class quri_parts.circuit.transpile.GateDecomposer(*args, **kwargs)#
Bases:
CircuitTranspilerProtocol
,ABC
Abstract class that represents CircuitTranspiler, such that target gates are selected by decision function and each target gate is replaced by a sequence of multiple gates.
- abstract is_target_gate(gate: QuantumGate) bool #
Determine if a given gate is subject to decomposition.
- Parameters:
gate – Gates in the circuit that are scanned from the front.
- abstract decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.GateKindDecomposer(*args, **kwargs)#
Bases:
GateDecomposer
,ABC
Abstract class that represents CircuitTranspiler, such that each gate is identified by its gate name and the target gate is replaced by a sequence of multiple gates.
Classes inheriting from this class can be used for ParallelDecomposer.
- abstract property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- is_target_gate(gate: QuantumGate) bool #
Determine if a given gate is subject to decomposition.
- Parameters:
gate – Gates in the circuit that are scanned from the front.
- class quri_parts.circuit.transpile.ParallelDecomposer(decomposers: Sequence[GateKindDecomposer])#
Bases:
CircuitTranspilerProtocol
CircuitTranspiler, which executes given GateKindDecomposer within a single loop traversing the gate from the front.
- Parameters:
decomposers – Sequence of GateKindDecomposer with no duplicate gate types to act on.
- class quri_parts.circuit.transpile.SequentialTranspiler(transpilers: Sequence[Callable[[NonParametricQuantumCircuit], NonParametricQuantumCircuit]])#
Bases:
CircuitTranspilerProtocol
CircuitTranspiler, which applies CircuitTranspilers in sequence.
- Parameters:
transpilers – Sequence of CircuitTranspilers.
Examples
transpiler = SequentialTranspiler( [ ATranspiler(), BTranspiler(arg..), .. ] ) circuit = transpiler(circuit)
- quri_parts.circuit.transpile.RZSetTranspiler()#
CircuitTranspiler to transpile a QuntumCircuit into another QuantumCircuit containing only X, SqrtX, CNOT, and RZ. (UnitaryMatrix gate for 3 or more qubits are not decomposed.)
- quri_parts.circuit.transpile.RotationSetTranspiler()#
CircuitTranspiler to transpile a QuntumCircuit into another QuantumCircuit containing only RX, RY, RZ, and CNOT. (UnitaryMatrix gate for 3 or more qubits are not decomposed.)
- class quri_parts.circuit.transpile.CliffordRZSetTranspiler(epsilon: float = 1e-09)#
Bases:
SequentialTranspiler
CircuitTranspiler to transpile a QuntumCircuit into another QuantumCircuit containing only H, X, Y, Z, SqrtX, SqrtXdag, SqrtY, SqrtYdag, S, Sdg, RZ, CZ, and CNOT.
Since this transpiler involves fusing rotation gates, converting rotation gates to named gates with a certain precision, and removing Identity gates, the action of the circuit before and after the conversion may not be completely equivalent.
- class quri_parts.circuit.transpile.CliffordApproximationTranspiler(*args, **kwargs)#
Bases:
GateDecomposer
CircuitTranspiler, which replaces the non_clifford gate into sequence of non-parametric Clifford gates.
If the input gate has angles, this transpiler replaces them with the closest value in the set \(\{\pi n /2| n\in\mathbb{Z}\}\). Then by using the rotation gate transpilers, it is decomposed into a sequence of non-parametric Clifford gates.
- is_target_gate(gate: QuantumGate) bool #
Determine if a given gate is subject to decomposition.
- Parameters:
gate – Gates in the circuit that are scanned from the front.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.IdentityEliminationTranspiler(*args, **kwargs)#
Bases:
CircuitTranspilerProtocol
Generate a new circuit by removing all Identity gates from the given circuit.
- class quri_parts.circuit.transpile.IdentityInsertionTranspiler#
Bases:
CircuitTranspilerProtocol
If there are qubits to which any gate has not been applied, Identity gates are added for those qubits.
The application of this transpiler ensures that every qubit has at least one gate acting on it.
- class quri_parts.circuit.transpile.Identity2RZTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which converts Identity gates into RZ gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.PauliDecomposeTranspiler#
Bases:
GateKindDecomposer
CircuitTranspiler, which decompose multi-qubit Pauli gates into X, Y, and Z gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.PauliRotationDecomposeTranspiler#
Bases:
GateKindDecomposer
CircuitTranspiler, which decompose multi-qubit PauliRotation gates into H, RX, RZ, and CNOT gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.CNOT2CZHTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes CNOT gates into sequences of H and CZ gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.CZ2CNOTHTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes CZ gates into sequences of H and CNOT gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.CZ2RXRYCNOTTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes CZ gates into sequences of RX, RY, and CNOT gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.FuseRotationTranspiler(*args, **kwargs)#
Bases:
TwoGateFuser
CircuitTranspiler, which fuses consecutive rotation gates of the same kind acting on the same qubit.
- is_target_pair(left: QuantumGate, right: QuantumGate) bool #
- fuse(left: QuantumGate, right: QuantumGate) Sequence[QuantumGate] #
- class quri_parts.circuit.transpile.NormalizeRotationTranspiler(cycle_range: tuple[float, float] = (0.0, 6.283185307179586), epsilon: float = 1e-09)#
Bases:
GateKindDecomposer
Normalize the parameters of the rotation gates (RX, RY, and RZ) so that they are in the specified range (0 to 2PI by default).
- Parameters:
cycle_range – Specify a range of width 2PI in the form of (lower limit,
exclusive. (upper limit). Lower limit is inclusive and upper limit is) –
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.H2RXRYTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes H gates into sequences of RX and RY gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.H2RZSqrtXTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes H gates into sequences of RZ and SqrtX gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.QubitRemappingTranspiler(qubit_mapping: Mapping[int, int])#
Bases:
CircuitTranspilerProtocol
Remap qubits in the circuit with the specified mapping.
The mapping
qubit_mapping
should be specified with “from” qubit indices as keys and “to” qubit indices as values. For example, if you want to convert a circuit using qubits 0, 1, 2, 3 by mapping them as 0 → 4, 1 → 2, 2 → 5, 3 → 0, then thequbit_mapping
should be{0: 4, 1: 2, 2: 5, 3: 0}
. Thequbit_count
of the converted circuit is determined by the largest destination qubit index. In the above example, the largest index is 5, so the converted circuit is for 6 qubits.
- class quri_parts.circuit.transpile.RX2RZSqrtXTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes RX gates into sequences of RZ and SqrtX gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.RY2RZSqrtXTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes RY gates into sequences of RZ and SqrtX gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.RX2NamedTranspiler(epsilon: float = 1e-09)#
Bases:
GateKindDecomposer
Convert RX gate to Identity or X gate if it is equivalent to Identity, X, SqrtX, or SqrtXdag gate.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.RY2NamedTranspiler(epsilon: float = 1e-09)#
Bases:
GateKindDecomposer
Convert RY gate to Identity or Y gate if it is equivalent to Identity, Y, SqrtY, or SqrtYdag gate.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.RZ2NamedTranspiler(epsilon: float = 1e-09)#
Bases:
GateKindDecomposer
Convert RZ gate to Identity, Z, S, Sdag, T, or Tdag gate if it is equivalent to a sequence of these gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.S2RZTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes S gates into of gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.Sdag2RZTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes Sdag gates into RZ gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.SingleQubitUnitaryMatrix2RYRZTranspiler(*args, **kwargs)#
Bases:
GateDecomposer
CircuitTranspiler, which decomposes single qubit UnitaryMatrix gates into gate sequences containing RY and RZ gates.
- Ref:
- [1]: Tomonori Shirakawa, Hiroshi Ueda, and Seiji Yunoki,
Automatic quantum circuit encoding of a given arbitrary quantum state, arXiv:2112.14524v1, p.22, (2021).
- [2]: Main functions are ported from the source code wrtitten by Sota Morisaki
in QunaSys intern project.
- is_target_gate(gate: QuantumGate) bool #
Determine if a given gate is subject to decomposition.
- Parameters:
gate – Gates in the circuit that are scanned from the front.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.SqrtX2RXTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which converts SqrtX gates into RX gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.SqrtX2RZHTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes SqrtX gates into sequences of RZ and H gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.SqrtXdag2RXTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which converts SqrtXdag gates into RX gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.SqrtXdag2RZSqrtXTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes SqrtXdag gates into sequences of RZ and SqrtX gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.SqrtY2RYTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which converts SqrtY gates into RY gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.SqrtY2RZSqrtXTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes SqrtY gates into sequences of RZ and SqrtX gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.SqrtYdag2RYTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.SqrtYdag2RZSqrtXTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes SqrtYdag gates into sequences of RZ and SqrtX gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.SWAP2CNOTTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes SWAP gates into sequences of CNOT gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.T2RZTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes T gates into RZ gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.Tdag2RZTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes Tdag gates into RZ gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.TOFFOLI2HTTdagCNOTTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes TOFFOLI gates into sequences of H, T, TDag, and CNOT gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.TwoQubitUnitaryMatrixKAKTranspiler(*args, **kwargs)#
Bases:
GateDecomposer
CircuitTranspiler, which decomposes two qubit UnitaryMatrix gates into gate sequences containing H, S, RX, RY, RZ, and CNOT gates.
- Raises:
ValueError – Depending on the nature of the unitary matrix of the input UnitaryMatrix gate, the decomposition may fail and throw an error.
- Ref:
- [1]: Tomonori Shirakawa, Hiroshi Ueda, and Seiji Yunoki,
Automatic quantum circuit encoding of a given arbitrary quantum state, arXiv:2112.14524v1, pp.4-5, (2021).
- [2]: Main functions are ported from the source code wrtitten by Sota Morisaki
in QunaSys intern project.
- is_target_gate(gate: QuantumGate) bool #
Determine if a given gate is subject to decomposition.
- Parameters:
gate – Gates in the circuit that are scanned from the front.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.U1ToRZTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes U1 gates into RZ gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.U2ToRXRZTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes U2 gates into sequences of RX and RZ gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.U2ToRZSqrtXTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes U2 gates into sequences of RZ and SqrtX gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.U3ToRXRZTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes U3 gates into sequences of RX and RZ gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.U3ToRZSqrtXTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes U3 gates into sequences of RZ and SqrtX gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.X2HZTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes X gates into sequences of H and Z gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.X2RXTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which converts X gates into RX gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.X2SqrtXTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes X gates into sequences of SqrtX gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.Y2RYTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which converts Y gates into RY gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.Y2RZXTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes Y gates into sequences of RZ and T gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.Z2HXTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes Z gates into sequences of H and X gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- class quri_parts.circuit.transpile.Z2RZTranspiler(*args, **kwargs)#
Bases:
GateKindDecomposer
CircuitTranspiler, which decomposes Z gates into RZ gates.
- property target_gate_names: Sequence[str]#
Returns the set of gate names to be decomposed.”.
- decompose(gate: QuantumGate) Sequence[QuantumGate] #
Describe the specific decomposition process. Only the target gates satisfying is_target_gate() method are passed.
- Parameters:
gate – The gates to be decomposed.
- quri_parts.circuit.transpile.su2_decompose(ut: Sequence[Sequence[complex]], eps: float = 1e-15) ndarray[Any, dtype[float64]] #
- quri_parts.circuit.transpile.su4_decompose(ut: Sequence[Sequence[complex]], eiglim: float = 1e-10) tuple[ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]]] #
Submodules#
- quri_parts.circuit.transpile.clifford_approximation module
- quri_parts.circuit.transpile.fuse module
- quri_parts.circuit.transpile.gate_kind_decomposer module
CNOT2CZHTranspiler
CZ2CNOTHTranspiler
CZ2RXRYCNOTTranspiler
H2RZSqrtXTranspiler
H2RXRYTranspiler
Identity2RZTranspiler
RX2RZSqrtXTranspiler
RY2RZSqrtXTranspiler
S2RZTranspiler
Sdag2RZTranspiler
SqrtX2RXTranspiler
SqrtX2RZHTranspiler
SqrtXdag2RXTranspiler
SqrtXdag2RZSqrtXTranspiler
SqrtY2RYTranspiler
SqrtY2RZSqrtXTranspiler
SqrtYdag2RYTranspiler
SqrtYdag2RZSqrtXTranspiler
SWAP2CNOTTranspiler
T2RZTranspiler
Tdag2RZTranspiler
TOFFOLI2HTTdagCNOTTranspiler
U1ToRZTranspiler
U2ToRZSqrtXTranspiler
U2ToRXRZTranspiler
U3ToRZSqrtXTranspiler
U3ToRXRZTranspiler
X2HZTranspiler
X2RXTranspiler
X2SqrtXTranspiler
Y2RZXTranspiler
Y2RYTranspiler
Z2RZTranspiler
Z2HXTranspiler
- quri_parts.circuit.transpile.identity_manipulation module
- quri_parts.circuit.transpile.multi_pauli_decomposer module
- quri_parts.circuit.transpile.qubit_remapping module
- quri_parts.circuit.transpile.transpiler module
- quri_parts.circuit.transpile.unitary_matrix_decomposer module