qib.operator.gates.BlockEncodingGate

class qib.operator.gates.BlockEncodingGate(h: AbstractOperator, method: BlockEncodingMethod = BlockEncodingMethod.Wx)[source]

Bases: Gate

Block 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

as_circuit_matrix

Generate the sparse matrix representation of the gate as element of a quantum circuit.

as_matrix

Generate the matrix representation of the block encoding gate. Format: |ancillary> @ |encoded_state>.

as_qasm

Generate a Qobj OpenQASM representation of the gate.

as_tensornet

Generate a tensor network representation of the gate.

encoded_operator

Get the encoded operator.

fields

Return the list of fields hosting the quantum particles which the gate acts on.

inverse

Return the inverse operator.

is_hermitian

Whether the gate is Hermitian.

is_unitary

A quantum gate is unitary by definition.

particles

Return the list of quantum particles the gate acts on.

set_auxiliary_qubits

Set the auxiliary qubits.

Attributes

num_aux_qubits

Number of auxiliary qubits.

num_wires

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>

as_qasm()[source]

Generate a Qobj OpenQASM representation of the gate.

as_tensornet()[source]

Generate a tensor network representation of the gate.

encoded_operator()[source]

Get the encoded operator.

fields()[source]

Return the list of fields hosting the quantum particles which the gate acts on.

inverse()[source]

Return the inverse operator.

is_hermitian()[source]

Whether the gate is Hermitian.

is_unitary()[source]

A quantum gate is unitary by definition.

property num_aux_qubits

Number of auxiliary qubits.

property num_wires

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

particles()[source]

Return the list of quantum particles the gate acts on.

set_auxiliary_qubits(*args)[source]

Set the auxiliary qubits.