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
5.28k stars 2.37k forks source link

Update random_circuit fuction in qiskit.circuit.random.utils.py #13054

Closed PhysicsQoo closed 6 days ago

PhysicsQoo commented 2 months ago

Summary

Adding random_clifford_T_circuit to support random circuits selects T and Tdg as elements.

Details and comments

part of #13053

qiskit-bot commented 2 months ago

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

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

CLAassistant commented 2 months ago

CLA assistant check
All committers have signed the CLA.

CLAassistant commented 2 months ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Cryoris commented 2 months ago

Thanks for opening a PR @PhysicsQoo! But I think we could tackle your issue in a bit a more general fashion, I just left a comment on your issue.

PhysicsQoo commented 2 months ago

Description:

Added a gates: str | list[str] ='all' argument, replacing the hardcoded gate list with standard_gates.get_standard_gate_name_mapping(). Introduced a parameterized argument, allowing users to select whether they want parameterized rotation gates.

Known Issue:

The parameterized functionality currently encounters an AttributeError: 'Parameter' object has no attribute '_root_uuid'. This issue is yet to be resolved. The feature works correctly when parameterized = False.

Cryoris commented 2 months ago

Dear @PhysicsQoo, it's nice to see that you're motivated to implement the additions to the random circuit -- but we have to approach this a bit differently: for this PR, we cannot remove existing functionality.

We can do the following steps:

Importantly, we don't change any of the existing functionality that creates the circuit with a certain depth or handles the operand distribution or parameterization. In a next step, we can have a look at supporting also num_gates as termination criterion or other features, but it would be good to start with a single feature and understand the process 🙂

1ucian0 commented 6 days ago

In its current state, this PR is a breaking change that do not follow the deprecation policy. I would close it for now. @PhysicsQoo please feel free to reopen a PR to address the @Cryoris comments.