chemqulacs.vqe.vqemcscf module#

class chemqulacs.vqe.vqemcscf.VQECASCI(mf, ncas, nelecas, ncore=None, fermion_qubit_mapping=<quri_parts.openfermion.transforms.OpenFermionJordanWigner object>, optimizer=<quri_parts.algo.optimizer.adam.Adam object>, backend: ~chemqulacs.vqe.vqeci.Backend = <chemqulacs.vqe.vqeci.QulacsBackend object>, shots_per_iter: int = 10000, ansatz: ~chemqulacs.vqe.vqeci.Ansatz = Ansatz.ParticleConservingU1, layers: int = 1, k: int = 1, trotter_number: int = 1, excitation_number: int = 0, weight_policy: str = 'exponential', include_pi: bool = False, use_singles: bool = True, delta_sz: int = 0, singlet_excitation: bool = False, is_init_random: bool = False, seed: int = 0)[source]#

Bases: CASCI

Parameters:
  • mf – SCF or Mole to define the problem size.

  • ncas (int) – Number of active spatial orbitals.

  • nelecas (int) – Number of active electrons.

  • fermion_qubit_mapping (quri_parts.openfermion.transforms.OpenFermionQubitMapping) – Mapping from FermionOperator or InteractionOperator to Operator

  • optimizer

  • backend (Backend) –

  • shots_per_iter (int) –

  • ansatz – ansatz used for VQE

  • layers (int) – Layers of gate operations. Used for HardwareEfficient, SymmetryPreserving, ParticleConservingU1, ParticleConservingU2, and GateFabric.

  • k (int) – Number of repetitions of excitation gates. Used for KUpCCGSD.

  • trotter_number (int) – Number of trotter decomposition. Used for UCCSD and kUpCCGSD.

  • excitation_number (int) – Number of excitations.

  • weight_policy (str) – Policy of weight of SSVQE. same : weight = 1 , 1 , 1 , 1 , … base_first : weight = 1, 0.5 , 0.5 , 0.5 … exponential : weight = 1, 0.5 , 0.25 , 0.125 …

  • include_pi (bool) – If True, the optional constant gate is inserted. Used for GateFabric.

  • use_singles – (bool): If True, single-excitation gates are applied. Used for UCCSD.

  • delta_sz (int) – Changes of spin in the excitation. Used for KUpCCGSD.

  • singlet_excitation (bool) – If True, the ansatz will be spin symmetric. Used for UCCSD and KUpCCGSD.

  • is_init_random (bool) – If False, initial parameters are initialized to 0s, else, initialized randomly.

  • seeed (int) – Random seed.

Returns:

None

print_energies()[source]#
class chemqulacs.vqe.vqemcscf.VQECASSCF(mf, ncas, nelecas, ncore=None, nfrozen=None, fermion_qubit_mapping=<quri_parts.openfermion.transforms.OpenFermionJordanWigner object>, optimizer=<quri_parts.algo.optimizer.adam.Adam object>, backend: ~chemqulacs.vqe.vqeci.Backend = <chemqulacs.vqe.vqeci.QulacsBackend object>, shots_per_iter: int = 10000, ansatz: ~chemqulacs.vqe.vqeci.Ansatz = Ansatz.ParticleConservingU1, layers: int = 1, k: int = 1, trotter_number: int = 1, excitation_number: int = 0, weight_policy: str = 'exponential', include_pi: bool = False, use_singles: bool = True, delta_sz: int = 0, singlet_excitation: bool = False, is_init_random: bool = False, seed: int = 0)[source]#

Bases: CASSCF

Parameters:
  • mf – SCF or Mole to define the problem size.

  • ncas (int) – Number of active spatial orbitals.

  • nelecas (int) – Number of active electrons.

  • fermion_qubit_mapping (quri_parts.openfermion.transforms.OpenFermionQubitMapping) – Mapping from FermionOperator or InteractionOperator to Operator

  • optimizer

  • backend (Backend) –

  • shots_per_iter (int) –

  • ansatz – ansatz used for VQE

  • layers (int) – Layers of gate operations. Used for HardwareEfficient, SymmetryPreserving, ParticleConservingU1, ParticleConservingU2, and GateFabric.

  • k (int) – Number of repetitions of excitation gates. Used for KUpCCGSD.

  • trotter_number (int) – Number of trotter decomposition. Used for UCCSD and kUpCCGSD.

  • excitation_number (int) – Number of excitations.

  • weight_policy (str) – Policy of weight of SSVQE. same : weight = 1 , 1 , 1 , 1 , … base_first : weight = 1, 0.5 , 0.5 , 0.5 … exponential : weight = 1, 0.5 , 0.25 , 0.125 …

  • include_pi (bool) – If True, the optional constant gate is inserted. Used for GateFabric.

  • use_singles – (bool): If True, single-excitation gates are applied. Used for UCCSD.

  • delta_sz (int) – Changes of spin in the excitation. Used for KUpCCGSD.

  • singlet_excitation (bool) – If True, the ansatz will be spin symmetric. Used for UCCSD and KUpCCGSD.

  • is_init_random (bool) – If False, initial parameters are initialized to 0s, else, initialized randomly.

  • seeed (int) – Random seed.

Returns:

None

print_energies()[source]#
chemqulacs.vqe.vqemcscf.print_formatstring(energies, occ_indices_lst)[source]#
energies: list of float

list of energies of each state

occ_indices_lst: list of list of int

list of list of occupied indices of each state

print the formatted string