Difference between revisions of "SymmetricProjection"
m |
|||
Line 2: | Line 2: | ||
|name=SymmetricProjection | |name=SymmetricProjection | ||
|desc=Produces the [[projection]] onto the [[symmetric subspace]] | |desc=Produces the [[projection]] onto the [[symmetric subspace]] | ||
− | | | + | |rel=[[AntisymmetricProjection]]<br />[[PermutationOperator]]<br />[[SwapOperator]] |
− | | | + | |cat=[[List of functions#Permutations_and_symmetry_of_subsystems|Permutations and symmetry of subsystems]] |
|upd=November 20, 2012 | |upd=November 20, 2012 | ||
− | |v= | + | |v=0.50}} |
<tt>'''SymmetricProjection'''</tt> is a [[List of functions|function]] that computes the [[orthogonal projection]] onto the [[symmetric subspace]] of two or more subsystems. The output of this function is always a sparse matrix. | <tt>'''SymmetricProjection'''</tt> is a [[List of functions|function]] that computes the [[orthogonal projection]] onto the [[symmetric subspace]] of two or more subsystems. The output of this function is always a sparse matrix. | ||
Line 25: | Line 25: | ||
===Two subsystems=== | ===Two subsystems=== | ||
To compute the symmetric projection on two-qubit space, the following code suffices: | To compute the symmetric projection on two-qubit space, the following code suffices: | ||
− | < | + | <syntaxhighlight> |
>> SymmetricProjection(2) | >> SymmetricProjection(2) | ||
Line 36: | Line 36: | ||
(3,3) 0.5000 | (3,3) 0.5000 | ||
(4,4) 1.0000 | (4,4) 1.0000 | ||
− | </ | + | </syntaxhighlight> |
+ | |||
Note that the output of this function is always sparse. If you want a full matrix (not recommended for even moderately large <tt>DIM</tt> or <tt>P</tt>), you must explicitly convert it (as in the following example). | Note that the output of this function is always sparse. If you want a full matrix (not recommended for even moderately large <tt>DIM</tt> or <tt>P</tt>), you must explicitly convert it (as in the following example). | ||
===Two subsystems=== | ===Two subsystems=== | ||
To compute a matrix whose columns form an orthonormal basis for the symmetric subspace of three-qubit space, set <tt>PARTIAL = 1</tt>: | To compute a matrix whose columns form an orthonormal basis for the symmetric subspace of three-qubit space, set <tt>PARTIAL = 1</tt>: | ||
− | < | + | <syntaxhighlight> |
>> PS = full(SymmetricProjection(2,3,1)) | >> PS = full(SymmetricProjection(2,3,1)) | ||
Line 54: | Line 55: | ||
0 0 0 -0.5774 | 0 0 0 -0.5774 | ||
0 1.0000 0 0 | 0 1.0000 0 0 | ||
− | </ | + | </syntaxhighlight> |
Note that <tt>PS</tt> is an isometry from the symmetric subspace to the full three-qubit space. In other words, <tt>PS'*PS</tt> is the identity matrix and <tt>PS*PS'</tt> is the orthogonal projection onto the symmetric subspace, which we can verify as follows: | Note that <tt>PS</tt> is an isometry from the symmetric subspace to the full three-qubit space. In other words, <tt>PS'*PS</tt> is the identity matrix and <tt>PS*PS'</tt> is the orthogonal projection onto the symmetric subspace, which we can verify as follows: | ||
− | < | + | <syntaxhighlight> |
>> PS'*PS | >> PS'*PS | ||
Line 79: | Line 80: | ||
0 0 0 0.3333 0 0.3333 0.3333 0 | 0 0 0 0.3333 0 0.3333 0.3333 0 | ||
0 0 0 0 0 0 0 1.0000 | 0 0 0 0 0 0 0 1.0000 | ||
− | </ | + | </syntaxhighlight> |
+ | |||
+ | {{SourceCode|name=SymmetricProjection}} | ||
==References== | ==References== | ||
<references /> | <references /> |
Revision as of 19:26, 23 September 2014
SymmetricProjection | |
Produces the projection onto the symmetric subspace | |
Other toolboxes required | none |
---|---|
Related functions | AntisymmetricProjection PermutationOperator SwapOperator |
Function category | Permutations and symmetry of subsystems |
SymmetricProjection is a function that computes the orthogonal projection onto the symmetric subspace of two or more subsystems. The output of this function is always a sparse matrix.
Syntax
- PS = SymmetricProjection(DIM)
- PS = SymmetricProjection(DIM,P)
- PS = SymmetricProjection(DIM,P,PARTIAL)
- PS = SymmetricProjection(DIM,P,PARTIAL,MODE)
Argument descriptions
- DIM: The dimension of each of the subsystems.
- P (optional, default 2): The number of subsystems.
- PARTIAL (optional, default 0): If PARTIAL = 1 then PS isn't the orthogonal projection itself, but rather a matrix whose columns form an orthonormal basis for the symmetric subspace (and hence PS*PS' is the orthogonal projection onto the symmetric subspace).
- MODE (optional, default -1): A flag that determines which of two algorithms is used to compute the symmetric projection. If MODE = -1 then this script chooses which algorithm it thinks will be faster based on the values of DIM and P. If you wish to force the script to use a specific one of the algorithms (not recommended!), they are as follows:
- MODE = 0: Computes the symmetric projection by explicitly constructing an orthonormal basis of the symmetric subspace. The details of how to construct such a basis can be found in [1]. This method is typically fast when DIM is small compared to P.
- MODE = 1: Computes the symmetric projection by averaging all P! permutation operators (in the sense of the PermutationOperator function). Because P! grows very quickly, this method is only practical when P is small.
Examples
Two subsystems
To compute the symmetric projection on two-qubit space, the following code suffices:
>> SymmetricProjection(2)
ans =
(1,1) 1.0000
(2,2) 0.5000
(3,2) 0.5000
(2,3) 0.5000
(3,3) 0.5000
(4,4) 1.0000
Note that the output of this function is always sparse. If you want a full matrix (not recommended for even moderately large DIM or P), you must explicitly convert it (as in the following example).
Two subsystems
To compute a matrix whose columns form an orthonormal basis for the symmetric subspace of three-qubit space, set PARTIAL = 1:
>> PS = full(SymmetricProjection(2,3,1))
PS =
1.0000 0 0 0
0 0 -0.5774 0
0 0 -0.5774 0
0 0 0 -0.5774
0 0 -0.5774 0
0 0 0 -0.5774
0 0 0 -0.5774
0 1.0000 0 0
Note that PS is an isometry from the symmetric subspace to the full three-qubit space. In other words, PS'*PS is the identity matrix and PS*PS' is the orthogonal projection onto the symmetric subspace, which we can verify as follows:
>> PS'*PS
ans =
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
>> PS*PS'
ans =
1.0000 0 0 0 0 0 0 0
0 0.3333 0.3333 0 0.3333 0 0 0
0 0.3333 0.3333 0 0.3333 0 0 0
0 0 0 0.3333 0 0.3333 0.3333 0
0 0.3333 0.3333 0 0.3333 0 0 0
0 0 0 0.3333 0 0.3333 0.3333 0
0 0 0 0.3333 0 0.3333 0.3333 0
0 0 0 0 0 0 0 1.0000
Source code
Click here to view this function's source code on github.
References
- ↑ John Watrous. Lecture 21: The quantum de Finetti theorem, Theory of Quantum Information Lecture Notes, 2008.