<?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=GHZState</id>
	<title>GHZState - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://qetlab.com/wiki/index.php?action=history&amp;feed=atom&amp;title=GHZState"/>
	<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=GHZState&amp;action=history"/>
	<updated>2026-07-19T15:55:07Z</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=GHZState&amp;diff=692&amp;oldid=prev</id>
		<title>Nathaniel: Added link to Wikipedia</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=GHZState&amp;diff=692&amp;oldid=prev"/>
		<updated>2014-12-20T04:07:07Z</updated>

		<summary type="html">&lt;p&gt;Added link to Wikipedia&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 04:07, 20 December 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-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;|cat=[[List of functions#Special_states,_vectors,_and_operators|Special states, vectors, and operators]]&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;|cat=[[List of functions#Special_states,_vectors,_and_operators|Special states, vectors, and operators]]&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;|upd=December 15, 2014}}&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=December 15, 2014}}&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;GHZState&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that returns a GHZ state on a given number of qubits (or qudits). For example, the usual $3$-qubit GHZ state is $\frac{1}{\sqrt{2}}(|000\rangle + |111\rangle)$. More generally, the GHZ state on $q$ qudits with local dimension $d$ is $\frac{1}{\sqrt{d}}\sum_{j=0}^{d-1} |j\rangle^{\otimes q}$. The output of this function is a sparse vector.&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;GHZState&#039;&#039;&#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that returns a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[http://en.wikipedia.org/wiki/Greenberger%E2%80%93Horne%E2%80%93Zeilinger_state &lt;/ins&gt;GHZ state&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;] &lt;/ins&gt;on a given number of qubits (or qudits). For example, the usual $3$-qubit GHZ state is $\frac{1}{\sqrt{2}}(|000\rangle + |111\rangle)$. More generally, the GHZ state on $q$ qudits with local dimension $d$ is $\frac{1}{\sqrt{d}}\sum_{j=0}^{d-1} |j\rangle^{\otimes q}$. The output of this function is a sparse vector.&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=GHZState&amp;diff=691&amp;oldid=prev</id>
		<title>Nathaniel: Created page with &quot;{{Function |name=GHZState |desc=Generates a (generalized) GHZ state |rel=DickeState&lt;br /&gt;MaxEntangled&lt;br /&gt;WState |cat=List of functions#Special_states,_vectors,...&quot;</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=GHZState&amp;diff=691&amp;oldid=prev"/>
		<updated>2014-12-20T04:06:35Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Function |name=GHZState |desc=Generates a (generalized) GHZ state |rel=&lt;a href=&quot;/DickeState&quot; title=&quot;DickeState&quot;&gt;DickeState&lt;/a&gt;&amp;lt;br /&amp;gt;&lt;a href=&quot;/MaxEntangled&quot; title=&quot;MaxEntangled&quot;&gt;MaxEntangled&lt;/a&gt;&amp;lt;br /&amp;gt;&lt;a href=&quot;/WState&quot; title=&quot;WState&quot;&gt;WState&lt;/a&gt; |cat=List of functions#Special_states,_vectors,...&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=GHZState&lt;br /&gt;
|desc=Generates a (generalized) GHZ state&lt;br /&gt;
|rel=[[DickeState]]&amp;lt;br /&amp;gt;[[MaxEntangled]]&amp;lt;br /&amp;gt;[[WState]]&lt;br /&gt;
|cat=[[List of functions#Special_states,_vectors,_and_operators|Special states, vectors, and operators]]&lt;br /&gt;
|upd=December 15, 2014}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;GHZState&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that returns a GHZ state on a given number of qubits (or qudits). For example, the usual $3$-qubit GHZ state is $\frac{1}{\sqrt{2}}(|000\rangle + |111\rangle)$. More generally, the GHZ state on $q$ qudits with local dimension $d$ is $\frac{1}{\sqrt{d}}\sum_{j=0}^{d-1} |j\rangle^{\otimes q}$. The output of this function is a sparse vector.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;GHZ_STATE = GHZState(DIM,Q)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;GHZ_STATE = GHZState(DIM,Q,COEFF)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIM&amp;lt;/tt&amp;gt;: The local dimension.&lt;br /&gt;
* &amp;lt;tt&amp;gt;Q&amp;lt;/tt&amp;gt;: The number of qubits (or qudits, if &amp;lt;tt&amp;gt;DIM &amp;gt; 2&amp;lt;/tt&amp;gt;).&lt;br /&gt;
* &amp;lt;tt&amp;gt;COEFF&amp;lt;/tt&amp;gt; (optional, default &amp;lt;tt&amp;gt;[1,1,...,1]/sqrt(DIM)&amp;lt;/tt&amp;gt;): A vector whose $j$-th entry is the coefficient of the term $|j-1\rangle^{\otimes q}$ in the generalized GHZ state.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===3-qubit GHZ state===&lt;br /&gt;
The following code generates the usual 3-qubit GHZ state:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; full(GHZState(2,3))&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
    0.7071&lt;br /&gt;
         0&lt;br /&gt;
         0&lt;br /&gt;
         0&lt;br /&gt;
         0&lt;br /&gt;
         0&lt;br /&gt;
         0&lt;br /&gt;
    0.7071&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===A 7-qudit GHZ state===&lt;br /&gt;
The following code generates the following GHZ state living in $(\mathbb{C}^4)^{\otimes 7}$:&lt;br /&gt;
: &amp;lt;math&amp;gt;\frac{1}{\sqrt{30}}\big( |0000000\rangle + 2|1111111\rangle + 3|2222222\rangle + 4|3333333\rangle \big).&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; GHZState(4,7,[1,2,3,4]/sqrt(30))&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
         (1,1)             0.1826&lt;br /&gt;
      (5462,1)             0.3651&lt;br /&gt;
     (10923,1)             0.5477&lt;br /&gt;
     (16384,1)             0.7303&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===A very large GHZ state===&lt;br /&gt;
This script has no trouble creating GHZ states on very large numbers of qudits. The following code generates the GHZ state in $(\mathbb{C}^3)^{\otimes 30}$:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; GHZState(3,30)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
                  (1,1)                      0.5774&lt;br /&gt;
    (102945566047325,1)                      0.5774&lt;br /&gt;
    (205891132094649,1)                      0.5774&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=GHZState}}&lt;/div&gt;</summary>
		<author><name>Nathaniel</name></author>
	</entry>
</feed>