quantum-compiler / quartz

The Quartz Quantum Compiler
Apache License 2.0
76 stars 19 forks source link

[Optimizer] Support context shift with multiple rules with the same source gate type #168

Closed xumingkuan closed 6 months ago

xumingkuan commented 6 months ago

This PR supports context shift with multiple rules with the same source gate type, e.g., "rz q0 0.25pi = t q0", "rz q0 -0.25pi = tdg q0", and also supports constant parameters in create_single_gate_GraphXfer (this feature was already supported in create_GraphXfer_from_qasm_str).

This PR also does some codebase cleaning, and adds a test to test_context_shift.