Closed PhysicsQoo closed 6 days 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:
@Qiskit/terra-core
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.
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.
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.
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.
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:
gates
argument in the random_circuit
function. All other arguments remain in place, and we have to add the argument at the end (to not break user code that was using arguments positionally). So the new signature would be
def random_circuit(
num_qubits,
depth,
max_operands=4,
measure=False,
conditional=False,
reset=False,
seed=None,
num_operand_distribution: dict = None,
gates=None,
):
gates_(1,2,3,4)q
we would like to use the get_standard_gate_name_mapping
function. gates
was given by the user, we can then filter to have only the supported gates.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 🙂
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.
Summary
Adding random_clifford_T_circuit to support random circuits selects T and Tdg as elements.
Details and comments
part of #13053