qcmet.benchmarks.VQE1DFermiHubbard#
- class qcmet.benchmarks.VQE1DFermiHubbard(qubits, U=0.0, t=1.0, shift_number=False, save_path=None, **kwargs)[source]#
Variational Quantum Eigensolver implementation for the 1D Fermi-Hubbard model.
This class extends the base VQE class to simulate the ground state energy of the 1D Fermi-Hubbard model using a parameterized ansatz and Jordan-Wigner transformed Hamiltonian.
- __init__(qubits, U=0.0, t=1.0, shift_number=False, save_path=None, **kwargs)[source]#
Initialize the VQE1DFermiHubbard instance with model parameters.
Sets up the number of sites, interaction strength, hopping amplitude, and whether to shift the number operator.
- Parameters:
qubits (int) – Total number of qubits (must be even, representing spin-up and spin-down).
U (float) – On-site interaction strength.
t (float) – Hopping amplitude between neighboring sites.
shift_number (bool) – Whether to shift the number operator to center the interaction.
save_path (str | Path | FileManager | None, optional) – Directory path to save results. Defaults to None.
**kwargs – Additional configuration parameters passed to the base VQE class.
- Raises:
AssertionError – If the number of qubits is not even.
Methods
__init__(qubits[, U, t, shift_number, save_path])Initialize the VQE1DFermiHubbard instance with model parameters.
analyze()Analyze measurements to return benchmark results.
generate_circuits()Generate benchmark circuits, user facing.
get_energy()Compute the expectation value of the Hamiltonian from shot data.
has_plotting()Check if _plot function is implemented in benchmark.
load_circuit_measurements(circuit_measurements)Load measurement counts into the experiment_data DataFrame.
measurements_to_probabilities()Convert raw measurement counts to normalized probabilities.
plot([axes])Plot benchmark result, user facing.
run([device, num_shots, max_circs_per_job])Run benchmark.
save()Save benchmark current state.
set_save_path(save_path)Set benchmark save path if not set in class constructor.
statevector_energy()Compute the expectation value of the Hamiltonian using statevector simulation.
Attributes
circuitsGets all benchmark circuits.
experiment_dataGetter for experiment_data dataframe.
full_ansatz_circuitAccessor for the full ansatz circuit (init + layers).
Return the full Fermi-Hubbard Hamiltonian mapped to qubits via Jordan-Wigner transformation.
Prepare the initial Gaussian state corresponding to the non-interacting tight-binding Hamiltonian.
num_qubitsNumber of qubits in this benchmark.
variational_parametersGet or initialize the variational parameters for the ansatz circuit.
- property initial_state#
Prepare the initial Gaussian state corresponding to the non-interacting tight-binding Hamiltonian.
Uses OpenFermion’s Gaussian state preparation and converts the Cirq circuit to Qiskit via QASM.
- Returns:
The initial state circuit in Qiskit format.
- Return type:
QuantumCircuit
- property hamiltonian#
Return the full Fermi-Hubbard Hamiltonian mapped to qubits via Jordan-Wigner transformation.
Combines the tight-binding and interaction Hamiltonians.
- Returns:
The full Hamiltonian in qubit representation.
- Return type:
openfermion.QubitOperator