qib.algorithms.qubitization.projector_controlled_phase_shift.ProjectorControlledPhaseShift¶
- class qib.algorithms.qubitization.projector_controlled_phase_shift.ProjectorControlledPhaseShift(theta: float = 0, projection_state: Sequence[int] = [0], encoding_qubits: Qubit | Sequence[Qubit] | None = None, auxiliary_qubits: Qubit | Sequence[Qubit] | None = None, method='auxiliary')[source]¶
Bases:
objectProjector-controlled phase shift circuit. Building block for Qubitization. 2 possible methods: “auxiliary” or “c-phase”. Projector is state |0>, |00>… on the encoding (auxiliary) qubitS.
Methods
Generates the circuit.
Generate the matrix representation of the controlled gate.
Set the auxiliary qubits.
Set the encoding qubits.
Set the method.
Set the projection state.
Set the angle theta.
Attributes
The number of "wires" (or quantum particles) this gate acts on.
- as_circuit()[source]¶
Generates the circuit. * with ‘auxiliary’ method I have an extra wire. * In order to compare it to as_matrix() you need to compare only the half upper-left block.
- as_matrix()[source]¶
Generate the matrix representation of the controlled gate. The extra wire from ‘auxiliary’ method is not taken into account.
- property num_wires¶
The number of “wires” (or quantum particles) this gate acts on. One extra wire with method ‘auxiliary’.
- set_auxiliary_qubits(*args)[source]¶
Set the auxiliary qubits. Only works if the method is set to auxiliary.