IsProductVector
| IsProductVector | |
| Determines if a pure state is a product vector | |
| Other toolboxes required | opt_args SchmidtDecomposition |
|---|---|
| Related functions | IsProductOperator SchmidtRank |
IsProductVector is a function that determines if a bipartite or multipartite vector (e.g., a pure quantum state) is a product vector or not. If it is a product vector, its tensor decomposition can be provided.
Syntax
- IPV = IsProductVector(VEC)
- IPV = IsProductVector(VEC,DIM)
- [IPV,DEC] = IsProductVector(VEC,DIM)
Argument descriptions
Input arguments
- VEC: A vector that lives in a bipartite or multipartite Hilbert space.
- DIM (optional, by default has two subsystems of equal dimension): A specification of the dimensions of the subsystems that VEC lives in. DIM can be provided in one of two ways:
- If DIM is a scalar, it is assumed that VEC lives in the tensor product of two subsystems, the first of which has dimension DIM and the second of which has dimension length(VEC)/DIM.
- If $VEC \in \mathbb{C}^{n_1} \otimes \cdots \otimes \mathbb{C}^{n_p}$ then DIM should be a vector containing the dimensions of the subsystems (i.e., DIM = [n_1, ..., n_p]).
Output arguments
- IPV: Either 1 or 0, indicating that VEC is or is not a product vector.
- DEC (optional): If IPV = 1 (i.e., VEC is a product vector), then DEC is a cell containing two or more vectors, the tensor product of which is VEC. If IPV = 0 then DEC is meaningless.
Examples
A random example
A randomly-generated pure state will almost surely not be a product vector. The following code demonstrates this for a random pure state chosen from $\mathbb{C}^2 \otimes \mathbb{C}^3 \otimes \mathbb{C}^5$:
>> v = RandomStateVector(30); >> IsProductVector(v,[2,3,5]) ans = 0