MBO
|
Typedefs | |
typedef struct MboTensorOp_t * | MboTensorOp |
Functions | |
MBO_EXPORT void | mboTensorOpNull (MboProdSpace h, MboTensorOp *top) |
Create a tensor operator corresponding to the Null operator. More... | |
MBO_EXPORT void | mboTensorOpIdentity (MboProdSpace h, MboTensorOp *top) |
Create a tensor operator corresponding to the Identity operator. More... | |
MBO_EXPORT void | mboTensorOpDestroy (MboTensorOp *top) |
Destroy a tensor operator object. More... | |
MBO_EXPORT void | mboTensorOpAddTo (MboElemOp elemop, int i, MboTensorOp top) |
Add an embedding to a tensor operator. More... | |
MBO_EXPORT MboProdSpace | mboTensorOpGetSpace (MboTensorOp op) |
Get the space on which the operator is defined This method returns a non-owning pointer to the space on which the tensor operator is defined. The caller must not modify the product space or destroy it. More... | |
MBO_EXPORT void | mboTensorOpAddScaledTo (struct MboAmplitude *alpha, MboElemOp elemop, int i, MboTensorOp top) |
Adds scaled version of embedded operator to tensor operator. More... | |
MBO_EXPORT MboTensorOp | mboTensorOpCopy (MboTensorOp a) |
Create a deep copy of a tensor operator. More... | |
MBO_EXPORT void | mboTensorOpMul (MboTensorOp a, MboTensorOp b, MboTensorOp *c) |
Multiply two operators and add result to third (*c) += a * b. | |
MBO_EXPORT void | mboTensorOpPlus (MboTensorOp a, MboTensorOp *b) |
Add a tensor operator to another operator (*b) += a. | |
MBO_EXPORT void | mboTensorOpScale (struct MboAmplitude *alpha, MboTensorOp *a) |
Scale operator. More... | |
MBO_EXPORT MBO_STATUS | mboTensorOpKron (int n, MboTensorOp *ops, MboTensorOp *c) |
Tensor product of two operators. More... | |
MBO_EXPORT int | mboTensorOpCheck (MboTensorOp op) |
Check integrity of tensor operator. More... | |
typedef struct MboTensorOp_t* MboTensorOp |
Data type for representing tensor operators.
MBO_EXPORT void mboTensorOpAddScaledTo | ( | struct MboAmplitude * | alpha, |
MboElemOp | elemop, | ||
int | i, | ||
MboTensorOp | top | ||
) |
Adds scaled version of embedded operator to tensor operator.
MBO_EXPORT void mboTensorOpAddTo | ( | MboElemOp | elemop, |
int | i, | ||
MboTensorOp | top | ||
) |
Add an embedding to a tensor operator.
Takes the elementary operator and embeds it into the product space of the tensor operator at slot i. Schematically, this can be written as follows:
top += I_0 x I_1 x ... x I_(i-1) x elemop x I_(i+1) x ... x I_N
elemop | Elementary operator to be embedded. |
i | Slot where operator gets embedded into the tensor operators product space. |
top | Tensor operator to which to add the result. |
MBO_EXPORT int mboTensorOpCheck | ( | MboTensorOp | op | ) |
Check integrity of tensor operator.
op | The operator to check. |
MBO_EXPORT MboTensorOp mboTensorOpCopy | ( | MboTensorOp | a | ) |
Create a deep copy of a tensor operator.
a | Operator to copy. |
MBO_EXPORT void mboTensorOpDestroy | ( | MboTensorOp * | top | ) |
Destroy a tensor operator object.
MBO_EXPORT MboProdSpace mboTensorOpGetSpace | ( | MboTensorOp | op | ) |
Get the space on which the operator is defined This method returns a non-owning pointer to the space on which the tensor operator is defined. The caller must not modify the product space or destroy it.
MBO_EXPORT void mboTensorOpIdentity | ( | MboProdSpace | h, |
MboTensorOp * | top | ||
) |
Create a tensor operator corresponding to the Identity operator.
The resources used by the object have to be release with mboTensorOpDestroy.
h | Underlying product space for the operator. |
top | The operator produced. |
MBO_EXPORT MBO_STATUS mboTensorOpKron | ( | int | n, |
MboTensorOp * | ops, | ||
MboTensorOp * | c | ||
) |
Tensor product of two operators.
*c += ops[0] x ops[1] x ... x ops[n]
MBO_EXPORT void mboTensorOpNull | ( | MboProdSpace | h, |
MboTensorOp * | top | ||
) |
Create a tensor operator corresponding to the Null operator.
The resources used by the object have to be release with mboTensorOpDestroy.
h | Underlying product space for the operator. |
top | The operator produced. |
MBO_EXPORT void mboTensorOpScale | ( | struct MboAmplitude * | alpha, |
MboTensorOp * | a | ||
) |
Scale operator.
Schematically: *a *= alpha;