trotter_utils
trotter_utils ¶
cmnrs_analytic_bound ¶
Analytic bound for the Trotter error.
Implementation of the "analytic" Trotter error bound in "Toward the first quantum simulation with quantum speedup" arXiv:1711.10980 ⧉ (Eqs. 61, 70), with the modification that \(L*\Lambda\) is replaced with the sum of the coefficients of the Hamiltonian.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hamiltonian
|
PauliSum
|
The Hamiltonian for which the number of Trotter steps is to be estimated. |
required |
trotter_error
|
float
|
The allowable Trotter error. |
required |
trotter_order
|
int
|
The order of the Trotterization. |
2
|
Returns:
| Type | Description |
|---|---|
int
|
An upper bound on the number of Trotter steps required to reach precision given by
|
cmnrs_commutator_1 ¶
cmnrs_commutator_1(hamiltonian, trotter_error, max_exponent=100, verbose=False, mc=False, num_trials=100)
Commutator bound for first order Trotterization.
Returns the first order commutator bound in "Toward the first quantum simulation with quantum speedup"
arXiv:1711.10980 ⧉, by performing binary search over the number
of trotter_steps in _cmnrs_commutator_func.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hamiltonian
|
PauliSum
|
The Hamiltonian for which the number of Trotter steps is to be estimated. |
required |
trotter_error
|
float
|
The allowable Trotter error. |
required |
max_exponent
|
int
|
The maximum exponent over which binary search is to be performed;
i.e. the maximum number of Trotter steps that is returned is bounded
by 2^max_exponent. Defaults to |
100
|
verbose
|
bool
|
Whether to output possibly useful debugging and timing data. |
False
|
mc
|
bool
|
If |
False
|
num_trials
|
int
|
The number of trials to run if |
100
|
Returns:
| Type | Description |
|---|---|
int
|
An upper bound on the number of Trotter steps required to reach precision given by
|
Note
This bound is only applicable to first order Trotterization.
cmnrs_minimized_bound ¶
Calculate the minimized Trotter error commutator bound.
Implementation of the "minimized" Trotter error bound in
"Toward the first quantum simulation with quantum speedup" arXiv:1711.10980 ⧉
(Eqs. 73, 74), by performing binary search over the number
of trotter_steps in _cmnrs_min_func_log.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hamiltonian
|
PauliSum
|
The Hamiltonian for which the number of Trotter steps is to be estimated. |
required |
trotter_error
|
float
|
The allowable Trotter error. |
required |
trotter_order
|
int
|
The order of the Trotterization. Defaults to |
2
|
max_exponent
|
int
|
The maximum exponent over which binary search is to be performed;
i.e. the maximum number of Trotter steps that is returned is bounded by 2^max_exponent.
Defaults to |
100
|
Returns:
| Type | Description |
|---|---|
int
|
An upper bound on the number of Trotter steps required to reach precision given by
|
get_ppr_args_from_ham ¶
Convenience to set up PPR arguments from a term in a PauliSum.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ham_term
|
tuple
|
A single term in a PauliSum, where the tuple is (coefficient, PauliMask). |
required |
Returns:
| Type | Description |
|---|---|
list
|
The arguments we need to pass:
|