QCANT.gcim#

QCANT.gcim(symbols: Sequence[str], geometry, *, adapt_it: int, basis: str = 'sto-6g', charge: int = 0, spin: int = 0, active_electrons: int, active_orbitals: int, device_name: str | None = None, shots: int | None = None, hamiltonian_cutoff: float = 1e-20, pool_sample_size: int | None = None, pool_seed: int | None = None, pool_type: str = 'sd', theta: float = 0.7853981633974483, regularization: float = 1e-10, overlap_tol: float = 1e-12, max_iterations: int | None = None, allow_repeated_operators: bool = True, print_progress: bool = True, return_details: bool = False)[source]#

Run a GCIM loop with ADAPT-style inputs and outputs.

Parameters:
  • symbols – Atomic symbols, e.g. ["H", "H"].

  • geometry – Nuclear coordinates, array-like with shape (n_atoms, 3) in Angstrom.

  • adapt_it – Kept for API compatibility. GCIM now hardcodes the number of iterations to the total number of operators in the selected pool.

  • basis – Basis set name understood by PySCF.

  • charge – Total molecular charge.

  • spin – Spin parameter used by PySCF as 2S (e.g. 0 for singlet).

  • active_electrons – Number of active electrons in the CASCI reference.

  • active_orbitals – Number of active orbitals in the CASCI reference.

  • device_name – PennyLane device name, defaulting to lightning.qubit then default.qubit.

  • shots – Present for API compatibility with QCANT.adapt_vqe(). GCIM needs analytic statevector execution, so only None or 0 is accepted.

  • hamiltonian_cutoff – Drop Hamiltonian terms below this absolute coefficient threshold.

  • pool_sample_size – If provided, sample this many operators from the pool per iteration.

  • pool_seed – RNG seed for pool sampling.

  • pool_type – Operator-pool construction strategy:

    • "sd": reference-based singles+doubles pool,

    • "singlet_sd": singlet-adapted paired singles+doubles pool (closed-shell active spaces), and

    • "gsd": generalized spin-conserving singles+doubles pool.

  • theta – Fixed generator angle used for each selected operator.

  • regularization – Diagonal Tikhonov regularization added to overlap matrix S before solving the generalized eigenproblem.

  • overlap_tol – Threshold for overlap-matrix eigenvalue filtering in canonical orthogonalization.

  • max_iterations – Optional explicit cap on the GCIM operator-selection iterations. If omitted, GCIM retains the legacy behavior of iterating over the full operator pool.

  • allow_repeated_operators – Kept for API compatibility. GCIM now always enforces unique operator selection, so repeated operators are not used.

  • print_progress – If True, print iteration/energy updates.

  • return_details – If True, return an additional dictionary with debug artifacts (state basis, selected indices, projected matrices history).

Returns:

(params, ash_excitation, energies) where:

  • params is a vector of selected angles (all equal to theta),

  • ash_excitation is the selected excitation list (same style as ADAPT-VQE), and

  • energies is the per-iteration GCIM minimum energy.

If return_details=True, returns (params, ash_excitation, energies, details).

Return type:

tuple