Difference between revisions of "SymmetricProjection"
(Added info about the basis used when calling PARTIAL = 1) |
|||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{Function | {{Function | ||
|name=SymmetricProjection | |name=SymmetricProjection | ||
| − | |desc=Produces the | + | |desc=Produces the projection onto the symmetric subspace |
|rel=[[AntisymmetricProjection]]<br />[[PermutationOperator]]<br />[[SwapOperator]] | |rel=[[AntisymmetricProjection]]<br />[[PermutationOperator]]<br />[[SwapOperator]] | ||
|cat=[[List of functions#Permutations_and_symmetry_of_subsystems|Permutations and symmetry of subsystems]] | |cat=[[List of functions#Permutations_and_symmetry_of_subsystems|Permutations and symmetry of subsystems]] | ||
|upd=November 20, 2012 | |upd=November 20, 2012 | ||
|v=0.50}} | |v=0.50}} | ||
| − | <tt>'''SymmetricProjection'''</tt> is a [[List of functions|function]] that computes the | + | <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. |
==Syntax== | ==Syntax== | ||
| Line 40: | Line 40: | ||
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). | ||
| − | === | + | ===Three 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> | <syntaxhighlight> | ||
| Line 83: | Line 83: | ||
{{SourceCode|name=SymmetricProjection}} | {{SourceCode|name=SymmetricProjection}} | ||
| + | |||
| + | ==Notes== | ||
| + | When using <tt>PARTIAL = 1</tt> and <tt>MODE = 1</tt>, there is no guarantee about what the orthonormal basis of the symmetric subspace will look like. If you want control over this, specify <tt>MODE = 0</tt>, which forces the basis (i.e., the columns of <tt>PS</tt>) to be symmetric tensors <math>|i_1\rangle \vee |i_1\rangle \vee \cdots \vee |i_p\rangle</math>. Since May 2, 2022, the columns of <tt>PS</tt> are these symmetric tensors in lexicographical order (prior to that date they were returned in a different order). | ||
==References== | ==References== | ||
<references /> | <references /> | ||
Latest revision as of 14:04, 6 May 2022
| 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.0000Note 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).
Three 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 0Note 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.0000Source code
Click here to view this function's source code on github.
Notes
When using PARTIAL = 1 and MODE = 1, there is no guarantee about what the orthonormal basis of the symmetric subspace will look like. If you want control over this, specify MODE = 0, which forces the basis (i.e., the columns of PS) to be symmetric tensors \(|i_1\rangle \vee |i_1\rangle \vee \cdots \vee |i_p\rangle\). Since May 2, 2022, the columns of PS are these symmetric tensors in lexicographical order (prior to that date they were returned in a different order).
References
- ↑ John Watrous. Lecture 21: The quantum de Finetti theorem, Theory of Quantum Information Lecture Notes, 2008.