<?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=Superoperator_dims</id>
	<title>Superoperator dims - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://qetlab.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Superoperator_dims"/>
	<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=Superoperator_dims&amp;action=history"/>
	<updated>2026-08-04T16:49:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=Superoperator_dims&amp;diff=632&amp;oldid=prev</id>
		<title>Nathaniel: Created page with &quot;{{Function |name=superoperator_dims |desc=Computes the input, output, and environment dimensions of a superoperator |cat=[[List of functions#Helper_functions|Helper functions]...&quot;</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=Superoperator_dims&amp;diff=632&amp;oldid=prev"/>
		<updated>2014-11-27T21:10:38Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Function |name=superoperator_dims |desc=Computes the input, output, and environment dimensions of a superoperator |cat=[[List of functions#Helper_functions|Helper functions]...&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=superoperator_dims&lt;br /&gt;
|desc=Computes the input, output, and environment dimensions of a superoperator&lt;br /&gt;
|cat=[[List of functions#Helper_functions|Helper functions]]&lt;br /&gt;
|upd=November 27, 2014&lt;br /&gt;
|helper=1}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;superoperator_dims&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that computes all of the dimensions of a given superoperator (i.e., the dimensions of its input space, output space, and environment space). It also serves as an error-checking function that will get cranky if the superoperator passed into it does not really represent a superopertor.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;[DA,DB,DE] = superoperator_dims(PHI)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;[DA,DB,DE] = superoperator_dims(PHI,ALLOW_RECT)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;[DA,DB,DE] = superoperator_dims(PHI,ALLOW_RECT,DIM)&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;PHI&amp;lt;/tt&amp;gt;: A superoperator, represented either as a Choi matrix or as a cell of Kraus operators.&lt;br /&gt;
* &amp;lt;tt&amp;gt;ALLOW_RECT&amp;lt;/tt&amp;gt; (optional, default 1): A flag (either 1 or 0) indicating that the input and output spaces of &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt; can or can&amp;#039;t be rectangular (non-square). If &amp;lt;tt&amp;gt;ALLOW_RECT == 0&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt; has non-square input or output space, an error is produced.&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIM&amp;lt;/tt&amp;gt; (optional): A 1-by-2 vector containing the dimensions of the input and output space of &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt;. If this argument is provided, the function serves only as an error-checking function that makes sure that the computed dimensions agree with these given dimensions (and gives an error otherwise).&lt;br /&gt;
&lt;br /&gt;
===Output arguments===&lt;br /&gt;
* &amp;lt;tt&amp;gt;DA&amp;lt;/tt&amp;gt;: A 1-by-2 vector containing the row and column dimensions of the input space of &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt; (if &amp;lt;tt&amp;gt;ALLOW_RECT == 0&amp;lt;/tt&amp;gt; then &amp;lt;tt&amp;gt;DA&amp;lt;/tt&amp;gt; is a scalar, not a vector).&lt;br /&gt;
* &amp;lt;tt&amp;gt;DB&amp;lt;/tt&amp;gt; (optional): A 1-by-2 vector containing the row and column dimensions of the output space of &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt; (if &amp;lt;tt&amp;gt;ALLOW_RECT == 0&amp;lt;/tt&amp;gt; then &amp;lt;tt&amp;gt;DB&amp;lt;/tt&amp;gt; is a scalar, not a vector).&lt;br /&gt;
* &amp;lt;tt&amp;gt;DE&amp;lt;/tt&amp;gt; (optional): A scalar indicating the environment dimension of &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt; (this is sometimes call the &amp;quot;Choi rank&amp;quot; of &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt;: it is the minimal number of Kraus operators in any representation of &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
The following code generates a random quantum channel from $M_3$ to $M_4$ and then computes its dimensions, and verifies that it cannot be written with fewer than 12 Kraus operators (which happens with probability 1):&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; Phi = KrausOperators(RandomSuperoperator([3,4]),[3,4]);&lt;br /&gt;
&amp;gt;&amp;gt; [da,db,de] = superoperator_dims(Phi)&lt;br /&gt;
&lt;br /&gt;
da =&lt;br /&gt;
&lt;br /&gt;
     3     3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
db =&lt;br /&gt;
&lt;br /&gt;
     4     4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
de =&lt;br /&gt;
&lt;br /&gt;
    12&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=superoperator_dims|helper=1}}&lt;/div&gt;</summary>
		<author><name>Nathaniel</name></author>
	</entry>
</feed>