<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://qetlab.com/wiki/index.php?action=history&amp;feed=atom&amp;title=OperatorSinkhorn</id>
	<title>OperatorSinkhorn - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://qetlab.com/wiki/index.php?action=history&amp;feed=atom&amp;title=OperatorSinkhorn"/>
	<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=OperatorSinkhorn&amp;action=history"/>
	<updated>2026-04-16T01:40:39Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.3</generator>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=OperatorSinkhorn&amp;diff=485&amp;oldid=prev</id>
		<title>Nathaniel at 17:46, 3 October 2014</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=OperatorSinkhorn&amp;diff=485&amp;oldid=prev"/>
		<updated>2014-10-03T17:46:28Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:46, 3 October 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l4&quot; &gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|rel=[[FilterNormalForm]]&amp;lt;br /&amp;gt;[[OperatorSchmidtDecomposition]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|rel=[[FilterNormalForm]]&amp;lt;br /&amp;gt;[[OperatorSchmidtDecomposition]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|cat=[[List of functions#Miscellaneous|Miscellaneous]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|cat=[[List of functions#Miscellaneous|Miscellaneous]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|upd=&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;September 30&lt;/del&gt;, 2014&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|upd=&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;October 3&lt;/ins&gt;, 2014&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|v=0.50}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|v=0.50}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;tt&amp;gt;'''OperatorSinkhorn'''&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that performs operator Sinkhorn iterative scaling on a (potentially multipartite) operator, resulting in a locally equivalent operator that has all of its single-party reduced states proportional to the identity (see Section 4 of &amp;lt;ref name=&amp;quot;Gur04&amp;quot;&amp;gt;L. Gurvits. Classical complexity and quantum entanglement. &amp;lt;em&amp;gt;J. Comput. System Sci.&amp;lt;/em&amp;gt;, 69:448&amp;amp;ndash;484, 2004.&amp;lt;/ref&amp;gt;).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;tt&amp;gt;'''OperatorSinkhorn'''&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that performs operator Sinkhorn iterative scaling on a (potentially multipartite) operator, resulting in a locally equivalent operator that has all of its single-party reduced states proportional to the identity (see Section 4 of &amp;lt;ref name=&amp;quot;Gur04&amp;quot;&amp;gt;L. Gurvits. Classical complexity and quantum entanglement. &amp;lt;em&amp;gt;J. Comput. System Sci.&amp;lt;/em&amp;gt;, 69:448&amp;amp;ndash;484, 2004.&amp;lt;/ref&amp;gt;).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Nathaniel</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=OperatorSinkhorn&amp;diff=477&amp;oldid=prev</id>
		<title>Nathaniel at 19:34, 30 September 2014</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=OperatorSinkhorn&amp;diff=477&amp;oldid=prev"/>
		<updated>2014-09-30T19:34:27Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:34, 30 September 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l6&quot; &gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|upd=September 30, 2014&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|upd=September 30, 2014&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|v=0.50}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|v=0.50}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;tt&amp;gt;'''OperatorSinkhorn'''&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that performs operator Sinkhorn iterative scaling on a (potentially multipartite) operator, resulting in a locally equivalent operator that has all of its single-party reduced states proportional to the identity (see Section 4 of &amp;lt;ref name=&amp;quot;Gur04&amp;quot;&amp;gt;L. Gurvits. Classical complexity and quantum entanglement. &amp;lt;em&amp;gt;J. Comput. System Sci.&amp;lt;/em&amp;gt;, 69:448&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;-&lt;/del&gt;484, 2004.&amp;lt;/ref&amp;gt;).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;tt&amp;gt;'''OperatorSinkhorn'''&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that performs operator Sinkhorn iterative scaling on a (potentially multipartite) operator, resulting in a locally equivalent operator that has all of its single-party reduced states proportional to the identity (see Section 4 of &amp;lt;ref name=&amp;quot;Gur04&amp;quot;&amp;gt;L. Gurvits. Classical complexity and quantum entanglement. &amp;lt;em&amp;gt;J. Comput. System Sci.&amp;lt;/em&amp;gt;, 69:448&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;ndash;&lt;/ins&gt;484, 2004.&amp;lt;/ref&amp;gt;).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Syntax==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Syntax==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Nathaniel</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=OperatorSinkhorn&amp;diff=469&amp;oldid=prev</id>
		<title>Nathaniel: Created page with &quot;{{Function |name=OperatorSinkhorn |desc=Performs the operator Sinkhorn iteration, making all single-party reduced states proportional to the identity |rel=FilterNormalForm...&quot;</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=OperatorSinkhorn&amp;diff=469&amp;oldid=prev"/>
		<updated>2014-09-30T18:16:28Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Function |name=OperatorSinkhorn |desc=Performs the operator Sinkhorn iteration, making all single-party reduced states proportional to the identity |rel=&lt;a href=&quot;/FilterNormalForm&quot; title=&quot;FilterNormalForm&quot;&gt;FilterNormalForm&lt;/a&gt;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Function&lt;br /&gt;
|name=OperatorSinkhorn&lt;br /&gt;
|desc=Performs the operator Sinkhorn iteration, making all single-party reduced states proportional to the identity&lt;br /&gt;
|rel=[[FilterNormalForm]]&amp;lt;br /&amp;gt;[[OperatorSchmidtDecomposition]]&lt;br /&gt;
|cat=[[List of functions#Miscellaneous|Miscellaneous]]&lt;br /&gt;
|upd=September 30, 2014&lt;br /&gt;
|v=0.50}}&lt;br /&gt;
&amp;lt;tt&amp;gt;'''OperatorSinkhorn'''&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that performs operator Sinkhorn iterative scaling on a (potentially multipartite) operator, resulting in a locally equivalent operator that has all of its single-party reduced states proportional to the identity (see Section 4 of &amp;lt;ref name=&amp;quot;Gur04&amp;quot;&amp;gt;L. Gurvits. Classical complexity and quantum entanglement. &amp;lt;em&amp;gt;J. Comput. System Sci.&amp;lt;/em&amp;gt;, 69:448-484, 2004.&amp;lt;/ref&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;SIGMA = OperatorSinkhorn(RHO)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;SIGMA = OperatorSinkhorn(RHO,DIM)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;SIGMA = OperatorSinkhorn(RHO,DIM,TOL)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;[SIGMA,F] = OperatorSinkhorn(RHO,DIM,TOL)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
===Input arguments===&lt;br /&gt;
* &amp;lt;tt&amp;gt;RHO&amp;lt;/tt&amp;gt;: An positive semidefinite operator (typically a density matrix) that acts on a bipartite or multipartite Hilbert space. This operator will have the operator Sinkhorn iteration applied to it.&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIM&amp;lt;/tt&amp;gt; (optional, default has &amp;lt;tt&amp;gt;RHO&amp;lt;/tt&amp;gt; acting on two subsystems of equal size): A vector containing the dimensions of the two or more subsystems on which &amp;lt;tt&amp;gt;RHO&amp;lt;/tt&amp;gt; acts.&lt;br /&gt;
* &amp;lt;tt&amp;gt;TOL&amp;lt;/tt&amp;gt; (optional, default &amp;lt;tt&amp;gt;sqrt(eps)&amp;lt;/tt&amp;gt;): The numerical tolerance used to determine when the iteration has converged.&lt;br /&gt;
&lt;br /&gt;
===Output arguments===&lt;br /&gt;
* &amp;lt;tt&amp;gt;SIGMA&amp;lt;/tt&amp;gt;: A positive semidefinite operator with three properties: (1) its trace is the same trace as &amp;lt;tt&amp;gt;RHO&amp;lt;/tt&amp;gt;, (2) it is locally equivalent to &amp;lt;tt&amp;gt;RHO&amp;lt;/tt&amp;gt; (i.e., there exist invertible local operators that transform &amp;lt;tt&amp;gt;RHO&amp;lt;/tt&amp;gt; into &amp;lt;tt&amp;gt;SIGMA&amp;lt;/tt&amp;gt;), and (3) all of its single-party reduced density matrices are proportional to the identity operator.&lt;br /&gt;
* &amp;lt;tt&amp;gt;F&amp;lt;/tt&amp;gt; (optional): A cell containing the local filtering operations used to convert &amp;lt;tt&amp;gt;RHO&amp;lt;/tt&amp;gt; into &amp;lt;tt&amp;gt;SIGMA&amp;lt;/tt&amp;gt;. That is, a cell containing invertible operators so that &amp;lt;tt&amp;gt;Tensor(F)*RHO*Tensor(F)'&amp;lt;/tt&amp;gt; equals &amp;lt;tt&amp;gt;SIGMA&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===Verifying the partial traces===&lt;br /&gt;
The following code generates a random density matrix, performs operator Sinkhorn iterative scaling, and then verifies that the result has the claimed properties (both partial traces are proportional to the identity and it is locally equivalent to the input).&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; rho = RandomDensityMatrix(9);&lt;br /&gt;
&amp;gt;&amp;gt; [sigma,F] = OperatorSinkhorn(rho);&lt;br /&gt;
&amp;gt;&amp;gt; PartialTrace(sigma,1)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.3333 + 0.0000i   0.0000 - 0.0000i  -0.0000 - 0.0000i&lt;br /&gt;
   0.0000 + 0.0000i   0.3333 + 0.0000i   0.0000 - 0.0000i&lt;br /&gt;
  -0.0000 + 0.0000i   0.0000 + 0.0000i   0.3333 + 0.0000i&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; PartialTrace(sigma,2)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.3333 + 0.0000i  -0.0000 + 0.0000i   0.0000 - 0.0000i&lt;br /&gt;
  -0.0000 - 0.0000i   0.3333 + 0.0000i  -0.0000 + 0.0000i&lt;br /&gt;
   0.0000 + 0.0000i  -0.0000 - 0.0000i   0.3333 + 0.0000i&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; norm(Tensor(F)*rho*Tensor(F)' - sigma)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   1.8731e-16&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===A multipartite example===&lt;br /&gt;
The following example is similar to the previous one, except the density matrix that is used lives on 3-qubit space (i.e., the tripartite space where each local dimension is 2).&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; rho = RandomDensityMatrix(8);&lt;br /&gt;
&amp;gt;&amp;gt; [sigma,F] = OperatorSinkhorn(rho,[2,2,2]);&lt;br /&gt;
&amp;gt;&amp;gt; PartialTrace(sigma,[1,2],[2,2,2])&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.5000 + 0.0000i  -0.0000 - 0.0000i&lt;br /&gt;
  -0.0000 + 0.0000i   0.5000 + 0.0000i&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; PartialTrace(sigma,[1,3],[2,2,2])&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.5000 + 0.0000i  -0.0000 + 0.0000i&lt;br /&gt;
  -0.0000 - 0.0000i   0.5000 + 0.0000i&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; PartialTrace(sigma,[2,3],[2,2,2])&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.5000 + 0.0000i  -0.0000 + 0.0000i&lt;br /&gt;
  -0.0000 - 0.0000i   0.5000 + 0.0000i&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; norm(Tensor(F)*rho*Tensor(F)' - sigma)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   3.4349e-16&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Iteration may not converge for low-rank states===&lt;br /&gt;
It is known&amp;lt;ref&amp;gt;J. M. Leinaas, J. Myrheim, and E. Ovrum. Geometrical aspects of entanglement. &amp;lt;em&amp;gt;Phys. Rev. A&amp;lt;/em&amp;gt;, 74:012313, 2006. E-print: [http://arxiv.org/abs/quant-ph/0605079 arXiv:quant-ph/0605079]&amp;lt;/ref&amp;gt; that the operator Sinkhorn iteration converges whenever &amp;lt;tt&amp;gt;RHO&amp;lt;/tt&amp;gt; has full rank. However, the iteration may fail to converge for low-rank density matrices &amp;amp;ndash; an error will be produced by this script in these cases. The following code demonstrates an example.&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; rho = kron(RandomDensityMatrix(3,0,2),eye(3)); % clearly can not have its left partial trace scaled to be proportional to the identity&lt;br /&gt;
&amp;gt;&amp;gt; OperatorSinkhorn(rho)&lt;br /&gt;
Error using OperatorSinkhorn (line 100)&lt;br /&gt;
The operator Sinkhorn iteration does not converge for RHO. This is often the case if RHO is not of full&lt;br /&gt;
rank.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=OperatorSinkhorn}}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nathaniel</name></author>
	</entry>
</feed>