Difference between revisions of "IsProductVector"

From QETLAB
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
|name=IsProductVector
 
|name=IsProductVector
 
|desc=Determines if a [[pure state]] is a [[product vector]]
 
|desc=Determines if a [[pure state]] is a [[product vector]]
|req=[[opt_args]]<br />[[SchmidtDecomposition]]
+
|rel=[[IsProductOperator]]<br />[[SchmidtDecomposition]]<br />[[SchmidtRank]]
|rel=[[IsProductOperator]]<br />[[SchmidtRank]]
+
|cat=[[List of functions#Entanglement_and_separability|Entanglement&nbsp;and&nbsp;separability]]
 
|upd=November 26, 2012
 
|upd=November 26, 2012
|v=1.00}}
+
|v=0.50}}
 
<tt>'''IsProductVector'''</tt> is a [[List of functions|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.
 
<tt>'''IsProductVector'''</tt> is a [[List of functions|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.
  
Line 27: Line 27:
 
===A random example===
 
===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$:
 
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$:
<pre<noinclude></noinclude>>
+
<syntaxhighlight>
>> v = [[RandomStateVector|RandomStateVector(30)]];
+
>> v = RandomStateVector(30);
 
>> IsProductVector(v,[2,3,5])
 
>> IsProductVector(v,[2,3,5])
  
Line 34: Line 34:
  
 
     0
 
     0
</pre<noinclude></noinclude>>
+
</syntaxhighlight>
  
 
===A product state's decomposition===
 
===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.
 
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.
<pre<noinclude></noinclude>>
+
<syntaxhighlight>
 
>> v = [1 0 0 0 1 0 0 0]/sqrt(2);
 
>> v = [1 0 0 0 1 0 0 0]/sqrt(2);
 
>> [ipv,dec] = IsProductVector(v,[2,2,2])
 
>> [ipv,dec] = IsProductVector(v,[2,2,2])
Line 50: Line 50:
 
     [2x1 double]    [2x1 double]    [2x1 double]
 
     [2x1 double]    [2x1 double]    [2x1 double]
  
>> celldisp(dec)
+
>> celldisp(dec) % display the contents of dec
 
   
 
   
 
dec{1} =
 
dec{1} =
Line 67: Line 67:
 
     0
 
     0
  
>> [[MultiKron|MultiKron(dec)]]
+
>> Tensor(dec)
  
 
ans =
 
ans =
Line 79: Line 79:
 
         0
 
         0
 
         0
 
         0
</pre<noinclude></noinclude>>
+
</syntaxhighlight>
 +
 
 +
{{SourceCode|name=IsProductVector}}

Latest revision as of 15:13, 22 September 2014

IsProductVector
Determines if a pure state is a product vector

Other toolboxes required none
Related functions IsProductOperator
SchmidtDecomposition
SchmidtRank
Function category 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.