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:
AnsatzQuantum 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
Generate the (sparse) matrix representation of the ansatz.
List of all fields appearing in the operator.
Generally speaking, qUCC is not hermitian.
qUCC is always unitary.
Attributes
Number of qubits is equal to number of fermionic sites.
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.
- 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.