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

Minor fix to consolidate blocks with RZZ and CZ gates #13958

Merged
merged 1 commit into from
Mar 5, 2025

Conversation

ShellyGarion
Copy link
Member

Summary

This is a minor fix to #13884 (so no release notes are needed, since it has not been released yet).

Details and comments

A minor fix following #13428 (comment)
when the backend has both CZ and RZZ gates

@ShellyGarion ShellyGarion added the Changelog: None Do not include in changelog label Mar 5, 2025
@ShellyGarion ShellyGarion added this to the 2.0.0 milestone Mar 5, 2025
@ShellyGarion ShellyGarion requested a review from a team as a code owner March 5, 2025 07:47
@qiskit-bot
Copy link
Collaborator

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

  • @Qiskit/terra-core

@t-imamichi
Copy link
Member

Thank you for fixing the issue. I confirmed that this PR fixes the issue.

from qiskit import QuantumCircuit, __version__, generate_preset_pass_manager
from qiskit_ibm_runtime import QiskitRuntimeService

print(__version__, "\n")
service = QiskitRuntimeService(name="primitives")
backend = service.backend("ibm_torino", use_fractional_gates=True)
target = backend.target

qc = QuantumCircuit(2)
qc.rzz(0.1, 0, 1)
qc.rzz(0.2, 0, 1)

pm = generate_preset_pass_manager(optimization_level=2, target=target)
tqc = pm.run(qc)
print(backend.configuration().basis_gates)
print(tqc.draw(idle_wires=False), "\n")
2.0.0.dev0+29f5468

['cz', 'id', 'rx', 'rz', 'rzz', 'sx', 'x']
global phase: π

q_0 -> 87 ──────────■──────────────────
          ┌───────┐ │ZZ(-0.3) ┌───────┐
q_1 -> 88 ┤ Rx(π) ├─■─────────┤ Rx(π) ├
          └───────┘           └───────┘

@coveralls
Copy link

Pull Request Test Coverage Report for Build 13670972956

Details

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • 4 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.03%) to 87.134%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 4 92.48%
Totals Coverage Status
Change from base Build 13661892985: 0.03%
Covered Lines: 76459
Relevant Lines: 87749

💛 - Coveralls

Copy link
Contributor

@ElePT ElePT left a comment

Choose a reason for hiding this comment

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

LGTM

@ElePT ElePT added this pull request to the merge queue Mar 5, 2025
Merged via the queue into Qiskit:main with commit 65d041b Mar 5, 2025
21 checks passed
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants