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:
objectDataclass 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
- class qdk_chemistry.data.time_evolution.containers.pauli_product_formula.PauliProductFormulaContainer(step_terms, step_reps, num_qubits)[source]
Bases:
TimeEvolutionUnitaryContainerDataclass 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 = ris the number of repeated steps.- Parameters:
step_terms (list[ExponentiatedPauliTerm])
step_reps (int)
num_qubits (int)
- __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:
- Parameters:
permutation (list[int]) – A list where
permutation[i]gives the old index of the term that should be placed at positioniin the reordered list.- Returns:
A new container with the updated ordering.
- Return type:
Note
permutation[i]is the old index for new positioni. For example,permutation = [2, 0, 1]yieldsnew_terms = [old_terms[2], old_terms[0], old_terms[1]].
- to_hdf5(group)[source]
Save the PauliProductFormulaContainer to an HDF5 group.
- Return type:
- Parameters:
group (h5py.Group) – HDF5 group or file to write data to
- classmethod from_json(json_data)[source]
Create PauliProductFormulaContainer from a JSON dictionary.