Skip to content

Exponentiation

The exponentiation function produces a quantum gate that approximates the exponentiation, \(\exp(-iHt)\), of any input Hermitian operator, \(H\). The Classiq engine automatically generates an efficient higher-order Trotter-Suzuki quantum program [1] that minimizes the functional error and satisfies a given local constraint on the depth. The functional error is measured by the operator norm [2] and evaluated according to Ref. [3]

The Hamiltonian is given as any \(n\)-qubit operator in its Pauli basis [4]: $$ H=\sum_i c_i\left[\sigma_{j_{1,i}}\otimes\sigma_{j_{2,i}}\otimes\cdots\otimes\sigma_{j_{n,i}}\right], $$ where \(\sigma_{0,1,2,3}=I,X,Y,Z\) are the single-qubit Pauli operators, and \(j\in\{0,1,2,3\}\), and \(c_i\) are complex coefficients. For example, the operator \(H=0.1\cdot I\otimes Z+0.2\cdot X\otimes Y\) is input as follows:

from classiq import Pauli, PauliTerm

pauli_list = [
    PauliTerm(pauli=[Pauli.I, Pauli.Z], coefficient=0.1),
    PauliTerm(pauli=[Pauli.X, Pauli.Y], coefficient=0.2),
]

Function: exponentiation_with_depth_constraint

Arguments:

  • pauli_operator: CArray[PauliTerm] - the Hamiltonian to exponentiate as described above,
  • evolution_coefficient: CReal - a global evolution coefficient (the parameter \(t\) above),
  • max_depth: CInt - a maximal depth for the implementation,
  • qbv: QArray[QBit] - the quantum state on which we apply the evolution.

Example

from classiq import (
    Output,
    Pauli,
    PauliTerm,
    QArray,
    QBit,
    allocate,
    create_model,
    exponentiation_with_depth_constraint,
    qfunc,
    synthesize,
    write_qmod,
)


@qfunc
def main(qba: Output[QArray[QBit]]):

    allocate(4, qba)
    exponentiation_with_depth_constraint(
        [
            PauliTerm(pauli=[Pauli.X, Pauli.X, Pauli.I, Pauli.I], coefficient=0.1),
            PauliTerm(pauli=[Pauli.Y, Pauli.Y, Pauli.I, Pauli.I], coefficient=0.2),
            PauliTerm(pauli=[Pauli.Z, Pauli.Z, Pauli.Y, Pauli.X], coefficient=0.4),
            PauliTerm(pauli=[Pauli.I, Pauli.I, Pauli.I, Pauli.X], coefficient=0.4),
        ],
        evolution_coefficient=0.05,
        max_depth=50,
        qbv=qba,
    )


qmod = create_model(main)
write_qmod(qmod, "exponentiation")
qprog = synthesize(qmod)

References

[1] N. Hatano and M. Suzuki, Finding Exponential Product Formulas of Higher Orders, https://arxiv.org/abs/math-ph/0506007 (2005).

[2] https://en.wikipedia.org/wiki/Operator_norm

[3] A. M. Childs et al, Toward the first quantum simulation with quantum speedup, https://arxiv.org/abs/1711.10980 (2017).

[4] https://en.wikipedia.org/wiki/Generalizations_of_Pauli_matrices#Multi-qubit_Pauli_matrices_(Hermitian)