Skip to content

Exponentiation

The exponentiation function produces a quantum gate which implements the exponentiation, \(\exp(-iHt)\), of any inputted Hermitian operator, \(H\).

Example

The following example demonstrates synthesis of an exponentiation function within the Classiq engine. All options are specified below.

{
    "logic_flow": [
        {
            "function": "Exponentiation",
            "function_params": {
                "pauli_operator": {
                    "pauli_list": [
                        ["IIZXXXII", 0.1],
                        ["IIXXYYII", 0.2],
                        ["IIIIZZYX", 0.3],
                        ["XZIIIIIX", 0.4],
                        ["IIIIIZXI", 0.5],
                        ["IIIIIIZY", 0.6],
                        ["IIIIIIXY", 0.7],
                        ["IIYXYZII", 0.8],
                        ["IIIIIIXZ", 0.9],
                        ["IIYZYIII", 1.0]
                    ]
                },
                "evolution_coefficient": 0.05,
                "constraints": {
                    "max_depth": 100,
                    "max_error": 0.2
                },
                "optimization": "MINIMIZE_DEPTH"
            }
        }
    ],
    "preferences": {
        "draw_at_level": 2
    }
}
from classiq.interface.chemistry.operator import PauliOperator
from classiq.interface.generator.exponentiation import (
    Exponentiation,
    ExponentiationConstraints,
    ExponentiationOptimization,
)
from classiq.model_designer import ModelDesigner
from classiq.interface.generator.model import Preferences

pauli_operator = PauliOperator(
    pauli_list=[
        ("IIZXXXII", 0.1),
        ("IIXXYYII", 0.2),
        ("IIIIZZYX", 0.3),
        ("XZIIIIIX", 0.4),
        ("IIIIIZXI", 0.5),
        ("IIIIIIZY", 0.6),
        ("IIIIIIXY", 0.7),
        ("IIYXYZII", 0.8),
        ("IIIIIIXZ", 0.9),
        ("IIYZYIII", 1.0),
    ]
)
exponentiation_params = Exponentiation(
    pauli_operator=pauli_operator,
    evolution_coefficient=0.05,
    constraints=ExponentiationConstraints(
        max_depth=100,
        max_error=0.2,
    ),
    optimization=ExponentiationOptimization.MINIMIZE_DEPTH,
)

preferences = Preferences(draw_at_level=2)
model_designer = ModelDesigner(preferences=preferences)

model_designer.Exponentiation(exponentiation_params)

circuit = model_designer.synthesize()
circuit.show_interactive()

 Exponentiation example

Options

Input Operator

Any \(n\)-qubit operator may be inputted in it's pauli basis [1]

\[ 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\}\).

This may be implemented via the pauli_list field of the PauliOperator class.

For example, the operator \(H=0.1\cdot I\otimes Z+0.2\cdot X\otimes Y\) is inputted as follows

{
    "pauli_list": [
        ["IZ",0.1],
        ["XY",0.2]
    ]
}
from classiq.interface.chemistry.operator import PauliOperator

operator = PauliOperator(pauli_list=[("IZ", 0.1), ("XY", 0.2)])
print(operator.show())
+0.100 * IZ
+0.200 * XY

The operator to be exponentiated is provided via the pauli_operator field of the Exponentiation.

A global evolution coefficient may be provided via the evolution_coefficient field of the Exponentiation; defaults to 1.0.

Constraints

Local constraints for the exponentiation of either max_depth or max_error may be provided via the fields of the ExponentiationConstraints class; both default to no constraint.

The max_error bounds the algorithmic error of the circuit as measured by the operator norm [2] and evaluated according to Ref. [3] .

The constraints may be provided via the constraints field of the Exponentiation; defaults to no constraints.

{
    "max_depth": 100,
    "max_error": 0.2
}
from classiq.interface.generator.exponentiation import ExponentiationConstraints

ExponentiationConstraints(
    max_depth=100,
    max_error=0.2,
)

Optimization

The optimization target for the exponentiation may be set to either MINIMIZE_DEPTH or MINIMIZE_ERROR.

The Classiq engine automatically generates an efficient higher-order Trotter-Suzuki circuit [4] that satisfies the optimization target within the provided constraints.

The optimization may be provided via the optimization field of the Exponentiation; defaults to MINIMIZE_DEPTH.

It is possible to use a naive evolution for the operator by setting the field use_naive_evolution to True.

References

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

[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] N. Hatano and M. Suzuki, Finding Exponential Product Formulas of Higher Orders, https://arxiv.org/abs/math-ph/0506007 (2005)