Skip to content
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

Add Rust representation for CHGate, CPhaseGate, CSGate, CSdgGate, CSXGate, CSwapGate #12639

Merged
merged 11 commits into from
Jul 1, 2024

Conversation

ElePT
Copy link
Contributor

@ElePT ElePT commented Jun 21, 2024

Summary

This PR adds Rust representations for:

  • CHGate
  • CPhaseGate
  • CSGate
  • CSdgGate
  • CSXGate
  • CSwapGate

As part of #12566.

Details and comments

@ElePT ElePT changed the title Add CHGate, CPhaseGate, CSGate, CSdgGate, CSXGate, CSwapGate Add Rust representation for CHGate, CPhaseGate, CSGate, CSdgGate, CSXGate, CSwapGate Jun 21, 2024
@ElePT ElePT added performance Rust This PR or issue is related to Rust code in the repository labels Jun 24, 2024
@ElePT ElePT marked this pull request as ready for review June 24, 2024 14:00
@ElePT ElePT requested a review from a team as a code owner June 24, 2024 14:00
@qiskit-bot
Copy link
Collaborator

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

  • @Cryoris
  • @Qiskit/terra-core
  • @ajavadia
  • @kevinhartman
  • @mtreinish

@ElePT ElePT added the Changelog: None Do not include in changelog label Jun 24, 2024
@coveralls
Copy link

coveralls commented Jun 24, 2024

Pull Request Test Coverage Report for Build 9646684161

Details

  • 164 of 202 (81.19%) changed or added relevant lines in 8 files are covered.
  • 26 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.05%) to 89.731%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/circuit/quantumcircuit.py 22 32 68.75%
crates/circuit/src/operations.rs 128 156 82.05%
Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 94.02%
crates/qasm2/src/lex.rs 7 92.11%
crates/qasm2/src/parse.rs 18 96.69%
Totals Coverage Status
Change from base Build 9642268925: -0.05%
Covered Lines: 63796
Relevant Lines: 71097

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 24, 2024

Pull Request Test Coverage Report for Build 9648400932

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 180 of 216 (83.33%) changed or added relevant lines in 8 files are covered.
  • 23 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.04%) to 89.742%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/circuit/quantumcircuit.py 22 32 68.75%
crates/circuit/src/operations.rs 144 170 84.71%
Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 5 92.88%
crates/qasm2/src/parse.rs 18 96.23%
Totals Coverage Status
Change from base Build 9647487742: -0.04%
Covered Lines: 63878
Relevant Lines: 71180

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 25, 2024

Pull Request Test Coverage Report for Build 9658017782

Details

  • 180 of 196 (91.84%) changed or added relevant lines in 8 files are covered.
  • 21 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.008%) to 89.746%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/circuit/src/operations.rs 144 150 96.0%
qiskit/circuit/quantumcircuit.py 22 32 68.75%
Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 3 92.37%
crates/qasm2/src/parse.rs 18 96.69%
Totals Coverage Status
Change from base Build 9650973845: -0.008%
Covered Lines: 63901
Relevant Lines: 71202

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 25, 2024

Pull Request Test Coverage Report for Build 9662781712

Details

  • 180 of 196 (91.84%) changed or added relevant lines in 8 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.04%) to 89.756%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/circuit/src/operations.rs 144 150 96.0%
qiskit/circuit/quantumcircuit.py 22 32 68.75%
Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 3 92.62%
Totals Coverage Status
Change from base Build 9661630219: 0.04%
Covered Lines: 63908
Relevant Lines: 71202

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jul 1, 2024

Pull Request Test Coverage Report for Build 9741307109

Details

  • 231 of 244 (94.67%) changed or added relevant lines in 8 files are covered.
  • 34 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.006%) to 89.767%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/circuit/quantumcircuit.py 34 39 87.18%
crates/circuit/src/operations.rs 152 160 95.0%
Files with Coverage Reduction New Missed Lines %
crates/circuit/src/operations.rs 1 77.42%
crates/qasm2/src/lex.rs 8 92.62%
crates/qasm2/src/parse.rs 12 96.69%
qiskit/circuit/quantumcircuit.py 13 94.71%
Totals Coverage Status
Change from base Build 9718390567: -0.006%
Covered Lines: 64213
Relevant Lines: 71533

💛 - Coveralls

@ElePT ElePT added the mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library label Jul 1, 2024
Copy link
Contributor

@Cryoris Cryoris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two small comments, otherwise LGTM 🙂

qiskit/circuit/quantumcircuit.py Show resolved Hide resolved
test/python/circuit/test_rust_equivalence.py Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Jul 1, 2024

Pull Request Test Coverage Report for Build 9743228500

Details

  • 247 of 260 (95.0%) changed or added relevant lines in 8 files are covered.
  • 22 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.03%) to 89.804%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/circuit/quantumcircuit.py 34 39 87.18%
crates/circuit/src/operations.rs 152 160 95.0%
Files with Coverage Reduction New Missed Lines %
crates/circuit/src/operations.rs 1 79.17%
crates/qasm2/src/lex.rs 2 92.88%
crates/qasm2/src/parse.rs 6 97.61%
qiskit/circuit/quantumcircuit.py 13 94.69%
Totals Coverage Status
Change from base Build 9742940551: 0.03%
Covered Lines: 64369
Relevant Lines: 71677

💛 - Coveralls

@ElePT ElePT requested a review from Cryoris July 1, 2024 12:25
Copy link
Contributor

@Cryoris Cryoris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I'm fine moving the suggestions to the follow up #12659 👍🏻

@Cryoris Cryoris added this pull request to the merge queue Jul 1, 2024
Merged via the queue into Qiskit:main with commit a7fc2da Jul 1, 2024
15 checks passed
Procatv pushed a commit to Procatv/qiskit-terra-catherines that referenced this pull request Aug 1, 2024
…Gate, CSwapGate (Qiskit#12639)

* Add CHGate, CPhaseGate, CSGate, CSdgGate, CSXGate, CSwapGate

* Fix tests, add labels

* Fix oversights in gate definitions

* Fix test

* Add ctrl_state 1 to rust building path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library performance Rust This PR or issue is related to Rust code in the repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants