mqt.yaqs.analog.analog_tjm

Hamiltonian simulation of quantum many-body systems using the Tensor Jump Method (TJM).

This module implements the Tensor Jump Method (TJM) for simulating the dynamics of quantum many-body systems. It provides functions for initializing the sampling state with noise (via dissipation and stochastic processes), evolving the state through single-site and two-site TDVP updates, and sampling observable measurements over time. The functions analog_tjm_2 and analog_tjm_1 correspond to second-order and first-order evolution schemes, respectively, and return trajectories of expectation values for further analysis.

Module Contents

initialize(state: MPS, noise_model: NoiseModel | None, sim_params: AnalogSimParams, rng: Generator | None = None) MPS[source]

Initialize the sampling MPS for second-order Trotterization.

This function prepares the initial sampling MPS (denoted as Phi(0)) by applying a half time step of dissipation followed by a stochastic process. It corresponds to F0 in the TJM paper.

Parameters:
  • state (MPS) – The initial state of the system.

  • noise_model (NoiseModel | None) – The noise model to apply to the system.

  • sim_params (AnalogSimParams) – Simulation parameters including the time step (dt).

  • rng – The random number generator to use.

Returns:

The initialized sampling MPS Phi(0).

Return type:

MPS

step_through(state: MPS, hamiltonian: MPO, noise_model: NoiseModel | None, sim_params: AnalogSimParams, current_time: float, rng: Generator | None = None) MPS[source]

Perform a single time step evolution of the system state using the TJM.

Corresponding to Fj in the TJM paper, this function evolves the state by applying dynamic TDVP, dissipation, and a stochastic process in sequence.

Parameters:
  • state (MPS) – The current state of the system.

  • hamiltonian (MPO) – The Hamiltonian operator for the system.

  • noise_model (NoiseModel | None) – The noise model to apply to the system.

  • sim_params (AnalogSimParams) – Simulation parameters including the time step and measurement settings.

  • current_time (float) – The current simulation time.

  • rng – The random number generator to use.

Returns:

The updated state after one time step evolution.

Return type:

MPS

sample(phi: MPS, hamiltonian: MPO, noise_model: NoiseModel | None, sim_params: AnalogSimParams, results: numpy.typing.NDArray[numpy.float64], j: int, rng: Generator | None = None, diagnostics: numpy.typing.NDArray[numpy.float64] | None = None) MPS | None[source]

Sample the quantum state and record observable measurements from the sampling MPS.

This function evolves a deep copy of the sampling MPS, applies dissipation and a stochastic process, and then measures the observables specified in sim_params. The measured values are stored in the provided results array at index j (or at index 0 if only one measurement is taken).

Parameters:
  • phi (MPS) – The sampling MPS prior to measurement.

  • hamiltonian (MPO) – The Hamiltonian operator for the system.

  • noise_model (NoiseModel | None) – The noise model to apply during evolution.

  • sim_params (AnalogSimParams) – Simulation parameters including time step and measurement settings.

  • results (NDArray[np.float64]) – An array to store the measured observable values.

  • j (int) – The time step or shot index at which the measurement is recorded.

  • rng – The random number generator to use.

  • diagnostics – Optional (3, T) buffer for runtime cost, max bond, and total bond.

Returns:

The evolved MPS when this is the final time step and get_state=True, else None.

analog_tjm_2(args: tuple[int, MPS, NoiseModel | None, AnalogSimParams, MPO]) tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], MPS | None][source]

Run a single trajectory of the TJM using a two-site evolution scheme.

This function executes a full trajectory by evolving the initial state, sampling observable measurements over time, and recording the results. It corresponds to the two-site evolution method presented in the TJM paper.

Parameters:

args (tuple) – A tuple containing: - int: Trajectory identifier. - MPS: The initial state of the system. - NoiseModel | None: The noise model to be applied (if any). - AnalogSimParams: Simulation parameters (including time step, SVD threshold, etc.). - MPO: The Hamiltonian operator represented as an MPO.

Returns:

Observable data, diagnostics (3, T), and optional final MPS.

Return type:

tuple[NDArray[np.float64], NDArray[np.float64], MPS | None]

analog_tjm_1(args: tuple[int, MPS, NoiseModel | None, AnalogSimParams, MPO]) tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], MPS | None][source]

Run a single trajectory of the TJM using a one-site evolution scheme.

This function evolves the state with a one-site TDVP update, applying noise (if provided) and taking observable measurements over time. It corresponds to the one-site evolution method in the TJM paper.

Parameters:

args (tuple) – A tuple containing: - int: Trajectory identifier. - MPS: The initial state of the system. - NoiseModel | None: The noise model to be applied (if any). - AnalogSimParams: Simulation parameters including the time step and measurement settings. - MPO: The Hamiltonian operator represented as an MPO.

Returns:

Observable data, diagnostics (3, T), and optional final MPS.

Return type:

tuple[NDArray[np.float64], NDArray[np.float64], MPS | None]