Add partial draft of run-time parameters RFC #26
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Apologies, there's quite a lot more I intended to write (and refine the current text) about further parts of the design and my progress, but I now need this to be up and available for others immediately.
I have pushed the branch
move-instruction-parameters
to my fork which contains what I have currently done. Roughly, this is:Instruction.params
parameters
field toCircuitInstruction
,DAGOpNode
andDAGDepNode
(the last two might not be complete - I don't think I had fully finished updatingDAGCircuit
andDAGDependency
)CircuitInstruction
context class to insert a reference to themselves into containedInstruction
instancesInstruction
instancesInstruction.decompose
interface to replaceInstruction.definition
. What I've done isn't right at all - my failure here is what caused me to push this from Terra 0.21. The starts of the design in the RFC about defining "input parameters" forQuantumCircuit
are the right way forwards here, and the weird attempts currently in the branch to handleInstruction.decompose
andInstruction.definition
should be completely redone.RZGate()
, and it's only when we add it to a circuit that we define its operands.Certainly still to do:
Instruction.params
(whether through circuits or DAGs) in Terra need updating to the new form.QuantumCircuit
needs to learn how to specify input parameters, so we can define the new interface forInstruction.decompose
(orInstruction.definition
).Instruction.decompose
/Instruction.definition
method needs to be in place so ad-hoc no-subclassInstruction
instances can be created and parameterised correctly (e.g. the return value fromInstruction.inverse
, etc).Please don't take any of this RFC / any of the code I wrote in my branch on Terra as gospel - a lot of the interfaces doubtless need tweaking or rewriting.