qxmt.evaluation.metrics.defaults_vqe module#
- class qxmt.evaluation.metrics.defaults_vqe.FCIEnergy(name='fci_energy')#
Bases:
BaseMetric
Metric for calculating the Full Configuration Interaction (FCI) energy.
This metric computes the FCI energy using the molecular Hamiltonian. The FCI energy represents the exact solution within the given basis set.
- Parameters:
name (str)
- static evaluate(hamiltonian, **kwargs)#
Get the precomputed Full Configuration Interaction energy.
- Parameters:
hamiltonian (MolecularHamiltonian) – The molecular Hamiltonian object
kwargs (Any)
- Returns:
The FCI energy value, or None if not available
- Return type:
float | None
- class qxmt.evaluation.metrics.defaults_vqe.FinalCost(name='final_cost')#
Bases:
BaseMetric
Metric for calculating the final cost from VQE optimization history.
This metric extracts the last cost value from the cost history, representing the final cost obtained from the VQE algorithm.
- Parameters:
name (str)
- static evaluate(cost_history, **kwargs)#
Calculate the final cost.
- Parameters:
cost_history (list[float]) – List of cost values from VQE optimization
kwargs (Any)
- Returns:
The final cost value
- Return type:
float
- class qxmt.evaluation.metrics.defaults_vqe.HFEnergy(name='hf_energy')#
Bases:
BaseMetric
Metric for calculating the Hartree-Fock (HF) energy.
This metric computes the Hartree-Fock energy using the molecular Hamiltonian.
- Parameters:
name (str)
- static evaluate(hamiltonian, **kwargs)#
Get the precomputed Hartree-Fock energy.
- Parameters:
hamiltonian (MolecularHamiltonian) – The molecular Hamiltonian object
kwargs (Any)
- Returns:
The Hartree-Fock energy value
- Return type:
float