Skip to content
Browse files

Updating notebook examples to current format.

  • Loading branch information...
1 parent a86896d commit bee9c06597aa5de20069a9ef40de4ff782f51daf @ellisonbg ellisonbg committed
View
607 docs/examples/notebooks/basic_quantum.ipynb
@@ -1 +1,606 @@
-{"cells":[{"cell_type":"text","text":"<h1>Basic Symbolic Quantum Mechanics</h1>"},{"code":"%load_ext sympyprinting","cell_type":"code","prompt_number":1},{"code":"from sympy import sqrt, symbols, Rational\nfrom sympy import expand, Eq, Symbol, simplify, exp, sin\nfrom sympy.physics.quantum import *\nfrom sympy.physics.quantum.qubit import *\nfrom sympy.physics.quantum.gate import *\nfrom sympy.physics.quantum.grover import *\nfrom sympy.physics.quantum.qft import QFT, IQFT, Fourier\nfrom sympy.physics.quantum.circuitplot import circuit_plot","cell_type":"code","prompt_number":2},{"cell_type":"text","text":"<h2>Bras and Kets</h2>"},{"cell_type":"text","text":"Create symbolic states"},{"code":"phi, psi = Ket('phi'), Ket('psi')\nalpha, beta = symbols('alpha beta', complex=True)","cell_type":"code","prompt_number":3},{"cell_type":"text","text":"Create a superposition"},{"code":"state = alpha*psi + beta*phi; state\n","cell_type":"code","prompt_number":4},{"cell_type":"text","text":"Dagger the superposition and multiply the original"},{"code":"ip = Dagger(state)*state; ip\n","cell_type":"code","prompt_number":5},{"cell_type":"text","text":"Distribute"},{"code":"qapply(expand(ip))\n","cell_type":"code","prompt_number":6},{"cell_type":"text","text":"<h2>Operators</h2>"},{"cell_type":"text","text":"Create symbolic operators"},{"code":"A = Operator('A')\nB = Operator('B')\nC = Operator('C')","cell_type":"code","prompt_number":7},{"cell_type":"text","text":"Test commutativity"},{"code":"A*B == B*A\n","cell_type":"code","prompt_number":8},{"cell_type":"text","text":"Distribute A+B squared"},{"code":"expand((A+B)**2)","cell_type":"code","prompt_number":9},{"cell_type":"text","text":"Create a commutator"},{"code":"comm = Commutator(A,B); comm\n","cell_type":"code","prompt_number":10},{"cell_type":"text","text":"Carry out the commutator"},{"code":"comm.doit()","cell_type":"code","prompt_number":11},{"cell_type":"text","text":"Create a more fancy commutator"},{"code":"comm = Commutator(A*B,B+C); comm","cell_type":"code","prompt_number":12},{"cell_type":"text","text":"Expand the commutator"},{"code":"comm.expand(commutator=True)","cell_type":"code","prompt_number":13},{"cell_type":"text","text":"Carry out and expand the commutators"},{"code":"_.doit().expand()\n","cell_type":"code","prompt_number":14},{"cell_type":"text","text":"Take the dagger"},{"code":"Dagger(_)","cell_type":"code","prompt_number":15},{"code":"%notebook save basic_quantum.ipynb","cell_type":"code","prompt_number":16},{"code":"%notebook load quantum_computing.ipynb","cell_type":"code","prompt_number":19}]}
+<?xml version="1.0" encoding="utf-8"?>
+<notebook>
+ <name>basic_quantum</name>
+ <nbformat>2</nbformat>
+ <worksheets>
+ <worksheet>
+ <cells>
+ <markdowncell>
+ <source>&lt;h1&gt;Basic Symbolic Quantum Mechanics&lt;/h1&gt;</source>
+ </markdowncell>
+ <codecell>
+ <input>%load_ext sympyprinting</input>
+ <language>python</language>
+ <prompt_number>18</prompt_number>
+ <collapsed>1</collapsed>
+ <outputs />
+ </codecell>
+ <codecell>
+ <input>from sympy import sqrt, symbols, Rational
+from sympy import expand, Eq, Symbol, simplify, exp, sin
+from sympy.physics.quantum import *
+from sympy.physics.quantum.qubit import *
+from sympy.physics.quantum.gate import *
+from sympy.physics.quantum.grover import *
+from sympy.physics.quantum.qft import QFT, IQFT, Fourier
+from sympy.physics.quantum.circuitplot import circuit_plot</input>
+ <language>python</language>
+ <prompt_number>19</prompt_number>
+ <collapsed>1</collapsed>
+ <outputs />
+ </codecell>
+ <markdowncell>
+ <source>&lt;h2&gt;Bras and Kets&lt;/h2&gt;</source>
+ </markdowncell>
+ <markdowncell>
+ <source>Create symbolic states</source>
+ </markdowncell>
+ <codecell>
+ <input>phi, psi = Ket('phi'), Ket('psi')
+alpha, beta = symbols('alpha beta', complex=True)</input>
+ <language>python</language>
+ <prompt_number>20</prompt_number>
+ <collapsed>1</collapsed>
+ <outputs />
+ </codecell>
+ <markdowncell>
+ <source>Create a superposition</source>
+ </markdowncell>
+ <codecell>
+ <input>state = alpha*psi + beta*phi; state
+</input>
+ <language>python</language>
+ <prompt_number>21</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>pyout</output_type>
+ <text>α⋅❘ψ⟩ + β⋅❘φ⟩</text>
+ <png>aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUY4QUFBQVhDQVlBQUFCdFI1UDBBQUFBQkhOQ1NWUUlD
+QWdJZkFoa2lBQUFCSEJKUkVGVQphSUh0MlZtc1hXTVVCL0RmdmIwZHFCWXRqWkNyV3ZkQk9pRFZs
+bXBUTFRXMFVpU0drSGpScG9aRVRTVWtUUXlKc2VhSUd6RlVFU1hFCkEwcnd3SldLNFVFMFNqd2dh
+Rk5xbmtyYTRQS3c5czdaZDkrOTl6Mm5kMEJ5L3kvbmZHdDlhNTMxLzc3MXJXL3RmUmpFL3hMM1k4
+eS8KSFVRL28xODVOdmZDZGpTR05URC9KZ3pOeVM3SGhGN0UwRmVZaG5ZUjQxcGNpeWFOY2J3VUIr
+UmtsZnhhR2d5eU54aUpQM0t5cDdBYwpWd3hnSEhrc3hWKzRXTVRYakMvd1NZTisydkI1VGxiSnJ6
+ZVozd2pHNHRzQytTYnNnVkc5OUQ5dEorMk93NTlZbzVZWW5mZ05oelhnCnAxbHNZQjZWL0FacThZ
+OUNSNGx1TlpiMDB2OGRPMkV6Q3ZQeFNFNCtYbVR4MnczNG1vcjNTM1NsL0FacThXY29KL01XWmc1
+Z0xDbk8Kd21NRjhodnhpaWdaOVdLdTh1UXE1VmRVOHljbWdiVmlITDdHbGZnbDBUZmg3d0s3WVRn
+UFIySURic25vaHFvZDY5dkZ4WFJxUnI4TwppL0ZzQ1lIK3dIalJ6WXpHUTlndVl2OEtSeXZtbUVV
+clZ1QjduSVNEc0F0dXdLZTV1WFh4TzFqVXFVWEp1Qm4zSmNicHp0MmRmRDZKCmZUSzJsMkNTMk9Y
+dDJ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DdxL240YmpoRk54R3hSWnNkZ1Y5eXMrTjZoSC9p
+VjljQXBwdUxDT3Z6TVVwMXQ5YUNqem5tN0s2N0haYWppT0VTdAp2YTVDS2IvK2ZLU2ZyNzVGV2FL
+NDlXd0UzOVE1YjY0NHpYMkJRNVcvejhtaWxGOXZGcjlUY2J1V1lnbys3TUZIcTZpenYvWWlEamlq
+CnpubXpOZmJDcklyakhGR3FxdEJYL0xxaHA5ZkE3WFg0R09nL1V4cDkrMW5GOGM0NjdQOHJmeFlO
+WWhDREdBVDhBKzB3M1dzNWRhbkkKQUFBQUFFbEZUa1N1UW1DQwo=
+</png>
+ <latex>$$\alpha {\left|\psi\right\rangle } + \beta {\left|\phi\right\rangle }$$</latex>
+ <prompt_number>21</prompt_number>
+ </output>
+ </outputs>
+ </codecell>
+ <markdowncell>
+ <source>Dagger the superposition and multiply the original</source>
+ </markdowncell>
+ <codecell>
+ <input>ip = Dagger(state)*state; ip
+</input>
+ <language>python</language>
+ <prompt_number>22</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>pyout</output_type>
+ <text>⎛⎽ ⎽ ⎞
+⎝α⋅⟨ψ❘ + β⋅⟨φ❘⎠⋅(α⋅❘ψ⟩ + β⋅❘φ⟩)</text>
+ <png>aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQU5vQUFBQWFDQVlBQUFEUjlVSnZBQUFBQkhOQ1NWUUlD
+QWdJZkFoa2lBQUFDSHBKUkVGVQplSnp0bkhlTVZFVWN4ejkzUjBmZ3dEdWFvaWg0b0lKS1FNQ1du
+RjFBTUVyVTJFQVRRVVFsRmpSZzdCcERiSW1DR3ZWTUVLT29JV0pzCkpOWTFGaXlnU0FtaWxOaUFp
+RmhqUWVYT1AzN3p2TGV6TS9ObTN0dTdOYnFmNUxLN00vTm1mci85dmpmbE4zTmJRWms0aHdHekxY
+bmYKQStlMG9pMWwva2RNQVhxVzJvai9LYk9CTHFVMm9reHhxSFRrblEzc0FuelR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1RkRkakF5eFhTMEdOU0pmekVKYWJxcllpUHZrUkp4Njh1ZnpmNUE4OVVueQpzUTc1
+dDZNZG5qYkVHWVk4eUxialF6dVJUV2pYT2loRUx4Y2hXbzBsZWFSTWFzdEhzM3JDOVhMaHExV1Nm
+M09SWUU2aTVsVklhTFVZCnY1RXhITGpNa1crTFRPcmtNdGhnNnRGTjNFbTZVL0F1SCs5QXdyOUo1
+TFRQN1pESXBzOHArR2N3YjZpR290dWc0NnZWQXNUK0xQaG8KbGthdm5DUFBWeXVYZnhPUXFIdmVJ
+R2I3S1lPZHlPNzRCTEwvYnNWeTdEZExEZWJlMXNTbEdXendiYU1kOEZlSytsMCt4dmRrWE9qKwp6
+VUpPYmZpc1YwOUhUb2owU0NvWWFFTWNYNjMyQXo2bGNLOHRGSisyMHVqbDh0RkhLNWQvWFpEamFC
+UHduMFVCY3ZxNGMyS3BaR3h6Cit2Wmt2em1LU2Uva0lsWnNQcWF0TS9TNkRyVHNqL240YXRXSjdL
+T1pMMW4wU2x1Znk3K094RTdzbHlsVHBreVpNbVhLbENtVGdyOEIKMktjNjJRN3k0RTRBQUFBQVNV
+Vk9SSzVDWUlJPQo=
+</png>
+ <latex>$$\left(\overline{\alpha} {\left\langle \psi\right|} + \overline{\beta} {\left\langle \phi\right|}\right) \left(\alpha {\left|\psi\right\rangle } + \beta {\left|\phi\right\rangle }\right)$$</latex>
+ <prompt_number>22</prompt_number>
+ </output>
+ </outputs>
+ </codecell>
+ <markdowncell>
+ <source>Distribute</source>
+ </markdowncell>
+ <codecell>
+ <input>qapply(expand(ip))
+</input>
+ <language>python</language>
+ <prompt_number>23</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>pyout</output_type>
+ <text>⎽ ⎽ ⎽ ⎽
+α⋅α⋅⟨ψ❘ψ⟩ + α⋅β⋅⟨φ❘ψ⟩ + β⋅α⋅⟨ψ❘φ⟩ + β⋅β⋅⟨φ❘φ⟩</text>
+ <png>aVZCT1J3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Y2QKTDhydFNLMFdiVXpZM1IzYU53anphVmtTNTI3
+SVNTT3EvNkNLd3JqVk1NNldWMUY5YkRwT2VYcFl3OWgyUExMMnJqUFhxSVBiVHZWWApxRUJxRTMr
+bEVBL3lSQy9waHhnR0l3dFRmMGlJTVpGcG52bkFhc2UrNHI2SmtxU08yTlZSdld6amU4eW5aVW1j
+ZHdPL3gvU3ZVVjZNClRmaTY4Q3FxajAzSEtTOFBheGk3akVmVzNuWG1XcXNmQmxtSGZJTWpUaFhz
+N3VSczhuUkI2bGxKUzBkTU5NK3hmWlNhZ2E4YzJpZHgKUGc3NDJpRzNyd3I1TURiaDY4cExxeng4
+YkRKT2VYcFl3OWhsUExMMnJqUFhXcDA4OXlMRjIrYVkvZjFvV3lPV3BOWEFGd243VGZLMApJTFVZ
+VjVuK1FJUkdVNEMzSE5vbmNUNEplTWNnUjFFWW0vQjE1YVZWSGo0MkdhYzhQYXhoN0RJZVdYczNU
+NjZwcTU3NDJrZlVyMjNiCnlDUlBiK0svMFZCcjlVc2hSeHpudnFSejhTd1M0elI0YVpXMWowM0dL
+VThQYXhpN2prZVczaTBhMTFLbFNwVXFWYXBVcVZLbFNwVXEKVmFwVWV2b2Z6NFNPd3VmaXE1Z0FB
+QUFBU1VWT1JLNUNZSUk9Cg==
+</png>
+ <latex>$$\alpha \overline{\alpha} \left\langle \psi \right. {\left|\psi\right\rangle } + \alpha \overline{\beta} \left\langle \phi \right. {\left|\psi\right\rangle } + \beta \overline{\alpha} \left\langle \psi \right. {\left|\phi\right\rangle } + \beta \overline{\beta} \left\langle \phi \right. {\left|\phi\right\rangle }$$</latex>
+ <prompt_number>23</prompt_number>
+ </output>
+ </outputs>
+ </codecell>
+ <markdowncell>
+ <source>&lt;h2&gt;Operators&lt;/h2&gt;</source>
+ </markdowncell>
+ <markdowncell>
+ <source>Create symbolic operators</source>
+ </markdowncell>
+ <codecell>
+ <input>A = Operator('A')
+B = Operator('B')
+C = Operator('C')</input>
+ <language>python</language>
+ <prompt_number>24</prompt_number>
+ <collapsed>1</collapsed>
+ <outputs />
+ </codecell>
+ <markdowncell>
+ <source>Test commutativity</source>
+ </markdowncell>
+ <codecell>
+ <input>A*B == B*A
+</input>
+ <language>python</language>
+ <prompt_number>25</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>pyout</output_type>
+ <text>False</text>
+ <prompt_number>25</prompt_number>
+ </output>
+ </outputs>
+ </codecell>
+ <markdowncell>
+ <source>Distribute A+B squared</source>
+ </markdowncell>
+ <codecell>
+ <input>expand((A+B)**2)</input>
+ <language>python</language>
+ <prompt_number>26</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>pyout</output_type>
+ <text>2 2
+A⋅B + A + B⋅A + B</text>
+ <png>aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQU1BQUFBQVpDQVlBQUFCbjdTSGdBQUFBQkhOQ1NWUUlD
+QWdJZkFoa2lBQUFCT05KUkVGVQplSnp0Mmx1b0ZWVWN4L0ZQNmpuWnNkTk5LelZGS0xzWDFFT1Jw
+R1lJS1JrRlJnUkpENzBvRkJSRm1sUXYwa3NQUVVWWVBZWFJUY1RxCklTcUtvdWhDRDBZU2RDVUt0
+SXRkMEpKU3V1bnBZZTNOMlU0emU2ODFNL3NjT2N3WERwczlhODNNLy9mL25UWHJ2OVpzR2hvYUdo
+STUKRW1kZ3luZ0gwdENUcmw1Tkh0dFlKZ1Fyc0JMSFlDT21ZdHU0UnRSUVJPTlZ6UXpncGRZbm5J
+NFJYRGh1RVRVVTBYalZCMDdBbjFqUQpjZXdQckJtZmNCcTZFT1ZWYWcyN0VvUFkzS1hQUnN3cmFQ
+c0hPMXZuZjVCNDcxUUc4WGRDL3p4dDJXdnN3Ykg0cS9WOVBvN1NmeTFGCjlDUFhNUjdYVFpGWEtm
+cjY3dFdKcllzKzFxUGZJTTRYcHB2bk1TUU10Q21ZZzRkYmJldktCaExCTEt4TzZGK2s3VjZqVTJn
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MGRQaEl1RnQyN3NGN1dmak9H
+RlVadzNaSnRSdFdSWUlpWG95cHkxYlErNFM2c0J1YjRGVHRaMG0xSmtqQmRlTHBRNTluVlRKCk5l
+VTlabXk4S3FNdjJhdThBVEFQbHd1ai9HQ21iV2JtTTB1N1ppc0src2JXNTFNNWJYc2NXdWUxbVlG
+cHdnbytoczNDMUppM3cxQkcKMnhMRlQ2RVU2dExYcGtxdXEzak0ySGhWUnQ4U0ZiMGF4anZDVzdV
+ODVndWphMU5CK3l1S0YxeXJXK2MrSnlRcGx0UnR3aUc4NXYrdgp4Y3RvbTRGWGhYM2tmbEYyRzdS
+c3JxdDYzSTI2dkNKZFh5bXYyalBBTU83Qk5UaEwyQlBlNE5CZGdEWENDQ004UGRiaFpYeU5tNFZW
+Ci9SWENOdHA2L05zUjJKV0MyRnZ4U0VxQUpkZ3Y3R3FzRm1yY0t0cFdDZHFxbGo5MU1WWDVYRmZK
+dzZlMUt3bGt2YXFpN3c0bHZHcVAKbG1GYzFuRjhCRzhZL1NVZFlick1qdFNQOEVzcjJLS1Jkd0Fm
+QzR1V01pekhCYmcvOGJ4VDhMMXEyaVlMTlhFL1NkRTNvSHl1cStRaAoxcnVxWGxYUk4xZi92Um9Y
+bHVHdThRNmlqMHdrZlJOSnkySEROUDNma3g1UEpwSytpYVNsb2FHaG9hR2hvV0dpOGgrc1pjTHdo
+djBRCnV3QUFBQUJKUlU1RXJrSmdnZz09Cg==
+</png>
+ <latex>$$A B + \left(A\right)^{2} + B A + \left(B\right)^{2}$$</latex>
+ <prompt_number>26</prompt_number>
+ </output>
+ </outputs>
+ </codecell>
+ <markdowncell>
+ <source>Create a commutator</source>
+ </markdowncell>
+ <codecell>
+ <input>comm = Commutator(A,B); comm
+</input>
+ <language>python</language>
+ <prompt_number>27</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>pyout</output_type>
+ <text>[A,B]</text>
+ <png>aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0F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dld3Ex
+aXBGUTNWa2xMNlpUZTlyRWUzRm5tclF4M3ZpSThHY2lhNnZLcTlrdC9adzlHV3dWCnZBMVBzZTUv
+L052NEJmcHZkNXROTFJsdUFBQUFBRWxGVGtTdVFtQ0MK
+</png>
+ <latex>$$\left[A,B\right]$$</latex>
+ <prompt_number>27</prompt_number>
+ </output>
+ </outputs>
+ </codecell>
+ <markdowncell>
+ <source>Carry out the commutator</source>
+ </markdowncell>
+ <codecell>
+ <input>comm.doit()</input>
+ <language>python</language>
+ <prompt_number>28</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>pyout</output_type>
+ <text>A⋅B - B⋅A</text>
+ <png>aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUU0QUFBQVNDQVlBQUFEMTV1aVJBQUFBQkhOQ1NWUUlD
+QWdJZkFoa2lBQUFBaTVKUkVGVQpXSVh0MXp0b1ZFRVlCZURQR0VHTGxRUU1haFFpcEJVRjBTcVl3
+bWRockN4Rk8rMEYwVUt4VVZTMEVMRU5hV09oUWhvckZmR0JsWStnCklwcE9nbURBS2tyVXFMR1lR
+ZGRrN3U1OUpBRmhEeXgzZHM0L2M4N1p1WFBuTGkyVXdwS0M5VmN3aVRNTmFnYXhEWnZ3RlUvd1BY
+S3IKMEluck9JZXBndnFOc0JDNmVmSTJ4VmI4eEZDTzJnMll3YVVFdHk5eUkxWE1MSUp1a2J5WmFN
+UGRLSHc3Ui8yaFdMc3JneCtMcG1wVgpUQzJnYnRPOGJUa05IY1VOVEdOTmp2cCtZWnM4VG5BMXJN
+Y0VQdWZVejR2NTBpMmFONGt1NGRkdnd6Zys1Qmp6Rmc4enVCUENTaDRwCmEyaUJkY3ZrVFdJSWZi
+SDlGRDgwdmxOWFI0Tm5aL1YzeEw0SkhDNXJaaEYwYytWdGJ6SkpINWI2ZSt0L2pOKzdZanVGL25q
+dHhjWFkKcm1FQTcrS2NZMDN0RjhkODZKYkpPd2Z0ZUlTMWRYMUR3cXB1YmpEdUdyNWhlWUk3THh6
+dnUvT2FLSUNxdW1YenpzRXhISi9WZHlGTwp0TGZCdUZIcGh6T3NFQjY0NzRzWXlZbXF1b1h5Wm0z
+VjdqakpHLzhlN1QzeG1uWFNkR0FqTG1mdzA4SmRzVTdZUnBQQ1ZqcWRVWi9DCmlCQ29xbTQ5eXVh
+ZGcySHNTUFFmRUZiZ1pNYTQvWkVmeU9DM1IvNU9YaU01VVZXM2NON1U2YmdUbjNBdndZM0hhOVlL
+OUVlaDFKWloKaGxPeFBaZ3h2aXlxNkZiSit3ZGJoTk9qTTRQdmpRYUhNL2puZUpubzc4Rk5mTUhC
+WmlaS29LeHUxYnk2OFFxL1l1RnI0YjJvSHJlRQpsOEVaNFUvMEErekJTbUcxWGtSdVNqaWQ3c2ZQ
+S0o3aHF2QWNtaTlVMGEyU3Q0VVdXdmgvOEJ0MXY4VEcwN0FDaFFBQUFBQkpSVTVFCnJrSmdnZz09
+Cg==
+</png>
+ <latex>$$A B - B A$$</latex>
+ <prompt_number>28</prompt_number>
+ </output>
+ </outputs>
+ </codecell>
+ <markdowncell>
+ <source>Create a more fancy commutator</source>
+ </markdowncell>
+ <codecell>
+ <input>comm = Commutator(A*B,B+C); comm</input>
+ <language>python</language>
+ <prompt_number>29</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>pyout</output_type>
+ <text>[A⋅B,B + C]</text>
+ <png>aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUdBQUFBQVdDQVlBQUFBLzQ1bmtBQUFBQkhOQ1NWUUlD
+QWdJZkFoa2lBQUFBM3RKUkVGVQphSUh0MkUyc1hWTVVCL0RmZXhxdlV2cjBReFhGUUkyazhkbjRh
+dCtBMXdnbGtmaUltUkloRWhFRERCclZDTkxHTTJxakhSQTZFTVNFCmdmaElrU3Q5alU3RTkwY0lT
+YVdFcEJKYURhckZZTzNiM2w3bjNMUFA2NzMzVGU1L3NzL1phKzMvWHVmc3RkWmVl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w4Qk5PTHRFOQpUWGpCS3lYeUhmaW1vSDhSWGhScDRyYVNz
+YzFUN2dOZDV1MkV1bVhvYkxFSWt6aTlwWDhVdDRoQ29haEVyeXhENTR0Uzh4eUhxNTl4Cmh6MmV1
+RnhhbnA2dkVkNjRQbzE3VFpScDU0c0xzdTBpaW9qNnZaa2VMaEViYVJGMjRRY1JnUk00cmt1ODNj
+UWVYQ1VPZlJ1RUEzeUYKWDBYQlV1UThsV2gweWJodTRaRSt6aldWcTRpcFlFcGw2SFJnV0hoMXY3
+QlAvNjZ1RDZIdVhWQS9jVGRlN2VOOFcvczQxeUcwUjhBQgpFU0w5Q01WT21DL3kva2ZUYkVjM2Ni
+UDR0NmZvM1FYaEFBTU1NRUFkL0FmM1FPSkhTbklZTndBQUFBQkpSVTVFcmtKZ2dnPT0K
+</png>
+ <latex>$$\left[A B,B + C\right]$$</latex>
+ <prompt_number>29</prompt_number>
+ </output>
+ </outputs>
+ </codecell>
+ <markdowncell>
+ <source>Expand the commutator</source>
+ </markdowncell>
+ <codecell>
+ <input>comm.expand(commutator=True)</input>
+ <language>python</language>
+ <prompt_number>30</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>pyout</output_type>
+ <text>[A,B]⋅B + [A,C]⋅B + A⋅[B,C]</text>
+ <png>aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQU44QUFBQVdDQVlBQUFCQUhrbFFBQUFBQkhOQ1NWUUlD
+QWdJZkFoa2lBQUFCT1ZKUkVGVQplSnp0bTB0b1hVVVl4MytKQ1duRitLclUra1lMWXRIYWhZK2dK
+S1dJcjlxNkVWeXBGSFJSeFlBRm4zUmpYRm5CallLSzFFZ0VVUmMrClVOQ0lRaDBmUVZ4cGl3dVJn
+TzgzaWxJdGF1dGo4YzNoM2h4bnpwazU4ODI5dDNKK0VFNHkzOHgzdnU5LzU4eWNPek9CbHBhV3Zq
+QlUKK3Z0VjRIZmdkZUNobXJiM0FvY0FkelM0N3d4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G1BQUFBQUVsRlRrU3VRbUNDCg==
+</png>
+ <latex>$$\left[A,B\right] B + \left[A,C\right] B + A \left[B,C\right]$$</latex>
+ <prompt_number>30</prompt_number>
+ </output>
+ </outputs>
+ </codecell>
+ <markdowncell>
+ <source>Carry out and expand the commutators</source>
+ </markdowncell>
+ <codecell>
+ <input>_.doit().expand()
+</input>
+ <language>python</language>
+ <prompt_number>31</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>pyout</output_type>
+ <text>2
+A⋅B⋅C + A⋅B - B⋅A⋅B - C⋅A⋅B</text>
+ <png>aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQU84QUFBQVpDQVlBQUFEWnUzbTlBQUFBQkhOQ1NWUUlD
+QWdJZkFoa2lBQUFCYlJKUkVGVQplSnp0bTNsb0hVVWN4ejgyaHpIeXZHdmFSQnN4MFZvUFBHdGJQ
+R093aWhWRkJTc2VVQlFNRkd5MUZxMFhLdjVURmRPb3FNVzdGUThDClZnUVZFVk9Mb2tYVVJNRnFL
+R28xYXFnVlJJMHRhbHZqSDc5WnN0bnN2SjNaMmJmN3JQT0I1ZTB4TS92N3p2eDJkK1kzODhEajhY
+ZzgKdWRBRU5CZHRoS2Q0ZGl2YUFJOHhOY0R0d0RBd0ZiZ0F1QXo0cWtpalBCNVBNbGNEVjRhT0h3
+VGVMOGdXVHhVd3FXZ0RQTVljQ0Z3ZgpPaDRBVHNLMzRmOFcyMjd6eFVBOThGS1pOSThBclpwcjI0
+RWhsWDk5bVRKcWdLT0JPY0FzNEUvZ1ZlQk5kWDB4OHVYSm15VDk5Y0RmCm1tczI5YUlyWjNmZ0w3
+WGZBeHdMZENSYTdVWVc3UmtsTHo5eUpTcy9MRnp2Wk9BWDRMR0VkUFhBTWNBbzhETFFDTlNxN1NC
+RTdDaHcKa3liL3VjQTNRQy9RQmJRQmh3RjNJQUtYQU8rbEVlQklrdjZ6Z05QTDVMZXBsK09RQnRm
+UkJud050SnVibnhyW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>
+ <latex>$$A B C + A \left(B\right)^{2} - B A B - C A B$$</latex>
+ <prompt_number>31</prompt_number>
+ </output>
+ </outputs>
+ </codecell>
+ <markdowncell>
+ <source>Take the dagger</source>
+ </markdowncell>
+ <codecell>
+ <input>Dagger(_)</input>
+ <language>python</language>
+ <prompt_number>32</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>pyout</output_type>
+ <text>2
+ † † † † † † ⎛ †⎞ † † † †
+- B ⋅A ⋅B - B ⋅A ⋅C + ⎝B ⎠ ⋅A + C ⋅B ⋅A</text>
+ <png>aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQVd3QUFBQWFDQVlBQUFDVGsyYlJBQUFBQkhOQ1NWUUlD
+QWdJZkFoa2lBQUFCd1pKUkVGVQplSnp0blhtSVZWVVl3SDh6NHpLbUpZV2FXMlhtVXBKbVdZcWhF
+bEdSTFdwa0N5MDZ4UmoxUndXYWxRU2xMWnFwYmYrMENiYUlCZGtDCnRraUxtVVVGWlNsYUZsbVVS
+WVlsV0VHN1RuOTg5ekhYTy9lK2Q5Wjc1MDduQjQ4Mzk1eHp6M2UrNzV6djNIUFA4Z1lDZ1VBZ0VG
+Q2sKRWRnVVpIaW43RFlvMnI1ZGdjVkFuYVA4VlBRNUZ6ak5rVHhUaXJhN0NiN0xYSmd2ZGZJc1ZJ
+Vy9nTitERE8rVTNRWkYycmNCZUJSWQpBTFE0eWxORm56WEFhbUFuOEdsSy9DamdyRmphdERTMnRQ
+ZDJuWWJ2TWhmbVMvV2VoYXJRQXJ3VFpIaW43RFlvMHI2emdQZUFyeDNtCnFhclBQT0E1b0hzaWZB
+SndLckFFZUFsNEE1anNzSHdWMm51N1RzTjNtUXZ6SlZldmQ2YXNBNzVGUnZxOWdNK0FPVUdHYzhw
+dWd5THQKMndQcHJNY0NmenJLVTFlZlc1RlI5bU94c0tlaWNqMFVYVDhDREFaT2QxUkdrM0syQjN5
+WHVleSt0QjlkZ1lFWm53RzBI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ZERlNU40dHQzVkZDeGU1N3QKcEt5K1pFMy9TUEQ4alBpWnlKeE5OZU9vc0lMc1Vl
+cjhxQXltUDRDVGx3NDJsTjNPYXhFbjZaVVJmekl5Q21uSWlIZUZUb2RkaC96WQowcFNVT0ovMVVS
+L2RON1pXUWtWOCtvNHFxbmJQbzUyVTNaZXNhSTRFbjVFSTd3dk1SbFpabHlPbngweG9CTzVHVm82
+enVERXFRNU9oCkROODZ1S0RzZG01RWRqaHNSanFpeXNoeEJMTHdNNWQ4VG96cWROZ2dIY05DMnBi
+TlozMU1wWFdQc0ExNStJNHFxbmJQbzUyVXpwZGMKT01aczVNVFZRR1RmNmg1azVSTmtoSEFBOGpP
+UWE0RlhER1djRDl5RC9MSldDN0kvOGJKWS9ERGdjV1NlcVFINEEvbDV3dWxSZWRxRApEclowQkR0
+WDZBcWNoMnluR28wc3FHMURIRFN2LzI2aU9vZWRSUm5hRE9SWHA2cm8yTjFYTytsSXZoUUkvQys0
+QXpuRUVNaVhZUGRBCklCQUlCQUtCUUNBUUNBUUNnVUFnRUFnRUFvRkFJQkFvaXY4QUxKRDhNYVAw
+U3pRQUFBQUFTVVZPUks1Q1lJST0K
+</png>
+ <latex>$$- B^{\dagger} A^{\dagger} B^{\dagger} - B^{\dagger} A^{\dagger} C^{\dagger} + \left(B^{\dagger}\right)^{2} A^{\dagger} + C^{\dagger} B^{\dagger} A^{\dagger}$$</latex>
+ <prompt_number>32</prompt_number>
+ </output>
+ </outputs>
+ </codecell>
+ </cells>
+ </worksheet>
+ </worksheets>
+</notebook>
View
1,044 docs/examples/notebooks/decompose.ipynb
@@ -1 +1,1043 @@
-{"cells":[{"cell_type":"text","text":"<h1>Gate Decomposition</h1>"},{"code":"%load_ext sympyprinting","cell_type":"code","prompt_number":1},{"code":"from sympy import sqrt, symbols, Rational\nfrom sympy import expand, Eq, Symbol, simplify, exp, sin\nfrom sympy.physics.quantum import *\nfrom sympy.physics.quantum.qubit import *\nfrom sympy.physics.quantum.gate import *\nfrom sympy.physics.quantum.grover import *\nfrom sympy.physics.quantum.qft import QFT, IQFT, Fourier\nfrom sympy.physics.quantum.circuitplot import circuit_plot","cell_type":"code","prompt_number":2},{"cell_type":"text","text":"<h2>Example 1</h2>"},{"cell_type":"text","text":"Create a symbolic controlled-Y gate"},{"code":"CY10 = CGate(1, Y(0)); CY10\n","cell_type":"code","prompt_number":3},{"cell_type":"text","text":"Decompose it into elementary gates and plot it"},{"code":"CY10.decompose()\n","cell_type":"code","prompt_number":4},{"code":"circuit_plot(CY10.decompose(), nqubits=2)","cell_type":"code","prompt_number":5},{"cell_type":"text","text":"<h2>Example 2</h2>"},{"cell_type":"text","text":"Create a controlled-Z gate"},{"code":"CZ01 = CGate(0, Z(1)); CZ01\n","cell_type":"code","prompt_number":6},{"cell_type":"text","text":"Decompose and plot it"},{"code":"CZ01.decompose()\n","cell_type":"code","prompt_number":7},{"code":"circuit_plot(CZ01.decompose(), nqubits=2)","cell_type":"code","prompt_number":8},{"cell_type":"text","text":"<h2>Example 3</h2>"},{"cell_type":"text","text":"Create a SWAP gate"},{"code":"SWAP10 = SWAP(1, 0); SWAP10\n","cell_type":"code","prompt_number":9},{"cell_type":"text","text":"Decompose and plot it"},{"code":"SWAP10.decompose()","cell_type":"code","prompt_number":10},{"code":"circuit_plot(SWAP10.decompose(), nqubits=2)","cell_type":"code","prompt_number":11},{"cell_type":"text","text":"<h2>All together now</h2>"},{"code":"gates = [CGate(1,Y(0)), CGate(0,Z(1)), SWAP(1, 0)]","cell_type":"code","prompt_number":12},{"code":"for g in gates:\n dg = g.decompose()\n display(Eq(g, dg))\n circuit_plot(g, nqubits=2)\n circuit_plot(dg, nqubits=2) ","cell_type":"code","prompt_number":13},{"code":"%notebook save decompose.ipynb","cell_type":"code","prompt_number":30},{"code":"%notebook load gate_rules.ipynb","cell_type":"code","prompt_number":53}]}
+<?xml version="1.0" encoding="utf-8"?>
+<notebook>
+ <name>decompose</name>
+ <nbformat>2</nbformat>
+ <worksheets>
+ <worksheet>
+ <cells>
+ <markdowncell>
+ <source>&lt;h1&gt;Gate Decomposition&lt;/h1&gt;</source>
+ </markdowncell>
+ <codecell>
+ <input>%load_ext sympyprinting</input>
+ <language>python</language>
+ <prompt_number>1</prompt_number>
+ <collapsed>1</collapsed>
+ <outputs />
+ </codecell>
+ <codecell>
+ <input>from sympy import sqrt, symbols, Rational
+from sympy import expand, Eq, Symbol, simplify, exp, sin
+from sympy.physics.quantum import *
+from sympy.physics.quantum.qubit import *
+from sympy.physics.quantum.gate import *
+from sympy.physics.quantum.grover import *
+from sympy.physics.quantum.qft import QFT, IQFT, Fourier
+from sympy.physics.quantum.circuitplot import circuit_plot</input>
+ <language>python</language>
+ <prompt_number>2</prompt_number>
+ <collapsed>1</collapsed>
+ <outputs />
+ </codecell>
+ <markdowncell>
+ <source>&lt;h2&gt;Example 1&lt;/h2&gt;</source>
+ </markdowncell>
+ <markdowncell>
+ <source>Create a symbolic controlled-Y gate</source>
+ </markdowncell>
+ <codecell>
+ <input>CY10 = CGate(1, Y(0)); CY10
+</input>
+ <language>python</language>
+ <prompt_number>3</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>pyout</output_type>
+ <text>C ⎛Y ⎞
+ 10⎠</text>
+ <png>aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQURjQUFBQVlDQVlBQUFCZUlXV2xBQUFBQkhOQ1NWUUlD
+QWdJZkFoa2lBQUFBeFpKUkVGVQpXSVh0MkV1b1ZsVVV3UEhmdmI2S1czYUx3Z2QxVXlTdk5BZ2ZH
+WUpwQlE1Q3doQ0NCbXJxNEtLRU5YQlEwV01XRVNJUm9oTVJIMXlwCklLSkVNR2dRUW9XSUlEMndC
+QlUxeEFpMHAybWhsWU8xUHp6MzNQUDZQck1HK1lmRHg5bDdQZlpqcmJYMytmZ2ZNeFZyOFM0K3cw
+ZDQKQzVQUmhSMFkzNEhkdGZnYWY2Zm5GTllWeUMzQlgwbm1OMnp2d05jd1J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R3NjU4VDg0UXgwVnJVL3J3bGZMajRhcm9FaCt6NzRuY2VFWDU5ZWxCCnhSV3hq
+dGxpOTFkZ0V4N0k5RzFTVWVpcVNuUlQ4bjh6bk1jdkpiSmo4RWVIZm9wMHI4YmVkYTd6WDNBWmd6
+dWJDa2Y3Z3o0QUFBQUEKU1VWT1JLNUNZSUk9Cg==
+</png>
+ <latex>$$C_{1}{\left(Y_{0}\right)}$$</latex>
+ <prompt_number>3</prompt_number>
+ </output>
+ </outputs>
+ </codecell>
+ <markdowncell>
+ <source>Decompose it into elementary gates and plot it</source>
+ </markdowncell>
+ <codecell>
+ <input>CY10.decompose()
+</input>
+ <language>python</language>
+ <prompt_number>4</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>pyout</output_type>
+ <text>S ⋅CNOT ⋅S ⋅Z
+ 0 1,0 0 0</text>
+ <png>aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUlnQUFBQWNDQVlBQUFDNlRmY0hBQUFBQkhOQ1NWUUlD
+QWdJZkFoa2lBQUFCZ2xKUkVGVQphSUh0bW4rc2xtTVl4ejl2NXpqbnRKTFRjYUlpVFVScHhQcGhO
+VkZNZGxqbE4vMWhUTm9vdEJTbG1qSVJFNlpWU0dUVFZLc0liZjA0Cjh6TmtSczJ2UDlDRXFDWDlH
+RkVuNmZqamV6L2Urenp2L2Z4NG4vZDVTL1YrdDdPejU3NnUrN3F2KzN2ZnozMWYxL1c4VUVJSkNW
+RU8KM0EzTUJ4WUN5NEJoUUF0Z2VRSjcvWUFwd0VyZ1hlQTk0RkdnSmRBYVdHVHBEZ2JXQUw4Q2pV
+YlBqeEhBRmlQZkIzd0dWUHQwV2dKagpqZTl6Z2FWbS9HRU92VCtNclIrQVZjYS92MDNieDZiZkdt
+Q0hhZXNiYzk3NUlnM2VLOGo2K1Erd0VYZ0x6V0VsOEl1UmpVcnFaSFBqCnpDU2dtZFYrUC9DTmNU
+d3VXcVBKcmdkdUJOcF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TnJvckJlNmpOcEJ2a0U3S1JOZWp6ZWxES2VyU2hpcVpGdmpTNUtnYnZvVGJMRWhyZGlq
+NVAxNkdVCnJ5MnFZRFlrdEhlNG9UMXdLMHFGejBROGJrTkJlRS8wNjYwVnFCNlJKbGZGNEQzVVpx
+RS9lc21nTDQ3N0NyUnp1S0dDYkdiZ1lSZloKbzc0aitvUlFiOG5UNUtvWXZCK3RhM2xJY0RXSC9q
+dE9La2dhZzVRUWpDcDB1bXcvMUk2VThQOUVodVN4WFFrbGxGQkNDU1dVVUVJSgp3TDl4anFTc1FZ
+cHF6UUFBQUFCSlJVNUVya0pnZ2c9PQo=
+</png>
+ <latex>$$S_{0} CNOT_{1,0} S_{0} Z_{0}$$</latex>
+ <prompt_number>4</prompt_number>
+ </output>
+ </outputs>
+ </codecell>
+ <codecell>
+ <input>circuit_plot(CY10.decompose(), nqubits=2)</input>
+ <language>python</language>
+ <prompt_number>5</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>pyout</output_type>
+ <text>&amp;lt;sympy.physics.quantum.circuitplot.CircuitPlot object at 0x2c85f10&amp;gt;</text>
+ <prompt_number>5</prompt_number>
+ </output>
+ <output>
+ <output_type>display_data</output_type>
+ <png>aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQVE4QUFBQ09DQVlBQUFBdnRJMzNBQUFBQkhOQ1NWUUlD
+QWdJZkFoa2lBQUFBQWx3U0ZsegpBQUFMRWdBQUN4SUIwdDErL0FBQUNUNUpSRUZVZUp6dDNFdElW
+SDhZeHZIMzJEQ2psZUNGTGhob0dCUkJFR0ZFRUZtTFNNelNMTHU0CmtHaFRVRkl0dWkyc0lJcWlG
+a0VVRmFVdXdxZzJicnFIMVNLNi9CZWhkTEVMMnQwd0tteTZwL2IrZDVIbHFQTjY5TXlNM3cvTTVw
+d3oKUDU3ZmVlTnBqb002cWhvVWtVUUJnREE0cXFwZWh3QVFmZUs4RGdBZ09sRWVBRXdvRHdBbWxB
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&lt;/h2&gt;</source>
+ </markdowncell>
+ <markdowncell>
+ <source>Create a controlled-Z gate</source>
+ </markdowncell>
+ <codecell>
+ <input>CZ01 = CGate(0, Z(1)); CZ01
+</input>
+ <language>python</language>
+ <prompt_number>6</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>pyout</output_type>
+ <text>C ⎛Z ⎞
+ 01⎠</text>
+ <png>aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQURrQUFBQVlDQVlBQUFCQTZGVVdBQUFBQkhOQ1NWUUlD
+QWdJZkFoa2lBQUFBMUpKUkVGVQpXSVh0MkZ1SVZXVVV3UEhmTk9NTVhaalIwcHA1cUxCb3hxZ0gw
+NHJJUUVub01rUVFYWVRvWXNKa1JCRkVwQlVSQlltOUdkUkRQaVF5ClVFUXZSWlFpaEQ1MEU4RXVV
+RVpCV2c5Tzl3dFptV1Qxc1BiT2MvYnN2YzkzenB5SEh1WVArMkYvYTUyMTl0cmZXdXRiK3pDTFVk
+eVAKbC9FMmR1QUZMRVFQdG1LNEMzNG04RTkyL1lyM3NUMjczc3pXZjhaZ0YzejlSeS9XNHlEdXhq
+a05zdE94QzF2d2FSczI1K0syQ3RucgorQUtYbHNpMjRnaFcxdGkrcjQzbkFHZmdYUnpBb2dxZEpl
+THRQcE5vY3hDVEdDcVJuWUQ5RmJMSE16K3JXOWkvQms4bVBvcys3TTZjCmpyVFEvUWJYSmRyZGdz
+VVZzbXZ4VU1uNmFoSGdFNGsrWHNLYUZNVU5tZUZiRW5UZkVpbllpc1Y0clVaK3ZlbTd1RktrNkdT
+Qy9aeGgKZklJNWRVb1g0Q2creG5FSlJsY2xPbjlScEZNcTU0c21zeFA5YmZ3T051SEdPb1ZIeEM1
+T3RHbTRqajU4TDcwcmp1QXI3TU84RHZ6ZApKYnB4SmR0RWtFczdNRjdGTW55WXFIc1M5b3BhWDlp
+aHZ4VTRWS2Z3bzBqWDR4T01qU1k2dlJWdkpPajFabnEvNGFLQzdFS2NsdWh2ClJHelUvTWJGeHRy
+N1V0VENIeTBNTGNBZGlVNkhNNXV0ZUJaWDRtYnNLY2pXNFpkRWYxTmltRGl6Y2JFeHlGMDRXWnlU
+ZGR3akNqeG4KbVJnY0hzRERCZDErVVpkMXJNTmFNVm05V3BDZExTYXJ3OW45SER5UHMycnNIUktw
+WDhvbG1iSDFOUWJXWmxmT0FqSDE5R2IzbTdLSAp6WmxRWDVPcjhEZWVMcEgxaWJQdjl1eCtqVGd6
+LzFJOXBBeUtkRDIzeHFlcjhEdnUxVnliWTlpSThZTCtZOWpjY0grNU9LdHl4ak43ClBTVytMaE12
+OVJYTkdkV1hCYkZOQkhSSzRYZUhWUWQ1c1FpeTZmd3VwdEoyTEJkdmVJZW96eWw4anVmRUpOVElJ
+czN6NjBIeEZnZncKcHhnUCswV05IR2pRNjgrQ0d4Q2Q5SjFzZlVpa2FINmc3OFFQRlFHVk1ZYVBG
+UHBBV2Izc01iMzRxNWd2ZGlvbmIxcEQrQlkvaVRGeApUSE9RUnhRNllKZklNNkNKbE1tbWp2MGlQ
+WEpPZE95ektHY3picGlobnhUNmNMVm9URTNNTk1pOU9MWGhmaGhmaTUzS21SUUR4dklaCittckZn
+M2dQbjNYYjhCTE5xZjBVSGkzUlc1cnBEWFRCWjFuakdjVUhLa3FndDJ5eERhWXl3MWZnUExHckd6
+VHZaSzYzRHplSmZ4ZzYKWVZ4OGZxMFE1K0JjeDQ2bmpiaFRqSVRUS0d2dG5kQWpPbUl4dUNKNTEr
+MkVlWm96NFNpKzY0TGRXV2I1UC9Fdk4yS243REZxRG5vQQpBQUFBU1VWT1JLNUNZSUk9Cg==
+</png>
+ <latex>$$C_{0}{\left(Z_{1}\right)}$$</latex>
+ <prompt_number>6</prompt_number>
+ </output>
+ </outputs>
+ </codecell>
+ <markdowncell>
+ <source>Decompose and plot it</source>
+ </markdowncell>
+ <codecell>
+ <input>CZ01.decompose()
+</input>
+ <language>python</language>
+ <prompt_number>7</prompt_number>
+ <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U3gzeUpjNU9obUFqUDRlY0tx
+dnZqKzZQVnRFOXZXbHg4bkF6M1FFWmpiVzRUNTdaeUFqK1hkNVh4Ukl0cUVvUHc0WnRIaldXMlNu
+Ckk2L2tYNncvb1B3NEN0ZDhRWkZzNGEzQ0RISUwyMUFhTlFTbFFkNXQxbFhBeDNTODhCUjBibFFS
+ajczQXBlakhpbWRRaXJZU2VNakkKRnFCZDZsRnErdnNKM2E2MW9KemF4bE5vSWRsWWpZdzdGYm50
+cGNEenlPVk9Kanh6cUtEalI1MW1kSU5YamR4ckl3cVlBTTR5NzNEUQo5K3dPb284d0Y4VzJSYUtF
+cmRpamxlbmtCb3pyVUFBYVJUSG5LM1NIcDNTZTdlU21hZjFRQnRIbFNBMWVPRnVBa3dKMWc5Rngx
+T1ZJCkRWNDRCMUJnZWE3NTdtVU9qZWI3TUhKdkNZOFlycnYwZkJtS2dvY2FkTlczRy8yaUZPZXk1
+V2hnTmdvOEcxRnVmejJLNmtHLy9kZVEKL2NlTFlzNVhxTzZrN29UN29CVEx6eDZ5SSsvdVFDblow
+VHBvam05QWY1endLT1o4cGJib0F0eDBwQWVRY3Zpb1JwY2tLZDJFcE9LawpsSlNVbEpTVWxHN01m
+MjBkWGlkUDdJV25BQUFBQUVsRlRrU3VRbUNDCg==
+</png>
+ <latex>$$H_{1} CNOT_{0,1} H_{1}$$</latex>
+ <prompt_number>7</prompt_number>
+ </output>
+ </outputs>
+ </codecell>
+ <codecell>
+ <input>circuit_plot(CZ01.decompose(), nqubits=2)</input>
+ <language>python</language>
+ <prompt_number>8</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>pyout</output_type>
+ <text>&amp;lt;sympy.physics.quantum.circuitplot.CircuitPlot object at 0x472d550&amp;gt;</text>
+ <prompt_number>8</prompt_number>
+ </output>
+ <output>
+ <output_type>display_data</output_type>
+ <png>aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQU5jQUFBQ09DQVlBQUFDaS9KMkt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aR3BxNnRmNy9INi9QSC8rWElMQm9JdVRaUytPaFI1eCtmSmxxYTJ0bGR6YwpYTW5MeTVQ
+OC9IeUpSQ0tFNVNLK29lRXgwV2hVb3RHb0JJTkJ5Y25KY1h1Y3JFWmNnQkdPaFlBUjRnS01FQmRn
+aExnQUk4UUZHQ0V1CndBaHhBVWFJQ3pCQ1hJQVI0Z0tNRUJkZ2hMZ0FJOFFGR0NFdXdBaHhBVWFJ
+Q3pCQ1hJQVI0Z0tNRUJkZ2hMZ0FJOFFGR0NFdXdBaHgKQVVhSUN6QkNYSUFSNGdLTUVCZGdoTGdB
+SThRRkdDRXV3QWh4QVVhSUN6QkNYSUFSNGdLTUVCZGdoTGdBSThRRkdDRXV3QWh4QVVhSQpDekJD
+WElBUjRnS00vQXZuK01DMi9PUDM1Z0FBQUFCSlJVNUVya0pnZ2c9PQo=
+</png>
+ </output>
+ </outputs>
+ </codecell>
+ <markdowncell>
+ <source>&lt;h2&gt;Example 3&lt;/h2&gt;</source>
+ </markdowncell>
+ <markdowncell>
+ <source>Create a SWAP gate</source>
+ </markdowncell>
+ <codecell>
+ <input>SWAP10 = SWAP(1, 0); SWAP10
+</input>
+ <language>python</language>
+ <prompt_number>9</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>pyout</output_type>
+ <text>SWAP
+ 1,0</text>
+ <png>aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUU4QUFBQWNDQVlBQUFBZ0x1TGZBQUFBQkhOQ1NWUUlD
+QWdJZkFoa2lBQUFCRGRKUkVGVQphSUh0Mkh1SVYxVVFCL0NQN3VyNjNEUnJlLzBSdUVUMlFIcFEw
+c08wc2toSndoSktvaWlWSUFpRHBEQXF3WXdzaWg1WTlLU283RVZHClVWRXJiaVhhd3lpa0NJMG9r
+dktQeU5JMHJWeGJzei9tL05pNzEvdjcvVzQrU25TL2NEbm56Snd6TTJmdXVUTnpMajNZSTJqRURD
+ekEKUzNnZDB6QVE3NkF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4VXlTd2FzNDdL
+N1ZMNnVqb2c4ZEVEVnN2QVJIaGE1S29ISTRVKzh6N3dIaHhrbG9MQkxTSXVpenZIT0l6CjZkQlYx
+MlZ4blRpdHkxVXZ5TE9ZSnBKVkVTNVZmSE9vb0YzWTMxeEQvbFJSY0hjS3A5UkRnMGhVaDZUeGRE
+eFZOUEVlVVpzdHhMRVoKK25DeCtabFZGTFFsQlkwRnZDbGl3Nk1MZUhsY0lPSnFReFgrdVVuV3ZB
+SmVNMzRYMmIwTXRpam52RXZ3VVdiY0lrN2RnUHpFNTNDZwpPRjJMeFlscUV4ZnlmT3JQNGdtY1g0
+VTNKc210aFpQRVM2dVVSY3QxZnhIOThiNElBZHZ4V3hxUFRNOHlyRW04VGZoQWxEbTFVTlo1CnQ5
+anhwdFVwQ3ZIOUZtV2RkNys0M1dTeFNmcXhVQ1lPN2M5WWJjZHIzZ0RwV3RyanZOcFlJZUpjQlMy
+aUlsanovNWl6ZDZEb3N4MkoKdzNPMFFlTFhYQ1ZCWElHWEs4eHFtVzFmeFFUeEYzdXNjTXdRZkpG
+NDgzR1o3Z2x1cXpobDE0Z2IwaW5pbHJUaFA3RjJMOE5RVVdSWApub016dkFaY1hXTnRVNTVRVkp2
+dHkvaTFCbStiMnY3bzJNMjI3Rk9ZS0s1ZlBkZ0o3RzlmWVE5NjBJTWUvQ3Y4QTk3RzZZNFE3TUxv
+CkFBQUFBRWxGVGtTdVFtQ0MK
+</png>
+ <latex>$$SWAP_{1,0}$$</latex>
+ <prompt_number>9</prompt_number>
+ </output>
+ </outputs>
+ </codecell>
+ <markdowncell>
+ <source>Decompose and plot it</source>
+ </markdowncell>
+ <codecell>
+ <input>SWAP10.decompose()</input>
+ <language>python</language>
+ <prompt_number>10</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>pyout</output_type>
+ <text>CNOT ⋅CNOT ⋅CNOT
+ 1,0 0,1 1,0</text>
+ <png>aVZCT1J3MEtHZ29BQUFBTlNV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qQzY5Q3BUNU5nS0JoL1JkZ0UzR09kemdMOUhyRVdISHJYMDMwZlhlaWYzMlBKNWNpSkUrcEZa
+c1V3ejhPTkJhc3ZCSVBUK2p5U3AKMnNZYjBzMTI0RmpqdkJWNTZpTVVRdS8vU0pLcWJid2hoN2dV
+MlFRQWVUUGhFc04ySmVtN2JQVkdWdjlOclNMWmVJOHQreFdUZXFhRQpQSkV4SDNudnJqd1o3VUhF
+NmdGK1F3VHJSZDVPT0FNNEY5bkZXMGxscUZIUHBQWGYxaXBOMTFDSVk2dEdXcTFQaTJGclFyYWdU
+UnFSCmQvbENKYW4vdGxacHVvWkNJV01ydE1HMk44VjJETVBmYWJQZmlRdU5wUDdiV3FYcEdncHhi
+QlhNSXVLYTJwZW9WWFZFdldvZ3RHZ2gKRDFHcjZvaDZSU0tSU0NRU2lVUWlrVWlrY1A0RGNJbU5W
+d2I2YnpNQUFBQUFTVVZPUks1Q1lJST0K
+</png>
+ <latex>$$CNOT_{1,0} CNOT_{0,1} CNOT_{1,0}$$</latex>
+ <prompt_number>10</prompt_number>
+ </output>
+ </outputs>
+ </codecell>
+ <codecell>
+ <input>circuit_plot(SWAP10.decompose(), nqubits=2)</input>
+ <language>python</language>
+ <prompt_number>11</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>pyout</output_type>
+ <text>&amp;lt;sympy.physics.quantum.circuitplot.CircuitPlot object at 0x7f082c973650&amp;gt;</text>
+ <prompt_number>11</prompt_number>
+ </output>
+ <output>
+ <output_type>display_data</output_type>
+ <png>aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQU5jQUFBQ09DQVlBQUFDaS9KMktBQUFBQkhOQ1NWUUlD
+QWdJZkFoa2lBQUFBQWx3U0ZsegpBQUFMRWdBQUN4SUIwdDErL0FBQUNybEpSRUZVZUp6dDNXdG9V
+L2NmeC9GUC9rNU1VN3ZXU3kvTzBWUkJXcEZONnh5dVExMTNZVk9xCmlBVzEwd2RqVHF3R0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TEphKzg4b29zWDc1
+YzNHNTN2K1BlOXUrYmI3NlJNV1BHeU45Ly94MktFUjlMeE1ZbGN2OGZmTlNvVVZKUlVTRXVsK3ZC
+OHc5dgpUazlQait6YXRVdFNVbEpreDQ0ZFJveEpYdHk2ZFV1eXM3Tmw5dXpaL1g0ditQRCsvZjc3
+NzJLejJXVGN1SEZ5NmRLbFVJL3BWMFRICkpTSlNXMXNyYjd6eGhpUWxKVWxCUVlGVVZWVUpBS21x
+cXBKMTY5WkpZbUtpdlBubW0xSmZYMi8wcVBRdkxwZExQdjMwVTNuMjJXZmwKNVpkZmx1TGlZamwr
+L0xnQWtJcUtDcGt6WjQ2TUdERkMxcXhaSXpkdjNqUjYzSDRpOGoyWE54Y3ZYa1J4Y1RGYVcxdHg5
+T2hSNU9UawpZUHo0OFZpMmJCbkdqUnRuOUhqa2g5dnR4cEVqUjFCWldRbUh3NEc2dWpyazV1WWlK
+eWNIZVhsNXNGZ3NSby9vVmRURVJSUnFFZmM5CkY5R1RnbkVSS1dGY1JFb1lGNUVTeGtXa2hIRVJL
+V0ZjUkVvWUY1RVN4a1draEhFUktXRmNSRW9ZRjVFU3hrV2toSEVSS1dGY1JFb1kKRjVFU3hrV2to
+SEVSS1dGY1JFb1lGNUVTeGtXa2hIRVJLV0ZjUkVvWUY1RVN4a1draEhFUktXRmNSRW9ZRjVFU3hr
+V2toSEVSS1dGYwpSRW9ZRjVFU3hrV2toSEVSS1dGY1JFb1lGNUVTeGtXazVQOENrR2JYaWgwNml3
+QUFBQUJKUlU1RXJrSmdnZz09Cg==
+</png>
+ </output>
+ </outputs>
+ </codecell>
+ <markdowncell>
+ <source>&lt;h2&gt;All together now&lt;/h2&gt;</source>
+ </markdowncell>
+ <codecell>
+ <input>gates = [CGate(1,Y(0)), CGate(0,Z(1)), SWAP(1, 0)]</input>
+ <language>python</language>
+ <prompt_number>12</prompt_number>
+ <collapsed>1</collapsed>
+ <outputs />
+ </codecell>
+ <codecell>
+ <input>for g in gates:
+ dg = g.decompose()
+ display(Eq(g, dg))
+ circuit_plot(g, nqubits=2)
+ circuit_plot(dg, nqubits=2) </input>
+ <language>python</language>
+ <prompt_number>16</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>display_data</output_type>
+ <text>C ⎛Y ⎞ = S ⋅CNOT ⋅S ⋅Z
+ 100 1,0 0 0</text>
+ <png>aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQU5NQUFBQWNDQVlBQUFEN3VZcTRBQUFBQkhOQ1NWUUlD
+QWdJZkFoa2lBQUFDQzlKUkVGVQplSnp0bkhtc0ZkVWR4ei8zdmVjVFJCRnhBVGRjb0tMR0Jka2lv
+czgxaWhhSk5rWU1Td1hYaWx1ck5aUmFVdmNGMTZqRUpSVTFiS1pvCkxKcFd4QzVVQlJWY1VJdTdn
+bHFyYUlOMXhZcjQvT043Sm5mZXVYTm16cDE3N3NXVytTU1R4NTF6NWpmbmZ1Y3N2OS92ekFVS0Nn
+b2EKd2k3QWVjQWNZQ0V3SDVnRjdBU1VnSHVBbmpuc25nZThETFNiNDUvQWxJUjZvNEh2VEowdmdi
+dHozS3ZlOUFkdUFtWUM5NXUvV3dHagpnTk55Mk11aitWemdPYVRURjBBM3E3d3I4QXl3eHRUNUFE
+Zzc0ZDVEZ0JuQWJHQ2F1ZmVkd0xaV3ZVdU5uYStBSjRGNXdEdm0zRXB6CjNhUEFTK2Jjbi95K2V0
+V0UwbjRTNWI3NEtkSnFuamtlcDZ4WlM1NUdOZ08vQXY0RlRBQitGQ3ZiSGxnQTNBVzhXb1hOYnNC
+UHJYTnoKVFVOSHBGejNCK0JhWUlPRXNuT0FwaXJhRUpwaHdGS2dkK3pjdHNCZmdmOEN1MVpocTFi
+Tmh3SXZJajEvN3FoemxUbHNOZ0wrQ1B3RgoyQzUydm9RRzlpZkFRYkh6cndQalRKc2pvZ0UyekxK
+OUdYQzdvejIxRUZMN3A0RmxRRC9yZkRQd0VKcklCK1pwWkM4MDI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
-{"cells":[{"cell_type":"text","text":"<h1>Dense Coding\n</h1>"},{"code":"%load_ext sympy_printing","cell_type":"code","prompt_number":1},{"code":"from sympy import sqrt, symbols, Rational\nfrom sympy import expand, Eq, Symbol, simplify, exp, sin\nfrom sympy.physics.quantum import *\nfrom sympy.physics.quantum.qubit import *\nfrom sympy.physics.quantum.gate import *\nfrom sympy.physics.quantum.grover import *\nfrom sympy.physics.quantum.qft import QFT, IQFT, Fourier\nfrom sympy.physics.quantum.circuitplot import circuit_plot","cell_type":"code","prompt_number":2},{"code":"psi = Qubit('00')/sqrt(2) + Qubit('11')/sqrt(2); psi\n","cell_type":"code","prompt_number":3},{"code":"circuits = [H(1)*CNOT(1,0), H(1)*CNOT(1,0)*X(1), H(1)*CNOT(1,0)*Z(1), H(1)*CNOT(1,0)*Z(1)*X(1)]","cell_type":"code","prompt_number":4},{"code":"for circuit in circuits:\n circuit_plot(circuit, nqubits=2)\n display(Eq(circuit*psi,qapply(circuit*psi)))","cell_type":"code","prompt_number":5},{"code":"%notebook save dense_coding.ipynb","cell_type":"code","prompt_number":28},{"code":"%notebook load teleportation.ipynb","cell_type":"code","prompt_number":181}]}
+<?xml version="1.0" encoding="utf-8"?>
+<notebook>
+ <name>dense_coding</name>
+ <nbformat>2</nbformat>
+ <worksheets>
+ <worksheet>
+ <cells>
+ <markdowncell>
+ <source>&lt;h1&gt;Dense Coding
+&lt;/h1&gt;</source>
+ </markdowncell>
+ <codecell>
+ <input>%load_ext sympyprinting</input>
+ <language>python</language>
+ <prompt_number>2</prompt_number>
+ <collapsed>1</collapsed>
+ <outputs />
+ </codecell>
+ <codecell>
+ <input>from sympy import sqrt, symbols, Rational
+from sympy import expand, Eq, Symbol, simplify, exp, sin
+from sympy.physics.quantum import *
+from sympy.physics.quantum.qubit import *
+from sympy.physics.quantum.gate import *
+from sympy.physics.quantum.grover import *
+from sympy.physics.quantum.qft import QFT, IQFT, Fourier
+from sympy.physics.quantum.circuitplot import circuit_plot</input>
+ <language>python</language>
+ <prompt_number>3</prompt_number>
+ <collapsed>1</collapsed>
+ <outputs />
+ </codecell>
+ <codecell>
+ <input>psi = Qubit('00')/sqrt(2) + Qubit('11')/sqrt(2); psi
+</input>
+ <language>python</language>
+ <prompt_number>4</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>pyout</output_type>
+ <text>⎽⎽⎽ ⎽⎽⎽
+╲╱ 2 ⋅❘00⟩ ╲╱ 2 ⋅❘11
+────────── + ──────────
+ 2 2</text>
+ <png>aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUx3QUFBQWtDQVlBQUFBemZGQ0ZBQUFBQkhOQ1NWUUlD
+QWdJZkFoa2lBQUFCWlJKUkVGVQplSnp0bTN1b0ZVVWN4ei9uZHRLajFkVWUxc2x1NlI5WkJua3ZV
+WlJhNlNraktId2tGR1lVeHVWaTlsRENJTXNvYmxGSlJDLzZKeW1vCnVFSVlScEhSU3dLTmdpQUp1
+bVQvRk1TbGgwVVBVSzVrcVp6KytPMXlkL2ZNUG1aM1ovZWMwM3hnT1p5WjMrek03bmQyWm42LzJR
+V0wKeFdLeGRDZVZzaHNRUXpPSGM3VDdOWFlxWndFLzVYQ2V0dFZuRmxBcnVNNGR3Q2tGMTltSldH
+MFMwcFBBcGcrNEJkZ0wxTTAyeDhkRgp3Qmp3VjRGMWRocFdHd05jQnd3Z3k0dlpCZGE3RFprMkxl
+RlliVFNwSnJENXdIZ3JXamtQT0FUOFhFTGRuWVRWeGlCRmppSXZBM01LCnFxc2JzTm9rSk1rYXZt
+ak9SaHl3NzhwdVNBeHJ5bTVBQ1hTS05oQ2lUNUlsVGRIY0J6d1RrZDhQRENFTzI1ZkF1OEEraGQy
+QTgvdDEKSVAwMjRGTEU0ZG9QdkFYOHJpZ2ZaM2M4RWgwWmkyaHJ0eEduRFdUWHgrVUtZQkh3WkV4
+OVlYYVo5U2xpMnB5QmhMdkNXQTY4QTF5TQpSQ1cyQUg4REt4UzJEZWZ3O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left|11\right\rangle }$$</latex>
+ <prompt_number>4</prompt_number>
+ </output>
+ </outputs>
+ </codecell>
+ <codecell>
+ <input>circuits = [H(1)*CNOT(1,0), H(1)*CNOT(1,0)*X(1), H(1)*CNOT(1,0)*Z(1), H(1)*CNOT(1,0)*Z(1)*X(1)]</input>
+ <language>python</language>
+ <prompt_number>5</prompt_number>
+ <collapsed>1</collapsed>
+ <outputs />
+ </codecell>
+ <codecell>
+ <input>for circuit in circuits:
+ circuit_plot(circuit, nqubits=2)
+ display(Eq(circuit*psi,qapply(circuit*psi)))</input>
+ <language>python</language>
+ <prompt_number>6</prompt_number>
+ <collapsed>0</collapsed>
+ <outputs>
+ <output>
+ <output_type>display_data</output_type>
+ <text>⎛ ⎽⎽⎽ ⎽⎽⎽ ⎞
+ ⎜╲╱ 2 ⋅❘00⟩ ╲╱ 2 ⋅❘11⟩⎟
+H ⋅CNOT ⋅⎜────────── + ──────────⎟ = ❘00
+ 1 1,02 2 ⎠</text>
+ <png>aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQVdVQUFBQW1DQVlBQUFBY1Bvck5BQUFBQkhOQ1NWUUlD
+QWdJZkFoa2lBQUFESDlKUkVGVQplSnp0blh1MEZWVWR4ei8zQWhmaUlWZEpGRlF3VVRSSVVhTTBJ
+YTRQYUdtWnBsbGsrVWd5OUlMWnc5VUNuNVhTUXpPU1FJMjBSTHhHCnFZdlZhNEd2MHBKOHhTTzFG
+QVVWU3hOTE5FVXlKYmo5OFoxWlo4NmNQVE43enBremN3N3N6MXBublh0bmZqUHptL250K2UyOWYv
+dTMKOXdHSHcrRndPQnhWMHdyMEtGb0poeU1IV3IzUGRzVjJkOFBiQVBPQmR4ZXRoTU9SQSs4Q2Jn
+QmFpbFlrVDF5THE3bTRHSGdhV0ZLMApJakYwQUs4Qi95MWFFVWNGeldhYlY0RWRnTW5BYnd2V3hl
+R29ZREp3UzlGS0pOQUtkR2Z3Y1dSUEszQUh6V21mQmNCcEJWelg0WWhrCk1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