qc2.ansatz.qiskit.lucj

Classes

LUCJ

LUCJ ansatz using Unitary Coupled-Cluster with Jastrow factor.

Module Contents

class qc2.ansatz.qiskit.lucj.LUCJ(mol: pyscf.gto.Mole, active_space: Iterable | None = None, n_reps: int = 2, initial_state: qiskit.circuit.QuantumCircuit | None = None, name: str | None = 'LUCJ')[source]

Bases: qiskit.circuit.library.blueprintcircuit.BlueprintCircuit

LUCJ ansatz using Unitary Coupled-Cluster with Jastrow factor.

mol[source]
active_space = None[source]
_num_spatial_orbitals[source]
_num_particles[source]
_num_qubits[source]
n_reps = 2[source]
ccsd = None[source]
property num_qubits: int[source]

The number of qubits.

property num_spatial_orbitals: int[source]

The number of spatial orbitals.

property num_particles: tuple[int, int][source]

The number of particles.

_run_scf()[source]

Runs a self-consistent field calculation.

_set_initial_state(initial_state: qiskit.circuit.QuantumCircuit | None) None[source]

Sets the initial state circuit for the LUCJ ansatz.

Parameters:

initial_state – Initial state circuit (Hartree-Fock if None)

_check_configuration(raise_on_failure: bool = True) bool[source]

Check if the configuration of the NLocal class is valid.

Parameters:

raise_on_failure – Whether to raise on failure.

Returns:

True, if the configuration is valid and the circuit can be constructed. Otherwise an ValueError is raised.

Raises:
  • ValueError – If the numbr fo qubit is not set.

  • ValueError – If the number of spatial orbitals is lower than the number of particles

_build()[source]
get_operator() ffsim.UCJOpSpinBalanced[source]

” Returns the LUCJ operator.

get_state(initial_state: numpy.ndarray | None = None) numpy.ndarray[source]

Constructs and returns the LUCJ ansatz state.