Skip to content
Construct PsiQDK Algorithms

trotter_utils

trotter_utils

cmnrs_analytic_bound

cmnrs_analytic_bound(hamiltonian, trotter_error, trotter_order=2)

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 trotter_error.

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 max_exponent = 100.

100
verbose bool

Whether to output possibly useful debugging and timing data.

False
mc bool

If False, evaluates the bound explicitly; if True, attempts a Monte Carlo estimate. Defaults to mc = False.

False
num_trials int

The number of trials to run if mc = True. Defaults to num_trials = 100.

100

Returns:

Type Description
int

An upper bound on the number of Trotter steps required to reach precision given by trotter_error.

Note

This bound is only applicable to first order Trotterization.

cmnrs_minimized_bound

cmnrs_minimized_bound(hamiltonian, trotter_error, trotter_order=2, max_exponent=100)

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 trotter_order = 2.

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 max_exponent = 100.

100

Returns:

Type Description
int

An upper bound on the number of Trotter steps required to reach precision given by trotter_error.

get_ppr_args_from_ham

get_ppr_args_from_ham(ham_term)

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: angle (float), x_mask (int), z_mask (int).

google_trotter_steps

google_trotter_steps(*args, **kwargs)

Stub for backwards compatibility.