qib.algorithms.qubitization.eigenvalue_transformation.EigenvalueTransformation

class qib.algorithms.qubitization.eigenvalue_transformation.EigenvalueTransformation(block_encoding: Gate, processing: ProjectorControlledPhaseShift, theta_seq: Sequence[float] | None = None)[source]

Bases: object

Eigenvalue transformation for a given unitary (encoding). It requires the unitary gate that gets processed, the projector-controlled phase shift and the list of angles for the processing.

Methods

as_circuit

Generates the qubitization circuit.

as_matrix

Generate the matrix representation of the eigenvalue transformation. Format: |enc_extra> x |encoded_state> Auxiliary wire from 'auxiliary' method is not taken into account.

set_auxiliary_qubits

Set the auxiliary qubits.

set_encoding_qubits

Set the encoding extra qubits.

set_method

Set the method.

set_projection_state

Set the projection state.

set_theta_seq

Set the angles theta for the eigenvalue transformation.

Attributes

num_wires

The number of "wires" (or quantum particles) this gate acts on.

as_circuit()[source]

Generates the qubitization 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 eigenvalue transformation. Format: |enc_extra> x |encoded_state> Auxiliary wire from ‘auxiliary’ method is not taken into account.

property num_wires

The number of “wires” (or quantum particles) this gate acts on.

set_auxiliary_qubits(q_anc: Qubit | Sequence[Qubit])[source]

Set the auxiliary qubits.

set_encoding_qubits(q_enc: Qubit | Sequence[Qubit])[source]

Set the encoding extra qubits.

set_method(method='auxiliary')[source]

Set the method.

set_projection_state(projection_state: Sequence[int] = [1, 0])[source]

Set the projection state.

set_theta_seq(theta_seq: Sequence[float])[source]

Set the angles theta for the eigenvalue transformation.