Skip to main content
IBM Quantum Platform
이 페이지는 Qiskit SDK의 이전 버전입니다. 최신 버전으로 이동

ParameterVector

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

GitHub

Bases: object

ParameterVector class to quickly generate lists of parameters.


Attributes

name

Returns the name of the ParameterVector.

params

Returns the list of parameters in the ParameterVector.


Methods

index

index(value)

GitHub

Returns first index of value.

resize

resize(length)

GitHub

Resize the parameter vector. If necessary, new elements are generated.

Note that the UUID of each Parameter element will be generated deterministically given the root UUID of the ParameterVector and the index of the element. In particular, if a ParameterVector is resized to be smaller and then later resized to be larger, the UUID of the later generated element at a given index will be the same as the UUID of the previous element at that index. This is to ensure that the parameter instances do not change.

>>> from qiskit.circuit import ParameterVector
>>> pv = ParameterVector("theta", 20)
>>> elt_19 = pv[19]
>>> rv.resize(10)
>>> rv.resize(20)
>>> pv[19] == elt_19
True
이 페이지가 도움이 되었습니까?
GitHub에서 버그, 오타를 보고하거나 컨텐츠를 요청하십시오.