QulacsCircuit¶
- class QulacsCircuit¶
Qulacs-based quantum circuit implementation.
Wraps
QuantumCircuitandObservablefrom Qulacs to satisfy the circuit protocol interface required by QAOA circuit construction.Methods
Apply a CNOT gate with control qubit i and target qubit j.
Apply a controlled-Z gate between qubit i and qubit j.
Apply a Hadamard gate to qubit i.
Apply a Hamiltonian evolution gate
exp(-i * value * H).Apply a phase gate to qubit i.
Apply an Rx rotation gate to qubit i.
Apply an Ry rotation gate to qubit i.
Apply an Rz rotation gate to qubit i.
Apply an S gate to qubit i, inducing a pi/2 phase on the |1> state.
Apply the adjoint of the S gate to qubit i, inducing a -pi/2 phase on the |1> state.
Apply a SWAP gate between qubit i and qubit j.
Apply a sqrt(X) gate to qubit i.
Apply the adjoint of the sqrt(X) gate to qubit i.
Apply a T gate to qubit i, inducing a pi/4 phase on the |1> state.
Apply the adjoint of the T gate to qubit i, inducing a -pi/4 phase on the |1> state.
Apply a general single-qubit unitary gate to qubit i.
Apply a Pauli-X gate to qubit i.
Apply a Pauli-Y gate to qubit i.
Apply a Pauli-Z gate to qubit i.
Return the observable implementation class used by this circuit.
Attributes
Number of qubits in the circuit.
Underlying Qulacs
QuantumCircuitobject.- class QulacsObservable¶
Observable builder backed by
Observablefrom Qulacs.Accumulates Pauli-X and Pauli-Z terms to construct a Hamiltonian used as the generator of a unitary rotation gate.
- add_pauli_x(num_qubits: int, bit_index: int, value: float) Self¶
- add_pauli_x(num_qubits: int, bit_index: Iterable[int], value: float) Self
Add a weighted Pauli-X term acting on the specified qubit(s).
- add_pauli_y(num_qubits: int, bit_index: int, value: float) Self¶
- add_pauli_y(num_qubits: int, bit_index: Iterable[int], value: float) Self
Add a weighted Pauli-Y term acting on the specified qubit(s).
- add_pauli_z(num_qubits: int, bit_index: int, value: float) Self¶
- add_pauli_z(num_qubits: int, bit_index: Iterable[int], value: float) Self
Add a weighted Pauli-Z term acting on the specified qubit(s).
- property raw: Observable¶
Return the underlying Qulacs
Observable.
- T_circuit¶
QuantumCircuitの別名です。
- T_obs¶
Observableの別名です。
- classmethod get_observable_class() type[QulacsObservable]¶
Return the observable implementation class used by this circuit.
- add_h_gate(i: int) Self¶
Apply a Hadamard gate to qubit i.
- パラメータ:
i (int) -- Target qubit index.
- 戻り値:
This instance, for chaining.
- 戻り値の型:
Self
- add_observable_rotation_gate( ) Self¶
Apply a Hamiltonian evolution gate
exp(-i * value * H).
- add_s_gate(i: int) Self¶
Apply an S gate to qubit i, inducing a pi/2 phase on the |1> state.
- パラメータ:
i (int) -- Target qubit index.
- 戻り値:
This instance, for chaining.
- 戻り値の型:
Self
- add_sdg_gate(i: int) Self¶
Apply the adjoint of the S gate to qubit i, inducing a -pi/2 phase on the |1> state.
- パラメータ:
i (int) -- Target qubit index.
- 戻り値:
This instance, for chaining.
- 戻り値の型:
Self
- add_sx_gate(i: int) Self¶
Apply a sqrt(X) gate to qubit i.
- パラメータ:
i (int) -- Target qubit index.
- 戻り値:
This instance, for chaining.
- 戻り値の型:
Self
- add_sxdg_gate(i: int) Self¶
Apply the adjoint of the sqrt(X) gate to qubit i.
- パラメータ:
i (int) -- Target qubit index.
- 戻り値:
This instance, for chaining.
- 戻り値の型:
Self
- add_t_gate(i: int) Self¶
Apply a T gate to qubit i, inducing a pi/4 phase on the |1> state.
- パラメータ:
i (int) -- Target qubit index.
- 戻り値:
This instance, for chaining.
- 戻り値の型:
Self
- add_tdg_gate(i: int) Self¶
Apply the adjoint of the T gate to qubit i, inducing a -pi/4 phase on the |1> state.
- パラメータ:
i (int) -- Target qubit index.
- 戻り値:
This instance, for chaining.
- 戻り値の型:
Self
- add_u_gate(i: int, theta: float, phi: float, lam: float) Self¶
Apply a general single-qubit unitary gate to qubit i.
- add_x_gate(i: int) Self¶
Apply a Pauli-X gate to qubit i.
- パラメータ:
i (int) -- Target qubit index.
- 戻り値:
This instance, for chaining.
- 戻り値の型:
Self
- add_y_gate(i: int) Self¶
Apply a Pauli-Y gate to qubit i.
- パラメータ:
i (int) -- Target qubit index.
- 戻り値:
This instance, for chaining.
- 戻り値の型:
Self
- add_z_gate(i: int) Self¶
Apply a Pauli-Z gate to qubit i.
- パラメータ:
i (int) -- Target qubit index.
- 戻り値:
This instance, for chaining.
- 戻り値の型:
Self
- property raw: QuantumCircuit¶
Underlying Qulacs
QuantumCircuitobject.