<?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=Pure_to_mixed</id>
	<title>Pure to mixed - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://qetlab.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Pure_to_mixed"/>
	<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=Pure_to_mixed&amp;action=history"/>
	<updated>2026-08-04T16:45:31Z</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=Pure_to_mixed&amp;diff=867&amp;oldid=prev</id>
		<title>Nathaniel at 16:29, 20 January 2016</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=Pure_to_mixed&amp;diff=867&amp;oldid=prev"/>
		<updated>2016-01-20T16:29:43Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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 16:29, 20 January 2016&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-l5&quot;&gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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=January 12, 2016&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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=January 12, 2016&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;|helper=1}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;|helper=1}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&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;&#039;&#039;&#039;pure_to_mixed&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that convert&#039;s a state&#039;s current representation (either as a pure state vector or as a density matrix) into a density matrix.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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;&#039;&#039;&#039;pure_to_mixed&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that convert&#039;s a state&#039;s current representation (either as a pure state vector or as a density matrix) into a density matrix&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. This function just exists to make the code within some other functions a bit cleaner&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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=&quot;diff-marker&quot;&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=Pure_to_mixed&amp;diff=850&amp;oldid=prev</id>
		<title>Nathaniel: Created page with &quot;{{Function |name=pure_to_mixed |desc=Converts a state vector or density matrix representation of a state to a density matrix |cat=List of functions#Helper_functions|Helper f...&quot;</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=Pure_to_mixed&amp;diff=850&amp;oldid=prev"/>
		<updated>2016-01-12T13:52:35Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Function |name=pure_to_mixed |desc=Converts a state vector or density matrix representation of a state to a density matrix |cat=List of functions#Helper_functions|Helper f...&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=pure_to_mixed&lt;br /&gt;
|desc=Converts a state vector or density matrix representation of a state to a density matrix&lt;br /&gt;
|cat=[[List of functions#Helper_functions|Helper functions]]&lt;br /&gt;
|upd=January 12, 2016&lt;br /&gt;
|helper=1}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;pure_to_mixed&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that convert&amp;#039;s a state&amp;#039;s current representation (either as a pure state vector or as a density matrix) into a density matrix.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;RHO = pure_to_mixed(PHI)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;PHI&amp;lt;/tt&amp;gt;: A density matrix or a pure state vector.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
The following code shows that if &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; is a pure state vector then &amp;lt;tt&amp;gt;pure_to_mixed(v) == v*v&amp;#039;&amp;lt;/tt&amp;gt;, yet if &amp;lt;tt&amp;gt;rho&amp;lt;/tt&amp;gt; is a density matrix then &amp;lt;tt&amp;gt;pure_to_mixed(rho) == rho&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; v = RandomStateVector(2)&lt;br /&gt;
&lt;br /&gt;
v =&lt;br /&gt;
&lt;br /&gt;
   0.6732 - 0.5736i&lt;br /&gt;
   0.3190 + 0.3407i&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; pure_to_mixed(v)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.7822             0.0193 - 0.4123i&lt;br /&gt;
   0.0193 + 0.4123i   0.2178          &lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; pure_to_mixed(v*v&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.7822             0.0193 - 0.4123i&lt;br /&gt;
   0.0193 + 0.4123i   0.2178   &lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; v*v&amp;#039;&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
   0.7822             0.0193 - 0.4123i&lt;br /&gt;
   0.0193 + 0.4123i   0.2178       &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=pure_to_mixed|helper=1}}&lt;/div&gt;</summary>
		<author><name>Nathaniel</name></author>
	</entry>
</feed>