# IsProductVector

Jump to navigation Jump to search
 Other toolboxes required IsProductVector Determines if a pure state is a product vector none IsProductOperatorSchmidtDecompositionSchmidtRank Entanglement and separability

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

### A product state's decomposition

The following code determines that a certain pure state living in $\mathbb{C}^2 \otimes \mathbb{C}^2 \otimes \mathbb{C}^2$ is a product state, and provides a decomposition of that product state. It is then verified that the tensor product of the vectors in that decomposition do indeed give the original state.

>> v = [1 0 0 0 1 0 0 0]/sqrt(2);
>> [ipv,dec] = IsProductVector(v,[2,2,2])

ipv =

1

dec =

[2x1 double]    [2x1 double]    [2x1 double]

>> celldisp(dec) % display the contents of dec

dec{1} =

0.7071
0.7071

dec{2} =

1.0000
0

dec{3} =

1
0

>> Tensor(dec)

ans =

0.7071
0
0
0
0.7071
0
0
0

## Source code

Click here to view this function's source code on github.