qdk_chemistry.data.time_evolution.containers.pauli_product_formula module

QDK/Chemistry time evolution pauli product formula container module.

class qdk_chemistry.data.time_evolution.containers.pauli_product_formula.ExponentiatedPauliTerm(pauli_term, angle)[source]

Bases: object

Dataclass for an exponentiated Pauli term.

A single exponential factor of the form \(e^{-i \theta P}\), where:
  • \(P\) is a Pauli string (e.g., \(X_0 Z_2\))

  • \(\theta\) is rotation angle

Parameters:
pauli_term: dict[int, str]

A dictionary mapping qubit indices to Pauli operators (‘X’, ‘Y’, ‘Z’).

angle: float

The rotation angle for the exponentiation.

__init__(pauli_term, angle)
Parameters:
Return type:

None

class qdk_chemistry.data.time_evolution.containers.pauli_product_formula.PauliProductFormulaContainer(step_terms, step_reps, num_qubits)[source]

Bases: TimeEvolutionUnitaryContainer

Dataclass for a Pauli product formula container.

A Pauli Product Formula decomposes a time-evolution operator \(U(t) = e^{-i H t}\), into a product of exponentials of Pauli strings. A single product-formula step is represented as \(U_{\mathrm{step}}(t) = \prod_{j \in \pi} e^{-i \theta_j P_j}\), where:

  • \(P_j\) is a Pauli string

  • \(\theta_j\) is the rotation angle for that term

  • \(\prod_{j \in \pi}\) is a permutation defining the multiplication order

The full time-evolution unitary is: \(U(t) \approx \left[ U_{\mathrm{step}}\!\left(\tfrac{t}{r}\right) \right]^{r}\), where step_reps = r is the number of repeated steps.

Parameters:
__init__(step_terms, step_reps, num_qubits)[source]

Initialize a PauliProductFormulaContainer.

Parameters:
  • step_terms (list[ExponentiatedPauliTerm]) – The list of exponentiated Pauli terms in a single step.

  • step_reps (int) – The number of repetitions of the single step.

  • num_qubits (int) – The number of qubits the unitary acts on.

Return type:

None

property type: str[source]

Get the type of the time evolution unitary container.

Returns:

The type of the time evolution unitary container.

property num_qubits: int[source]

Get the number of qubits the time evolution unitary acts on.

Returns:

The number of qubits.

reorder_terms(permutation)[source]

Reorder the Pauli terms according to a given permutation.

Return type:

PauliProductFormulaContainer

Parameters:

permutation (list[int]) – A list where permutation[i] gives the old index of the term that should be placed at position i in the reordered list.

Returns:

A new container with the updated ordering.

Return type:

PauliProductFormulaContainer

Note

permutation[i] is the old index for new position i. For example, permutation = [2, 0, 1] yields new_terms = [old_terms[2], old_terms[0], old_terms[1]].

to_json()[source]

Convert the PauliProductFormulaContainer to a dictionary for JSON serialization.

Return type:

dict[str, Any]

Returns:

Dictionary representation of the PauliProductFormulaContainer

Return type:

dict

to_hdf5(group)[source]

Save the PauliProductFormulaContainer to an HDF5 group.

Return type:

None

Parameters:

group (h5py.Group) – HDF5 group or file to write data to

classmethod from_json(json_data)[source]

Create PauliProductFormulaContainer from a JSON dictionary.

Return type:

PauliProductFormulaContainer

Parameters:

json_data (dict[str, Any]) – Dictionary containing the serialized data

Returns:

PauliProductFormulaContainer

classmethod from_hdf5(group)[source]

Load an instance from an HDF5 group.

Return type:

PauliProductFormulaContainer

Parameters:

group (h5py.Group) – HDF5 group or file to read data from

Returns:

PauliProductFormulaContainer

get_summary()[source]

Get summary of PauliProductFormulaContainer.

Return type:

str

Returns:

Summary string describing the PauliProductFormulaContainer’s contents and properties

Return type:

str