290 lines
20 KiB
Plaintext
290 lines
20 KiB
Plaintext
---
|
||
title: dynamic (latest version)
|
||
description: API reference for qiskit_addon_mpf.dynamic in the latest version of qiskit-addon-mpf
|
||
in_page_toc_min_heading_level: 2
|
||
python_api_type: module
|
||
python_api_name: qiskit_addon_mpf.dynamic
|
||
---
|
||
|
||
<span id="module-qiskit_addon_mpf.dynamic" />
|
||
|
||
<span id="dynamic-mpfs-qiskit-addon-mpf-dynamic" />
|
||
|
||
# Dynamic MPFs
|
||
|
||
`qiskit_addon_mpf.dynamic`
|
||
|
||
Dynamic MPF coefficients.
|
||
|
||
This module provides the generator function for the linear system of equations ([`LSE`](costs#lse "qiskit_addon_mpf.costs.LSE")) for computing dynamic (that is, time-dependent) MPF coefficients.
|
||
|
||
### setup\_dynamic\_lse
|
||
|
||
<Function id="qiskit_addon_mpf.dynamic.setup_dynamic_lse" github="https://github.com/Qiskit/qiskit-addon-mpf/tree/stable/0.3/qiskit_addon_mpf/dynamic.py#L193-L385" signature="setup_dynamic_lse(trotter_steps, time, identity_factory, exact_evolver_factory, approx_evolver_factory, initial_state)">
|
||
Return the linear system of equations for computing dynamic MPF coefficients.
|
||
|
||
This function uses the [`DynamicMPF`](#qiskit_addon_mpf.dynamic.DynamicMPF "qiskit_addon_mpf.dynamic.DynamicMPF") algorithm to compute the components of the Gram matrix ([`LSE.A`](costs#a "qiskit_addon_mpf.costs.LSE.A"), $M$ in \[1] and \[2]) and the overlap vector ([`LSE.b`](costs#b "qiskit_addon_mpf.costs.LSE.b"), $L$ in \[1] and \[2]) for the provided time-evolution parameters.
|
||
|
||
The elements of the Gram matrix, $M_{ij}$, and overlap vector, $L_i$, are defined as
|
||
|
||
$$
|
||
\begin{split}M_{ij} &= \text{Tr}(\rho_{k_i}(t)\rho_{k_j}(t)) \, , \\
|
||
L_i &= \text{Tr}(\rho(t)\rho_{k_i}(t)) \, ,\end{split}
|
||
$$
|
||
|
||
where $\rho(t)$ is the exact time-evolution state at time $t$ and $\rho_{k_i}(t)$ is the time-evolution state approximated using $k_i$ Trotter steps.
|
||
|
||
Computing the dynamic (that is, time-dependent) MPF coefficients from $M$ and $L$ amounts to finding a solution to the [`LSE`](costs#lse "qiskit_addon_mpf.costs.LSE") (similarly to how the [`static`](static#module-qiskit_addon_mpf.static "qiskit_addon_mpf.static") MPF coefficients are computed) while enforcing the constraint that all coefficients must sum to 1 ($\sum_i x_i = 1$), which is not enforced as part of this LSE (unlike in the static case). Optimization problems which include this additional constraint are documented in the [`costs`](costs#module-qiskit_addon_mpf.costs "qiskit_addon_mpf.costs") module. The one suggested by \[1] and \[2] is the [`setup_frobenius_problem()`](costs#setup_frobenius_problem "qiskit_addon_mpf.costs.setup_frobenius_problem").
|
||
|
||
Evaluating every element $M_{ij}$ and $L_i$ requires computing the overlap between two time-evolution states. The [`DynamicMPF`](#qiskit_addon_mpf.dynamic.DynamicMPF "qiskit_addon_mpf.dynamic.DynamicMPF") algorithm does so by means of tensor network calculations, provided by one of the optional dependencies. The available backends are listed and explained in more detail in the [`backends`](backends#module-qiskit_addon_mpf.backends "qiskit_addon_mpf.backends") module.
|
||
|
||
Below, we provide an example using the [`quimb_tebd`](backends-quimb-tebd#module-qiskit_addon_mpf.backends.quimb_tebd "qiskit_addon_mpf.backends.quimb_tebd") backend. We briefly explain each element.
|
||
|
||
First, we initialize a simple Heisenberg Hamiltonian which we would like to time-evolve. Since we are using a time-evolver based on [`quimb`](https://quimb.readthedocs.io/en/latest/autoapi/quimb/index.html#module-quimb "(in quimb v1.10)"), we also initialize the Hamiltonian using that library.
|
||
|
||
```python
|
||
>>> from quimb.tensor import ham_1d_heis
|
||
>>> num_qubits = 10
|
||
>>> hamil = ham_1d_heis(num_qubits, 0.8, 0.3, cyclic=False)
|
||
```
|
||
|
||
Next, we define the number of Trotter steps to make up our MPF, the target evolution time as well as the initial state ($\psi_{in}$ in \[1] and $\psi_0$ in \[2], resp.) with respect to which we compute the overlap between the time-evolution states. Here, we simply use the Néel state which we also construct using [`quimb`](https://quimb.readthedocs.io/en/latest/autoapi/quimb/index.html#module-quimb "(in quimb v1.10)"):
|
||
|
||
```python
|
||
>>> trotter_steps = [3, 4]
|
||
>>> time = 0.9
|
||
```
|
||
|
||
```python
|
||
>>> from quimb.tensor import MPS_neel_state
|
||
>>> initial_state = MPS_neel_state(num_qubits)
|
||
```
|
||
|
||
Since we must run the full [`DynamicMPF`](#qiskit_addon_mpf.dynamic.DynamicMPF "qiskit_addon_mpf.dynamic.DynamicMPF") algorithm for computing every element of $M_{ij}$ and $L_i$, we must provide factory methods for initializing the input arguments of the [`DynamicMPF`](#qiskit_addon_mpf.dynamic.DynamicMPF "qiskit_addon_mpf.dynamic.DynamicMPF") instances. To this end, we must provide three functions. To construct these, we will use the [`functools.partial()`](https://docs.python.org/3/library/functools.html#functools.partial "(in Python v3.13)") function.
|
||
|
||
```python
|
||
>>> from functools import partial
|
||
```
|
||
|
||
First, we need a function to initialize an empty time-evolution state (see also [`DynamicMPF.evolution_state`](#qiskit_addon_mpf.dynamic.DynamicMPF.evolution_state "qiskit_addon_mpf.dynamic.DynamicMPF.evolution_state") for more details). This constructor function may not take any positional or keyword arguments and must return a [`State`](backends#state "qiskit_addon_mpf.backends.State") object.
|
||
|
||
```python
|
||
>>> from qiskit_addon_mpf.backends.quimb_tebd import MPOState
|
||
>>> from quimb.tensor import MPO_identity
|
||
>>> identity_factory = lambda: MPOState(MPO_identity(num_qubits))
|
||
```
|
||
|
||
The second and third function must construct the left- and right-hand side time-evolution engines (see also [`DynamicMPF.lhs`](#qiskit_addon_mpf.dynamic.DynamicMPF.lhs "qiskit_addon_mpf.dynamic.DynamicMPF.lhs") and [`DynamicMPF.rhs`](#qiskit_addon_mpf.dynamic.DynamicMPF.rhs "qiskit_addon_mpf.dynamic.DynamicMPF.rhs") for more details). These functions should follow the [`ExactEvolverFactory`](#qiskit_addon_mpf.dynamic.ExactEvolverFactory "qiskit_addon_mpf.dynamic.ExactEvolverFactory") and [`ApproxEvolverFactory`](#qiskit_addon_mpf.dynamic.ApproxEvolverFactory "qiskit_addon_mpf.dynamic.ApproxEvolverFactory") protocols, respectively.
|
||
|
||
The [`ExactEvolverFactory`](#qiskit_addon_mpf.dynamic.ExactEvolverFactory "qiskit_addon_mpf.dynamic.ExactEvolverFactory") function should take a [`State`](backends#state "qiskit_addon_mpf.backends.State") object as its only positional argument and should return a [`Evolver`](backends#evolver "qiskit_addon_mpf.backends.Evolver") object, which will be used for computing the LHS of the $L_i$ elements (i.e. it should produce the exact time-evolution state, $\rho(t)$).
|
||
|
||
Here, we approximate the exact time-evolved state with a fourth-order Suzuki-Trotter formula using a small time step of 0.05. We also specify some [`quimb`](https://quimb.readthedocs.io/en/latest/autoapi/quimb/index.html#module-quimb "(in quimb v1.10)")-specific truncation options to bound the maximum bond dimension of the underlying tensor network as well as the minimum singular values of the split tensor network bonds.
|
||
|
||
```python
|
||
>>> from qiskit_addon_mpf.backends.quimb_tebd import TEBDEvolver
|
||
>>> exact_evolver_factory = partial(
|
||
... TEBDEvolver,
|
||
... H=hamil,
|
||
... dt=0.05,
|
||
... order=4,
|
||
... split_opts={"max_bond": 10, "cutoff": 1e-5},
|
||
... )
|
||
```
|
||
|
||
The [`ApproxEvolverFactory`](#qiskit_addon_mpf.dynamic.ApproxEvolverFactory "qiskit_addon_mpf.dynamic.ApproxEvolverFactory") function should also take a [`State`](backends#state "qiskit_addon_mpf.backends.State") object as its only positional argument and additionally a keyword argument called `dt` to specify the time step of the time-evolution. It should also return a [`Evolver`](backends#evolver "qiskit_addon_mpf.backends.Evolver") object which produces the approximate time-evolution states, $\rho_{k_i}(t)$, where $k_i$ is determined by the chosen time step, `dt`. As such, these instances will be used for computing the RHS of the $L_i$ as well as both sides of the $M_{ij}$ elements.
|
||
|
||
Here, we use a second-order Suzuki-Trotter formula with the same truncation settings as before.
|
||
|
||
```python
|
||
>>> approx_evolver_factory = partial(
|
||
... TEBDEvolver,
|
||
... H=hamil,
|
||
... order=2,
|
||
... split_opts={"max_bond": 10, "cutoff": 1e-5},
|
||
... )
|
||
```
|
||
|
||
Finally, we can initialize and run the [`setup_dynamic_lse()`](#qiskit_addon_mpf.dynamic.setup_dynamic_lse "qiskit_addon_mpf.dynamic.setup_dynamic_lse") function to obtain the [`LSE`](costs#lse "qiskit_addon_mpf.costs.LSE") described at the top.
|
||
|
||
```python
|
||
>>> from qiskit_addon_mpf.dynamic import setup_dynamic_lse
|
||
>>> lse = setup_dynamic_lse(
|
||
... trotter_steps,
|
||
... time,
|
||
... identity_factory,
|
||
... exact_evolver_factory,
|
||
... approx_evolver_factory,
|
||
... initial_state,
|
||
... )
|
||
>>> print(lse.A)
|
||
[[1. 0.99998513]
|
||
[0.99998513 1. ]]
|
||
>>> print(lse.b)
|
||
[1.00001585 0.99998955]
|
||
```
|
||
|
||
**Parameters**
|
||
|
||
* **trotter\_steps** ([*list*](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)")*\[*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")*]*) – the sequence of trotter steps to be used.
|
||
* **time** ([*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – the total target evolution time.
|
||
* **identity\_factory** ([*IdentityStateFactory*](#qiskit_addon_mpf.dynamic.IdentityStateFactory "qiskit_addon_mpf.dynamic.IdentityStateFactory")) – a function to generate an empty [`State`](backends#state "qiskit_addon_mpf.backends.State") object.
|
||
* **exact\_evolver\_factory** ([*ExactEvolverFactory*](#qiskit_addon_mpf.dynamic.ExactEvolverFactory "qiskit_addon_mpf.dynamic.ExactEvolverFactory")) – a function to initialize the [`Evolver`](backends#evolver "qiskit_addon_mpf.backends.Evolver") instance which produces the exact time-evolution state, $\rho(t)$.
|
||
* **approx\_evolver\_factory** ([*ApproxEvolverFactory*](#qiskit_addon_mpf.dynamic.ApproxEvolverFactory "qiskit_addon_mpf.dynamic.ApproxEvolverFactory")) – a function to initialize the [`Evolver`](backends#evolver "qiskit_addon_mpf.backends.Evolver") instance which produces the approximate time-evolution state, $\rho_{k_i}(t)$, for different values of $k_i$ depending on the provided time step, `dt`.
|
||
* **initial\_state** ([*Any*](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.13)")) – the initial state ($\psi_{in}$ or $\psi_0$) with respect to which to compute the elements $M_{ij}$ of [`LSE.A`](costs#a "qiskit_addon_mpf.costs.LSE.A") and $L_i$ of [`LSE.b`](costs#b "qiskit_addon_mpf.costs.LSE.b"). The type of this object must match the tensor network backend chosen for the previous arguments.
|
||
|
||
**Returns**
|
||
|
||
The [`LSE`](costs#lse "qiskit_addon_mpf.costs.LSE") to find the dynamic MPF coefficients as described above.
|
||
|
||
**Return type**
|
||
|
||
[*LSE*](costs#lse "qiskit_addon_mpf.costs.lse.LSE")
|
||
|
||
**References**
|
||
|
||
**\[1]: S. Zhuk et al., Phys. Rev. Research 6, 033309 (2024).**
|
||
|
||
[https://journals.aps.org/prresearch/abstract/10.1103/PhysRevResearch.6.033309](https://journals.aps.org/prresearch/abstract/10.1103/PhysRevResearch.6.033309)
|
||
|
||
**\[2]: N. Robertson et al., arXiv:2407.17405v2 (2024).**
|
||
|
||
[https://arxiv.org/abs/2407.17405v2](https://arxiv.org/abs/2407.17405v2)
|
||
</Function>
|
||
|
||
## Factory Protocols
|
||
|
||
The following protocols define the function signatures for the various object factory arguments.
|
||
|
||
### IdentityStateFactory
|
||
|
||
<Class id="qiskit_addon_mpf.dynamic.IdentityStateFactory" github="https://github.com/Qiskit/qiskit-addon-mpf/tree/stable/0.3/qiskit_addon_mpf/dynamic.py#L154-L163" signature="IdentityStateFactory(*args, **kwargs)" modifiers="class">
|
||
Bases: [`Protocol`](https://docs.python.org/3/library/typing.html#typing.Protocol "(in Python v3.13)")
|
||
|
||
The factory function protocol for constructing an identity [`State`](backends#state "qiskit_addon_mpf.backends.State") instance.
|
||
|
||
As explained in more detail in [`setup_dynamic_lse()`](#qiskit_addon_mpf.dynamic.setup_dynamic_lse "qiskit_addon_mpf.dynamic.setup_dynamic_lse"), this factory function is called to initialize the [`DynamicMPF.evolution_state`](#qiskit_addon_mpf.dynamic.DynamicMPF.evolution_state "qiskit_addon_mpf.dynamic.DynamicMPF.evolution_state") with an identity or empty state. This function should not take any arguments and return a [`State`](backends#state "qiskit_addon_mpf.backends.State") instance.
|
||
</Class>
|
||
|
||
### ExactEvolverFactory
|
||
|
||
<Class id="qiskit_addon_mpf.dynamic.ExactEvolverFactory" github="https://github.com/Qiskit/qiskit-addon-mpf/tree/stable/0.3/qiskit_addon_mpf/dynamic.py#L166-L175" signature="ExactEvolverFactory(*args, **kwargs)" modifiers="class">
|
||
Bases: [`Protocol`](https://docs.python.org/3/library/typing.html#typing.Protocol "(in Python v3.13)")
|
||
|
||
The factory function protocol for constructing an exact [`Evolver`](backends#evolver "qiskit_addon_mpf.backends.Evolver") instance.
|
||
|
||
As explained in more detail in [`setup_dynamic_lse()`](#qiskit_addon_mpf.dynamic.setup_dynamic_lse "qiskit_addon_mpf.dynamic.setup_dynamic_lse"), this factory function is called to initialize the [`DynamicMPF.lhs`](#qiskit_addon_mpf.dynamic.DynamicMPF.lhs "qiskit_addon_mpf.dynamic.DynamicMPF.lhs") instances of [`Evolver`](backends#evolver "qiskit_addon_mpf.backends.Evolver") which produce the exact time-evolution state, $\rho(t)$, when computing the elements $L_i$.
|
||
</Class>
|
||
|
||
### ApproxEvolverFactory
|
||
|
||
<Class id="qiskit_addon_mpf.dynamic.ApproxEvolverFactory" github="https://github.com/Qiskit/qiskit-addon-mpf/tree/stable/0.3/qiskit_addon_mpf/dynamic.py#L178-L190" signature="ApproxEvolverFactory(*args, **kwargs)" modifiers="class">
|
||
Bases: [`Protocol`](https://docs.python.org/3/library/typing.html#typing.Protocol "(in Python v3.13)")
|
||
|
||
The factory function protocol for constructing an approximate [`Evolver`](backends#evolver "qiskit_addon_mpf.backends.Evolver") instance.
|
||
|
||
As explained in more detail in [`setup_dynamic_lse()`](#qiskit_addon_mpf.dynamic.setup_dynamic_lse "qiskit_addon_mpf.dynamic.setup_dynamic_lse"), this factory function is called to initialize either the [`DynamicMPF.rhs`](#qiskit_addon_mpf.dynamic.DynamicMPF.rhs "qiskit_addon_mpf.dynamic.DynamicMPF.rhs") instances of [`Evolver`](backends#evolver "qiskit_addon_mpf.backends.Evolver") when computing the elements $L_i$ or both sides ([`DynamicMPF.lhs`](#qiskit_addon_mpf.dynamic.DynamicMPF.lhs "qiskit_addon_mpf.dynamic.DynamicMPF.lhs") and [`DynamicMPF.rhs`](#qiskit_addon_mpf.dynamic.DynamicMPF.rhs "qiskit_addon_mpf.dynamic.DynamicMPF.rhs")) when computing elements $M_{ij}$. Since these approximate time evolution states depend on the Trotter step ($\rho_{k_i}(t)$), this function requires the time step of the time evolution to be provided as a keyword argument called `dt`.
|
||
</Class>
|
||
|
||
## Core algorithm
|
||
|
||
### DynamicMPF
|
||
|
||
<Class id="qiskit_addon_mpf.dynamic.DynamicMPF" github="https://github.com/Qiskit/qiskit-addon-mpf/tree/stable/0.3/qiskit_addon_mpf/dynamic.py#L53-L151" signature="DynamicMPF(evolution_state, lhs, rhs)" modifiers="class">
|
||
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.13)")
|
||
|
||
The dynamic MPF algorithm.
|
||
|
||
Instantiated with a LHS and RHS [`Evolver`](backends#evolver "qiskit_addon_mpf.backends.Evolver") this algorithm will [`evolve()`](#qiskit_addon_mpf.dynamic.DynamicMPF.evolve "qiskit_addon_mpf.dynamic.DynamicMPF.evolve") a shared [`State`](backends#state "qiskit_addon_mpf.backends.State") up to a target evolution time. Afterwards, the [`DynamicMPF.overlap()`](#qiskit_addon_mpf.dynamic.DynamicMPF.overlap "qiskit_addon_mpf.dynamic.DynamicMPF.overlap") of the time-evolved [`State`](backends#state "qiskit_addon_mpf.backends.State") with some initial state can be computed. See [`setup_dynamic_lse()`](#qiskit_addon_mpf.dynamic.setup_dynamic_lse "qiskit_addon_mpf.dynamic.setup_dynamic_lse") for a more detailed explanation on how this is used to compute the elements $M_{ij}$ and $L_i$ making up the [`LSE`](costs#lse "qiskit_addon_mpf.costs.LSE") of the dynamic MPF coefficients.
|
||
|
||
**References**
|
||
|
||
**\[1]: S. Zhuk et al., Phys. Rev. Research 6, 033309 (2024).**
|
||
|
||
[https://journals.aps.org/prresearch/abstract/10.1103/PhysRevResearch.6.033309](https://journals.aps.org/prresearch/abstract/10.1103/PhysRevResearch.6.033309)
|
||
|
||
**\[2]: N. Robertson et al., arXiv:2407.17405 (2024).**
|
||
|
||
[https://arxiv.org/abs/2407.17405](https://arxiv.org/abs/2407.17405)
|
||
|
||
Construct a [`DynamicMPF`](#qiskit_addon_mpf.dynamic.DynamicMPF "qiskit_addon_mpf.dynamic.DynamicMPF") instance.
|
||
|
||
**Parameters**
|
||
|
||
* **evolution\_state** ([*State*](backends#state "qiskit_addon_mpf.backends.State")) – the state to be shared by the LHS and RHS time-evolution engines.
|
||
* **lhs** ([*Evolver*](backends#evolver "qiskit_addon_mpf.backends.Evolver")) – the LHS time-evolution engine.
|
||
* **rhs** ([*Evolver*](backends#evolver "qiskit_addon_mpf.backends.Evolver")) – the RHS time-evolution engine.
|
||
|
||
#### TIME\_DECIMALS
|
||
|
||
<Attribute id="qiskit_addon_mpf.dynamic.DynamicMPF.TIME_DECIMALS" attributeTypeHint="int" attributeValue="8">
|
||
The number of decimal places used for rounding the evolution times.
|
||
|
||
During the time evolution of the [`evolution_state`](#qiskit_addon_mpf.dynamic.DynamicMPF.evolution_state "qiskit_addon_mpf.dynamic.DynamicMPF.evolution_state"), we often compare the evolved times of the LHS and RHS engines against each other as well as the target evolution time. These checks compare floating point numbers and this setting specifies the number of decimal places to which we round.
|
||
</Attribute>
|
||
|
||
#### evolution\_state
|
||
|
||
<Attribute id="qiskit_addon_mpf.dynamic.DynamicMPF.evolution_state">
|
||
The state shared between the LHS and RHS time-evolution engines.
|
||
</Attribute>
|
||
|
||
#### evolve
|
||
|
||
<Function id="qiskit_addon_mpf.dynamic.DynamicMPF.evolve" github="https://github.com/Qiskit/qiskit-addon-mpf/tree/stable/0.3/qiskit_addon_mpf/dynamic.py#L94-L130" signature="evolve(time)">
|
||
Evolve the dynamic MPF algorithm up to the provided time.
|
||
|
||
This actually runs the dynamic MPF algorithm by time-evolving [`DynamicMPF.evolution_state`](#qiskit_addon_mpf.dynamic.DynamicMPF.evolution_state "qiskit_addon_mpf.dynamic.DynamicMPF.evolution_state") up to the specified time using the LHS and RHS [`Evolver`](backends#evolver "qiskit_addon_mpf.backends.Evolver") instances.
|
||
|
||
**Parameters**
|
||
|
||
**time** ([*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)")) – the total target evolution time.
|
||
|
||
**Raises**
|
||
|
||
[**RuntimeError**](https://docs.python.org/3/library/exceptions.html#RuntimeError "(in Python v3.13)") – if the LHS and RHS evolved times are not equal at the end.
|
||
|
||
**Return type**
|
||
|
||
None
|
||
</Function>
|
||
|
||
#### lhs
|
||
|
||
<Attribute id="qiskit_addon_mpf.dynamic.DynamicMPF.lhs">
|
||
The LHS time-evolution engine.
|
||
</Attribute>
|
||
|
||
#### overlap
|
||
|
||
<Function id="qiskit_addon_mpf.dynamic.DynamicMPF.overlap" github="https://github.com/Qiskit/qiskit-addon-mpf/tree/stable/0.3/qiskit_addon_mpf/dynamic.py#L132-L151" signature="overlap(initial_state)">
|
||
Compute the overlap of [`DynamicMPF.evolution_state`](#qiskit_addon_mpf.dynamic.DynamicMPF.evolution_state "qiskit_addon_mpf.dynamic.DynamicMPF.evolution_state") with the provided state.
|
||
|
||
<Admonition title="Warning" type="caution">
|
||
The type of the provided `initial_state` will depend on the chosen backend used for the [`State`](backends#state "qiskit_addon_mpf.backends.State") and [`Evolver`](backends#evolver "qiskit_addon_mpf.backends.Evolver") instances provided to this [`DynamicMPF`](#qiskit_addon_mpf.dynamic.DynamicMPF "qiskit_addon_mpf.dynamic.DynamicMPF") instance. In other words, a backend may only support a specific type of `initial_state` objects for this overlap computation. See also the explanations of the `initial_state` argument to the [`setup_dynamic_lse()`](#qiskit_addon_mpf.dynamic.setup_dynamic_lse "qiskit_addon_mpf.dynamic.setup_dynamic_lse") for more details.
|
||
</Admonition>
|
||
|
||
**Parameters**
|
||
|
||
**initial\_state** ([*Any*](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.13)")) – the initial state with which to compute the overlap.
|
||
|
||
**Raises**
|
||
|
||
[**TypeError**](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.13)") – if the provided initial state has an incompatible type.
|
||
|
||
**Returns**
|
||
|
||
The overlap of [`DynamicMPF.evolution_state`](#qiskit_addon_mpf.dynamic.DynamicMPF.evolution_state "qiskit_addon_mpf.dynamic.DynamicMPF.evolution_state") with the provided one.
|
||
|
||
**Return type**
|
||
|
||
[complex](https://docs.python.org/3/library/functions.html#complex "(in Python v3.13)")
|
||
</Function>
|
||
|
||
#### rhs
|
||
|
||
<Attribute id="qiskit_addon_mpf.dynamic.DynamicMPF.rhs">
|
||
The RHS time-evolution engine.
|
||
</Attribute>
|
||
</Class>
|
||
|