qib.algorithms.vqe.ansatz.ansatz.qUCC

class qib.algorithms.vqe.ansatz.ansatz.qUCC(field: FieldOperator, excitations: str = 's', embedding: str = 'jordan_wigner', spin=False)[source]

Bases: Ansatz

Quantum Unitary Coupled Cluster ansatz (generalized). Can be with single or double excitations. Can work with spin or spinless fermions (should be coherent with the Hamiltonian!). When spin_symmetry = True the amount of parameters is reduced by considering symmetry between spin up and down.

Methods

as_matrix

Generate the (sparse) matrix representation of the ansatz.

fields

List of all fields appearing in the operator.

is_hermitian

Generally speaking, qUCC is not hermitian.

is_unitary

qUCC is always unitary.

Attributes

nqubits

Number of qubits is equal to number of fermionic sites.

num_parameters

Number of variational parameters.

as_matrix(params: Sequence[float])[source]

Generate the (sparse) matrix representation of the ansatz. Here we used the generalized version of UCC (all excitation terms allowed among the same spin set). The single and double excitations terms are trotterized and Jordan Wigner is separately applied to them.

fields()[source]

List of all fields appearing in the operator.

is_hermitian()[source]

Generally speaking, qUCC is not hermitian.

is_unitary()[source]

qUCC is always unitary.

property nqubits

Number of qubits is equal to number of fermionic sites. This is true only for Jordan Wigner!

property num_parameters

Number of variational parameters.