Required prerequisites
Describe the feature
Relates to issue #1475
Description
CUDA-Q implements a unitary-synthesis pass defined here.
As of October 1, 2024, this pass supports decomposition of 1-qubit and 2-qubit custom operations.
Extend this pass by implementing 3-qubit operation synthesis.
Steps:
- Choose an appropriate algorithm. Following references can be considered:
- Extend the
Decomposer class with new class which implements the 3-qubit decomposition.
- Override
decompose method which encapsulates the logic for decomposition, and
- Override
emitDecomposedFuncOp method which translates the result into native gate set.
- Update caller switch case here.
For example,
case 8: {
auto csd = ThreeQubitOpCSD(unitary); // rename according to the chosen algorithm
csd.emitDecomposedFuncOp(customOp, rewriter, funcName);
} break;
- Can reuse the
OneQubitOpZYZ defined here for any 1-q decomposition.
- Following tests should now pass:
- Python: here
- Remove
with pytest.raises(RuntimeError): and directly invoke sample on line#371.
- To run,
python3 -m pytest -rP ../python/tests/backends/test_Quantinuum_LocalEmulation_kernel.py::test_3q_unitary_synthesis
- C++: here
- To run,
nvq++ --target quantinuum --emulate targettests/execution/custom_operation_toffoli.cpp && ./a.out
- Additional test(s) with random 8x8 unitary matrices should be added.
Required prerequisites
Describe the feature
Relates to issue #1475
Description
CUDA-Q implements a
unitary-synthesispass defined here.As of October 1, 2024, this pass supports decomposition of 1-qubit and 2-qubit custom operations.
Extend this pass by implementing 3-qubit operation synthesis.
Steps:
Decomposerclass with new class which implements the 3-qubit decomposition.decomposemethod which encapsulates the logic for decomposition, andemitDecomposedFuncOpmethod which translates the result into native gate set.For example,
OneQubitOpZYZdefined here for any 1-q decomposition.with pytest.raises(RuntimeError):and directly invokesampleon line#371.python3 -m pytest -rP ../python/tests/backends/test_Quantinuum_LocalEmulation_kernel.py::test_3q_unitary_synthesisnvq++ --target quantinuum --emulate targettests/execution/custom_operation_toffoli.cpp && ./a.out