Documentation for QuantumCircuit.assign_parameters
seems to be wrong
#6533
Labels
QuantumCircuit.assign_parameters
seems to be wrong
#6533
Information
What is the current behavior?
The description of the
QuantumCircuit.assign_parameters
method in the docs, says that:but this does not seem to be the behaviour of the function. Instead, if you call
QuantumCircuit.parameters
the parameters seem to be returned in lexical order and passing an iterable assigns elements to the existing parameters in that order. The documentation does say that the order will be specified byQuantumCircuit.parameters
:But the comment about this being the order the parameters were inserted is misleading.
Steps to reproduce the problem
The intended behaviour is to remap parameters so that 'p0 -> q0', 'p1 -> q1', 'p2 -> q2' etc. but because of the lexical ordering 'q2' instead replaces 'p10'.
The text was updated successfully, but these errors were encountered: