quri_parts.circuit.gate module#

class QuantumGate(name, target_indices, control_indices=(), classical_indices=(), params=(), pauli_ids=(), unitary_matrix=())#

Bases: NamedTuple

Non-parametric quantum gate.

Not intended for direct use. Every gate is created by factory methods. A QuantumGate object contains information of gate name, control qubit, target qubit, classical bits, parameters, and pauli ids.

Parameters:
  • name (str) –

  • target_indices (Sequence[int]) –

  • control_indices (Sequence[int]) –

  • classical_indices (Sequence[int]) –

  • params (Sequence[float]) –

  • pauli_ids (Sequence[int]) –

  • unitary_matrix (Sequence[Sequence[complex]]) –

name: str#

Alias for field number 0

target_indices: Sequence[int]#

Alias for field number 1

control_indices: Sequence[int]#

Alias for field number 2

classical_indices: Sequence[int]#

Alias for field number 3

params: Sequence[float]#

Alias for field number 4

pauli_ids: Sequence[int]#

Alias for field number 5

unitary_matrix: Sequence[Sequence[complex]]#

Alias for field number 6

class ParametricQuantumGate(name, target_indices, control_indices=(), pauli_ids=())#

Bases: NamedTuple

Parametric quantum gate.

Not intended for direct use. Every gate is created through factory methods. A ParametricQuantumGate object contains information of gate name, control qubit, target qubit, and pauli ids.

Parameters:
  • name (str) –

  • target_indices (Sequence[int]) –

  • control_indices (Sequence[int]) –

  • pauli_ids (Sequence[int]) –

name: str#

Alias for field number 0

target_indices: Sequence[int]#

Alias for field number 1

control_indices: Sequence[int]#

Alias for field number 2

pauli_ids: Sequence[int]#

Alias for field number 3

is_gate_equal(gate1, gate2)#
Parameters:
  • gate1 (_QuantumGateT) –

  • gate2 (_QuantumGateT) –

Return type:

bool