Skip to content

Failure to qjit two workflows transformed by clifford_t_decomposition and gridsynth when using AOT capture #2126

@albi3ro

Description

@albi3ro
@qml.qjit()
@partial(qml.transforms.clifford_t_decomposition, method="gridsynth")
@qml.qnode(qml.device('lightning.qubit', wires=1))
def c():
    qml.H(0)
    #qml.RZ(x, 0)
    qml.RZ(0.5, 0)
    return qml.expval(qml.X(0))

@qml.qjit()
@partial(qml.transforms.clifford_t_decomposition, method="gridsynth")
@qml.qnode(qml.device('lightning.qubit', wires=1))
def c2(x):
    qml.RZ(x, 0)
    return qml.expval(qml.X(0))

c2(0.5)

If one qnode with AOT capture transformed by clifford_t_decomposition with grid_synth has already been defined, another new qnode transformed by the same transform cannot be compiled.

This does not happen if the first qjit object is captured on the first call. It does not matter if the second workflow is AOT or lazily captured.

While it looks like method="sk" is causing concretization problems with parametrized inputs, it does not cause failures with AOT capture.

This is mostly just really weird.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingupstreamIssue with an upstream project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions