qcmet.benchmarks.Simulation1DFermiHubbard#

class qcmet.benchmarks.Simulation1DFermiHubbard(qubits, U=0.0, t=1.0, shift_number=False, dt=0.1, initial_state=(0,), n_steps=1, save_path=None, **kwargs)[source]#

Simulates the dynamics of a 1D Hubbard model using Trotter decomposition.

This class extends the HamiltonianSimulation base class to implement time evolution for a 1D Hubbard model with configurable interaction strength (U), hopping parameter (t), time step (dt), and initial state.

__init__(qubits, U=0.0, t=1.0, shift_number=False, dt=0.1, initial_state=(0,), n_steps=1, save_path=None, **kwargs)[source]#

Initialize the 1D Hubbard model dynamics simulation.

This constructor sets up the configuration for simulating the time evolution of a 1D Hubbard model using a Trotterization. The model consists of fermionic sites represented by pairs of qubits, with configurable interaction strength and hopping amplitude.

Parameters:
  • qubits (int | List[int]) – The number of qubits as either a list of qubit indices or int specifying number of qubits.

  • U (float) – On-site interaction strength. Default is 0.0.

  • t (float) – Hopping amplitude. Default is 1.0.

  • shift_number (bool) – Whether to shift particle number. Default is False.

  • dt (float) – Time step for Trotter evolution. Default is 0.1.

  • initial_state (Tuple) – Tuple of qubit indices initialized to |1⟩. Default is [0].

  • n_steps (int) – The number of Trotter steps which are applied.

  • save_path (str | Path | FileManager | None, optional) – Directory path to save results. Defaults to None.

  • **kwargs – Additional keyword arguments passed to the base HamiltonianSimulation class.

Raises:

AssertionError – If the number of qubits is not even.

Methods

__init__(qubits[, U, t, shift_number, dt, ...])

Initialize the 1D Hubbard model dynamics simulation.

analyze()

Analyze measurements to return benchmark results.

generate_circuits()

Generate benchmark circuits, user facing.

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.

Attributes

circuits

Gets all benchmark circuits.

evolution_circuit

Return the composed quantum circuit with initial state, Trotter steps, and measurements.

experiment_data

Getter for experiment_data dataframe.

initial_state

Constructs the initial quantum state circuit.

num_qubits

Number of qubits in this benchmark.

property initial_state#

Constructs the initial quantum state circuit.

The initial state is defined by flipping the qubits listed in self.config[“initial_state”].

Returns:

A quantum circuit representing the initial state.

Return type:

QuantumCircuit