Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
4.83k stars 2.29k forks source link

Add Rust representation for `XXMinusYYGate` and `XXPlusYYGate` #12606

Closed ElePT closed 1 week ago

ElePT commented 2 weeks ago

Summary

This PR adds some of the remaining gates from https://github.com/Qiskit/qiskit/issues/12566 XXPlusYY and XXMinusYY. It also adds a multiply_param function that makes the parameter multiplication step a bit more ergonomic (it matches the parameter type and deals with the different logic depending on whether it's a float or a parameter expression). The RZGate definition has been updated to use this function too.

This PR also fixes an oversight in the import path of TGate and TdgGate, which we should add a unit test for.

Details and comments

I don't love having to pass the py token around, so I am open to suggestions to improve the implementation.

coveralls commented 2 weeks ago

Pull Request Test Coverage Report for Build 9585037750

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/circuit/src/operations.rs 107 116 92.24%
<!-- Total: 151 160 94.38% -->
Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 3 92.37%
crates/qasm2/src/parse.rs 12 97.15%
<!-- Total: 15 -->
Totals Coverage Status
Change from base Build 9578841868: 0.02%
Covered Lines: 63705
Relevant Lines: 70953

💛 - Coveralls
qiskit-bot commented 1 week ago

One or more of the following people are relevant to this code: