-
Notifications
You must be signed in to change notification settings - Fork 59
Update special treatment for new PauliRot rule in graph decomp #2293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| @qml.qnode(qml.device("lightning.qubit", wires=2)) | ||
| # SKIP-CHECK-DAG: %0 = transform.apply_registered_pass "decompose-lowering" | ||
| # SKIP-CHECK{LITERAL}: func.func public @circuit_17() -> tensor<f64> attributes {decompose_gatesets | ||
| def circuit_17(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test somehow is flaky, in the sense that the graph decomp solution is not deterministic. Sometimes it contains a ppr op (despite ppr not being in the target gate set).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @qml.qnode(qml.device("lightning.qubit", wires=4)) | ||
| # SKIP-CHECK: %0 = transform.apply_registered_pass "decompose-lowering" | ||
| # SKIP-CHECK: func.func public @circuit_18(%arg0: tensor<3xf64>) -> tensor<f64> attributes {decompose_gatesets | ||
| def circuit_18(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
|
Hello. You may have forgotten to update the changelog!
|
| resources = qml.specs(with_qjit, level="device")()["resources"].gate_types | ||
| assert resources == expected_resources | ||
|
|
||
| @pytest.mark.xfail( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that there are 5 other tests in this file skipped to push out jax update, due to the same paulirot issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The remaining 5 pytests fail with the following error inside --decompose-lowering pass:
circuit_18_1/1_QuantumCompilationStage/1_SplitMultipleTapesPass.mlir:322:25: error: 'tensor.from_elements' op failed to verify that operand types match result element type
%out_qubits_9:2 = quantum.multirz(%extracted_8) %8, %9 : !quantum.bit, !quantum.bit
^
circuit_18_1/1_QuantumCompilationStage/1_SplitMultipleTapesPass.mlir:322:25: note: see current operation: %21 = "tensor.from_elements"(%17, %18) : (i64, i64) -> tensor<1xi64>
Apparantly multirz had some issues, and the new pauli rot rule is the first rule that contains a multirz in the body so this was never hit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually no, here's the list of their corresponding errors for the 5 remaining skipped pytests (all were passing as of the previous stable release):
test_ftqc_rotxzx: pennylane has no module namedftqctest_multi_qubits: aforementioned tensor.from_elements errortest_adjoint:ValueError: Could not capture _OperatorNode(op=TemporaryAND, num_work_wire_not_available=1, work_wire_dependent=False, min_work_wires=0) without the number of wires.. After adding"TemporaryAND", "ChangeOpBasis", "Prod"to the special list (@lazypanda10117 ), we discovered that the root cause is still the aforementioned tensor.from_elements errortest_ctrl: aforementioned tensor.from_elements errortest_template_qft: aforementioned tensor.from_elements error
|
closing in favor of #2326 |
Context:
Some decomposition test cases have been disabled previously due to incompatibility with the new
qml.PauliRotlowering rules. With the new implementation and fixes in #2284, we try re-enabling the test cases, but encounter various issues in the frontend pytest and lit tests.Currently, 5 pytests in
pytest/from_plxpr/test_decompose_transform.pyand 2 lit tests inlit/test_decomposition.pystill fail.Benefits: Reenabling tests that shouldn't have been skipped.
Related GitHub Issues:
#2284
PennyLaneAI/pennylane#8765