dyson_utils
dyson_utils ¶
DysonSelectStrategyNaive ¶
DysonSelectStrategyNaive(truncation: int, fast_forward_exp: Qubrick, hamiltonian: PauliSum, block_encoding: Qubrick)
A helper class to apply an operator of the form \(\exp(-iH_0 t)V \exp(iH_0 t)\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
truncation
|
int
|
a value of the truncation parameter. |
required |
fast_forward_exp
|
Qubrick
|
a fast-forwardable part \(\exp(-iH_0 t)\) of a Hamiltonian to simulate. |
required |
hamiltonian
|
PauliSum
|
a block-encoded part \(BE(V)\) of a Hamiltonian to simulate. |
required |
block_encoding
|
Qubrick
|
a block-encoding/LCU subroutine. |
required |
fast_forward_exp
property
¶
Getter for the fast-forwardable part of the Hamiltonian.
apply_compression_gadget_block_encoding ¶
apply_compression_gadget_block_encoding(register: DysonSeriesBinaryIndex, idx: int, ctrl: Qubits | int = 0)
Apply the Hamiltonian operator to the system register.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
register
|
CompositeRegister
|
a composite register for Dyson Series. |
required |
idx
|
int
|
an index of the time iteration for the time discretization register. |
required |
ctrl
|
(Qubits, int)
|
a register to control this operation on. Default to |
0
|
DysonSeriesBinaryIndex
dataclass
¶
DysonSeriesBinaryIndex(trunc_reg: Qubits, discret_reg: list[Qubits], be_anc: Qubits, system_reg: Qubits, name: str)
Bases: CompositeRegister
Dataclass for the binary Dyson Series Composite Register.
initialize
classmethod
¶
The binary Dyson Series Expansion composite index register.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qc
|
QPU
|
A QPU instance. |
required |
name
|
str
|
The name of composite register. |
required |
trunc_param
|
int
|
Truncation parameter. |
required |
t_disc_param
|
int
|
Time-discretization parameter. |
required |
syst
|
int | Qubits
|
The system register an operator is applied to. |
required |
n_be_anc
|
int | list
|
A register for the operator block encoding. |
required |
DysonSeriesData
dataclass
¶
DysonSeriesData(discretization: int, truncation: int, collision: bool, hamiltonian: PauliSum, t0: float)
Dataclass for the DysonSeriesLCU Qubrick.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
discretization
|
int
|
The time discretization value. |
required |
truncation
|
int
|
The truncation bound value. |
required |
collision
|
bool
|
Whether to flag a (time) collision in the time register. |
required |
hamiltonian
|
PauliSum
|
A time independent part of the Hamiltinian to simulate. |
required |
t0
|
float
|
A time interval to simulate a Hamiltinian. |
required |
probabilities ¶
Return the normalized probabilities for the state preparation routine.
DysonSeriesUnaryIndex
dataclass
¶
DysonSeriesUnaryIndex(trunc_reg: Qubits, discret_reg: list[Qubits], be_anc: Qubits, system_reg: Qubits, t_disc_param: int, name: str)
Bases: CompositeRegister
Dataclass for the unary Dyson Series Composite Register.
initialize
classmethod
¶
The unary Dyson Series Expansion composite index register.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qc
|
QPU
|
A QPU instance. |
required |
name
|
str
|
The name of composite register. |
required |
trunc_param
|
int
|
Truncation parameter. |
required |
t_disc_param
|
int
|
Time-discretization parameter. |
required |
syst
|
int | Qubits
|
The system register an operator is applied to. |
required |
n_be_anc
|
int | list
|
A register for the operator block encoding. |
required |
dyson_series_numpy ¶
Compute the matrix representation of the (K, M)-Dyson series.
Computes the matrix representation of the K-truncated & M-discretized Dyson series:
Here
and \(C_k = 0\) if one desires to exclude the collisions. To keep the collisions, \(C_k\) captures terms simuilar to \(B_k\) but where at least one pair of indices \(m_j = m_d\) collide for \(j \neq d\). See eq.16 in "Hamiltonian Simulation in the Interaction Picture" (arXiv:1805.00675 ⧉).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trunc_param
|
int
|
Truncation. |
required |
t_disc_param
|
int
|
Discretization. |
required |
t
|
float
|
Time. |
required |
H0
|
ndarray
|
Hermitian operator (diagonal operator, time dependent). |
required |
V
|
ndarray
|
Hermitian operator (offdiagonal operator, time independent). |
required |
flag_collision
|
bool
|
If |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
the matrix representation of the (trunc_param, t_disc_param)-Dyson series. |
dyson_target_prob ¶
Compute the normalized probabilities for the state preparation routine (Dyson Series).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t0
|
float
|
Time step. |
required |
cutoff
|
int
|
Cutoff of the Dyson series. |
required |
evaluate_ham ¶
Evaluate the operator of the form \(V(t)=\exp(iH_0t)V\exp(-iH_0t)\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
float
|
Evolution time. |
required |
H0
|
array
|
Matrix representation of the fast-forwardable part of the Hamiltonian. |
required |
V
|
array
|
Matrix representation of the perturbation part of the Hamiltonian. |
required |
Returns:
| Type | Description |
|---|---|
array
|
The result of evaluating the operator \(V(t)\). |
norm_beta ¶
Compute normalization beta (Dyson series).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t0
|
float
|
Time step. |
required |
cutoff
|
int
|
Cutoff of the Dyson series. |
required |
num_qubits_DysonSeriesExpansionIndex ¶
num_qubits_DysonSeriesExpansionIndex(trunc_param, t_disc_param, syst, n_be_anc, reg_type='unary') -> int
Calculate the total size of the Dyson register.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trunc_param
|
int
|
Truncation parameter. |
required |
t_disc_param
|
int
|
Time-discretization parameter |
required |
n_be_anc
|
int
|
Size of the register for block-encoding ancilla qubits. |
required |
syst
|
int | Qubits
|
The system register an operator is applied to. |
required |
reg_type
|
str
|
Type of the truncation register of the Dyson Series (unary or binary). |
'unary'
|
Returns:
| Type | Description |
|---|---|
int
|
The total number of qubits required for the Dyson Series expansion. |