Skip to main content
IBM Quantum Platform

ParameterVector

class qiskit.circuit.ParameterVector(name, length=0, uuid=None)

Bases: object

A container of many related Parameter objects.

This class is faster to construct than constructing many Parameter objects individually, and the individual names of the parameters will all share a common stem (the name of the vector). For a vector called v with length 3, the individual elements will have names v[0], v[1] and v[2].

The elements of a vector are sorted by the name of the vector, then the numeric value of their index.

This class fulfills the collections.abc.Sequence interface.


Attributes

name

The base name of the vector.

params

A sequence of the contained ParameterVectorElement instances.

Mutations to this object are not tracked.

uuid

Get the root UUID of this vector.


Methods

index

index(val)

Find the index of a ParameterVectorElement within the sequence.

This is an inefficient way of accessing the index field on the given value, which you should use instead.

resize

resize(length)

Change the length of this vector.

Any references to ParameterVectorElement instances with lengths greater than length are invalidated by calling this.

The UUIDs of ParameterVectorElement instances that are deleted or created by this method are stable; the UUIDs are always derived as index offsets from the vector’s UUID.

Was this page helpful?
Report a bug, typo, or request content on GitHub.