![]() |
QPanda3
Supported by OriginQ
|
Public Member Functions | |
None | __init__ (self, *args, **kwargs) |
Initialize self. | |
float | at (self, list[int] idx_s) |
at(*args, **kwargs) Overloaded function. | |
float | at (self, int idx) |
at(*args, **kwargs) Overloaded function. | |
Any | at (self, i) |
at(*args, **kwargs) Overloaded function. | |
list[float] | gradients (self) |
gradients(self: vqcircuit.ResGradients) -> list[float] | |
int | __len__ (self) |
len(self: vqcircuit.ResGradients) -> int | |
None pyqpanda3.vqcircuit.vqcircuit.ResGradients.__init__ | ( | self, | |
* | args, | ||
** | kwargs ) |
Initialize self.
See help(type(self)) for accurate signature.
int pyqpanda3.vqcircuit.vqcircuit.ResGradients.__len__ | ( | self | ) |
len(self: vqcircuit.ResGradients) -> int
If an array [val_0, val_1, ..., val_n] is passed in as parameter values to generate a quantum circuit, the size of this array will be returned, and this size is equal to the number of gradient values.
Any pyqpanda3.vqcircuit.vqcircuit.ResGradients.at | ( | self, | |
i ) |
at(*args, **kwargs) Overloaded function.
Get a gradient value
If a mutable parameter is placeholder-ed using vqc.Param([idx_dim0, idx_dim1, ..., idx_dimn]), the corresponding gradient value can be obtained using at([idx_dim0, idx_dim1, ..., idx_dimn]).
idx_s | It should be input like [idx_dim0, idx_dim1, ..., idx_dimn] |
Get a gradient value
If an array [val_0, val_1, ..., val_n] is passed as the parameter values to generate a quantum circuit, the gradient value corresponding to the parameter value val_i can be obtained using at(i).
idx_s | It's i |
float pyqpanda3.vqcircuit.vqcircuit.ResGradients.at | ( | self, | |
int | idx ) |
at(*args, **kwargs) Overloaded function.
Get a gradient value
If a mutable parameter is placeholder-ed using vqc.Param([idx_dim0, idx_dim1, ..., idx_dimn]), the corresponding gradient value can be obtained using at([idx_dim0, idx_dim1, ..., idx_dimn]).
idx_s | It should be input like [idx_dim0, idx_dim1, ..., idx_dimn] |
Get a gradient value
If an array [val_0, val_1, ..., val_n] is passed as the parameter values to generate a quantum circuit, the gradient value corresponding to the parameter value val_i can be obtained using at(i).
idx_s | It's i |
float pyqpanda3.vqcircuit.vqcircuit.ResGradients.at | ( | self, | |
list[int] | idx_s ) |
at(*args, **kwargs) Overloaded function.
Get a gradient value
If a mutable parameter is placeholder-ed using vqc.Param([idx_dim0, idx_dim1, ..., idx_dimn]), the corresponding gradient value can be obtained using at([idx_dim0, idx_dim1, ..., idx_dimn]).
idx_s | It should be input like [idx_dim0, idx_dim1, ..., idx_dimn] |
Get a gradient value
If an array [val_0, val_1, ..., val_n] is passed as the parameter values to generate a quantum circuit, the gradient value corresponding to the parameter value val_i can be obtained using at(i).
idx_s | It's i |
list[float] pyqpanda3.vqcircuit.vqcircuit.ResGradients.gradients | ( | self | ) |
gradients(self: vqcircuit.ResGradients) -> list[float]
Get all gradient values
If an array [val_0, val_1, ..., val_n] is passed as the parameter values to generate the quantum circuit, the corresponding gradient values will be returned in the form [gradient_0, gradient_1, ..., gradient_n], where the gradient value gradient_i corresponds to the parameter value val_i.