Skip to content

qDrift

The qdrift function implements the qDrift Trotter evolution of Ref. [1] .

Function: qdrift

Arguments:

  • pauli_operator: CArray[PauliTerm],
  • evolution_coefficient: CReal,
  • num_qdrift: CInt,
  • qbv: QArray[QBit],

Example

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


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

    allocate(2, qba)
    qdrift(
        [
            PauliTerm(pauli=[Pauli.X, Pauli.Y], coefficient=1.0),
            PauliTerm(pauli=[Pauli.Z, Pauli.I], coefficient=0.5),
        ],
        evolution_coefficient=2.0,
        num_qdrift=5,
        qbv=qba,
    )


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

References

[1] E. Campbell, Random Compiler for Fast Hamiltonian Simulation, (2019). https://arxiv.org/abs/1811.08017