qc2.ansatz.qiskit.lucj ====================== .. py:module:: qc2.ansatz.qiskit.lucj Classes ------- .. autoapisummary:: qc2.ansatz.qiskit.lucj.LUCJ Module Contents --------------- .. py:class:: LUCJ(mol: pyscf.gto.Mole, active_space: Iterable | None = None, n_reps: int = 2, initial_state: Optional[qiskit.circuit.QuantumCircuit] = None, name: str | None = 'LUCJ') Bases: :py:obj:`qiskit.circuit.library.blueprintcircuit.BlueprintCircuit` LUCJ ansatz using Unitary Coupled-Cluster with Jastrow factor. .. py:attribute:: mol .. py:attribute:: active_space :value: None .. py:attribute:: _num_spatial_orbitals .. py:attribute:: _num_particles .. py:attribute:: _num_qubits .. py:attribute:: n_reps :value: 2 .. py:attribute:: ccsd :value: None .. py:property:: num_qubits :type: int The number of qubits. .. py:property:: num_spatial_orbitals :type: int The number of spatial orbitals. .. py:property:: num_particles :type: tuple[int, int] The number of particles. .. py:method:: _run_scf() Runs a self-consistent field calculation. .. py:method:: _set_initial_state(initial_state: qiskit.circuit.QuantumCircuit | None) -> None Sets the initial state circuit for the LUCJ ansatz. :param initial_state: Initial state circuit (Hartree-Fock if None) .. py:method:: _check_configuration(raise_on_failure: bool = True) -> bool Check if the configuration of the NLocal class is valid. :param 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. :raises ValueError: If the number of spatial orbitals is lower than the number of particles .. py:method:: _build() .. py:method:: get_operator() -> ffsim.UCJOpSpinBalanced " Returns the LUCJ operator. .. py:method:: get_state(initial_state: numpy.ndarray | None = None) -> numpy.ndarray Constructs and returns the LUCJ ansatz state.