set_coefficient
Method of StateVector<as_complex,as_dense>.
Overloads
| Name | Description |
|---|---|
set_coefficient(integer index, const complex coefficient) -> StateVector<as_complex,as_dense> | Sets the coefficient of the state vector at the specified index equal to the provided value. |
set_coefficient(integer index, const real coefficient) -> StateVector<as_complex,as_dense> | Sets the coefficient of the state vector at the specified index equal to the provided value. |
set_coefficient(integer index, const complex coefficient) -> StateVector<as_complex,as_dense>
Sets the coefficient of the state vector at the specified index equal to the provided value.
Returns the coefficient corresponding to the basis state at the given index.
Parameters
- index: Index of the basis state.
- coefficient: New value of the state vector coefficient.
set_coefficient(integer index, const real coefficient) -> StateVector<as_complex,as_dense>
Sets the coefficient of the state vector at the specified index equal to the provided value.
Returns the coefficient corresponding to the basis state at the given index.
Parameters
- index: Index of the basis state.
- coefficient: New value of the state vector coefficient.