class QPanda::Variational::VariationalQuantumGate¶
Overview¶
Detailed Documentation¶
Construction¶
Copy Constructor for a new Variational Quantum Gate object.
Default Constructor for a new Variational Quantum Gate object.
Methods¶
Returns:
size_t the number of vars.
Get all variables for the VQG.
Returns:
std::vector<Variable>
Get the position for var in the m_vars. If not existed, return -1. Otherwise, return the position n, which is var == m_vars[n].
Parameters:
var |
The corresponding variable. |
Returns:
int -1 if not existed, or position.
Interface to instantialize the QGate with VQG.
Returns:
QGate Instantiation
Interface to instantialize the QGate with the “offset”.
Parameters:
offset |
<number of variable, offset> |
Returns:
Interface to copy the instance, and return a shared_ptr for the object.
Returns:
std::shared_ptr<VariationalQuantumGate>