qib.operator.gates.BlockEncodingGate¶
- class qib.operator.gates.BlockEncodingGate(h: AbstractOperator, method: BlockEncodingMethod = BlockEncodingMethod.Wx)[source]¶
Bases:
GateBlock encoding gate of a Hamiltonian h, assumed to be Hermitian and normalized such that its spectral norm is bounded by 1. Output state is Hamiltonian applied to principal input state if auxiliary qubit(s) is initialized to |0>.
Methods
Generate the sparse matrix representation of the gate as element of a quantum circuit.
Generate the matrix representation of the block encoding gate. Format: |ancillary> @ |encoded_state>.
Generate a Qobj OpenQASM representation of the gate.
Generate a tensor network representation of the gate.
Get the encoded operator.
Return the list of fields hosting the quantum particles which the gate acts on.
Return the inverse operator.
Whether the gate is Hermitian.
A quantum gate is unitary by definition.
Return the list of quantum particles the gate acts on.
Set the auxiliary qubits.
Attributes
Number of auxiliary qubits.
The number of "wires" (or quantum particles) this gate acts on.
- as_circuit_matrix(fields: Sequence[Field])[source]¶
Generate the sparse matrix representation of the gate as element of a quantum circuit.
- as_matrix()[source]¶
Generate the matrix representation of the block encoding gate. Format: |ancillary> @ |encoded_state>
- property num_aux_qubits¶
Number of auxiliary qubits.
- property num_wires¶
The number of “wires” (or quantum particles) this gate acts on.