qiskit
qiskit copied to clipboard
Initial pull requst for review for adding a new QuantumCircuit constructor
Summary
First commit on #8709 This is a first commit for adding a new QuantumCircuit constructor QuantumCircuit.from_instructions. It uses a rough interface, so it is missing bookkeeping and set tracking. The code for testing the method from_instruction can be found in circuit_draw.py.
Details and comments
Method for the constructor
@classmethod
def from_instructions(
cls, instructions: Iterable[CircuitInstruction], *, name=None, metadata=None, global_phase=0
):
"""Return a circuit from instructions
Returns:
QuantumCircuit: a circuit from instructions
"""
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 the following people are requested to review this:
- @Qiskit/terra-core
Hi @BramDo, welcome to the community! Take a look to the contributor guidelines if you didn't already. Also, considering starting with a good first issue as help wanted issues tend to assume your are familiar with the Qiskit internals and code-style.
You can also pass by #qiskit-pr-help on Slack if you need extra guidance.
I dont think this works with classical bits (let allow with conditions). Testing is always needed, but even more for this kind of code with so many corner cases.
The comment #8709 (comment) provides really good initial guidance on the direction.
Thank you for the review and the helpful insights. I will investigate how to implement this with classical bits according to the mentioned guidance. Good point about the conditions, that part is still open. I will go to slack for further questions.
This is still work in progress.
Bram has dropped out of the QAMP project this PR was for. I will take over this issue. Please close this PR and I'll open a new one.