Skip to content

Commit

Permalink
build based on 57d6372
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Aug 11, 2024
1 parent 32e8cfb commit 22a03d5
Show file tree
Hide file tree
Showing 25 changed files with 2,116 additions and 3 deletions.
2 changes: 1 addition & 1 deletion stable
2 changes: 1 addition & 1 deletion v0.4
1 change: 1 addition & 0 deletions v0.4.2/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-08-11T22:36:40","documenter_version":"1.5.0"}}
272 changes: 272 additions & 0 deletions v0.4.2/API/index.html

Large diffs are not rendered by default.

78 changes: 78 additions & 0 deletions v0.4.2/QHO/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Quantum Harmonic Oscillators · QuantumSymbolics.jl</title><meta name="title" content="Quantum Harmonic Oscillators · QuantumSymbolics.jl"/><meta property="og:title" content="Quantum Harmonic Oscillators · QuantumSymbolics.jl"/><meta property="twitter:title" content="Quantum Harmonic Oscillators · QuantumSymbolics.jl"/><meta name="description" content="Documentation for QuantumSymbolics.jl."/><meta property="og:description" content="Documentation for QuantumSymbolics.jl."/><meta property="twitter:description" content="Documentation for QuantumSymbolics.jl."/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><script src="../assets/init.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">QuantumSymbolics.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">QuantumSymbolics.jl</a></li><li><a class="tocitem" href="../introduction/">Getting Started with QuantumSymbolics.jl</a></li><li><a class="tocitem" href="../express/">Express Functionality</a></li><li><a class="tocitem" href="../qubit_basis/">Qubit Basis Choice</a></li><li class="is-active"><a class="tocitem" href>Quantum Harmonic Oscillators</a><ul class="internal"><li><a class="tocitem" href="#States"><span>States</span></a></li><li><a class="tocitem" href="#Operators"><span>Operators</span></a></li><li><a class="tocitem" href="#Numerical-Conversions-to-QuantumOptics.jl"><span>Numerical Conversions to QuantumOptics.jl</span></a></li></ul></li><li><a class="tocitem" href="../API/">API</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Quantum Harmonic Oscillators</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Quantum Harmonic Oscillators</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/QuantumSavory/QuantumSymbolics.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/QuantumSavory/QuantumSymbolics.jl/blob/main/docs/src/QHO.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Quantum-Harmonic-Oscillators"><a class="docs-heading-anchor" href="#Quantum-Harmonic-Oscillators">Quantum Harmonic Oscillators</a><a id="Quantum-Harmonic-Oscillators-1"></a><a class="docs-heading-anchor-permalink" href="#Quantum-Harmonic-Oscillators" title="Permalink"></a></h1><p>In this section, we describe symbolic representations of bosonic systems in QuantumSymbolics, which can be numerically translated to <a href="https://github.com/qojulia/QuantumOptics.jl"><code>QuantumOptics.jl</code></a>.</p><h2 id="States"><a class="docs-heading-anchor" href="#States">States</a><a id="States-1"></a><a class="docs-heading-anchor-permalink" href="#States" title="Permalink"></a></h2><p>A Fock state is a state with well defined number of excitation quanta of a single quantum harmonic oscillator (an eigenstate of the number operator). In the following example, we create a <code>FockState</code> with 3 quanta in an infinite-dimension Fock space:</p><pre><code class="language-julia-repl hljs">julia&gt; f = FockState(3)
|3⟩</code></pre><p>Both vacuum (ground) and single-photon states are defined as constants in both unicode and ASCII for convenience:</p><ul><li><code>vac = F₀ = F0</code> <span>$=|0\rangle$</span> in the number state representation,</li><li><code>F₁ = F1</code> <span>$=|1\rangle$</span> in the number state representation.</li></ul><p>To create quantum analogues of a classical harmonic oscillator, or monochromatic electromagnetic waves, we can define a coherent (a.k.a. semi-classical) state <span>$|\alpha\rangle$</span>, where <span>$\alpha$</span> is a complex amplitude, with <code>CoherentState(α::Number)</code>:</p><pre><code class="language-julia-repl hljs">julia&gt; c = CoherentState(im)
|im⟩</code></pre><div class="admonition is-info"><header class="admonition-header">Naming convention for quantum harmonic oscillator bases</header><div class="admonition-body"><p>The defined basis for arbitrary symbolic bosonic states is a <code>FockBasis</code> object, due to a shared naming interface for Quantum physics packages. For instance, the command <code>basis(CoherentState(im))</code> will output <code>Fock(cutoff=Inf)</code>. This may lead to confusion, as not all bosonic states are Fock states. However, this is simply a naming convention for the basis, and symbolic and numerical results are not affected by it.</p></div></div><h2 id="Operators"><a class="docs-heading-anchor" href="#Operators">Operators</a><a id="Operators-1"></a><a class="docs-heading-anchor-permalink" href="#Operators" title="Permalink"></a></h2><p>Operations on bosonic states are supported, and can be simplified with <code>qsimplify</code> and its rewriter <code>qsimplify_fock</code>. For instance, we can apply the raising (creation) <span>$\hat{a}^{\dagger}$</span> and lowering (annihilation or destroy) <span>$\hat{a}$</span> operators on a Fock state as follows:</p><pre><code class="language-julia-repl hljs">julia&gt; f = FockState(3);

julia&gt; raise = Create*f
a†|3⟩

julia&gt; qsimplify(raise, rewriter=qsimplify_fock)
(sqrt(4))|4⟩

julia&gt; lower = Destroy*f
a|3⟩

julia&gt; qsimplify(lower, rewriter=qsimplify_fock)
(sqrt(3))|2⟩</code></pre><p>Or, we can apply the number operator <span>$\hat{n}$</span> to our Fock state:</p><pre><code class="language-julia-repl hljs">julia&gt; f = FockState(3);

julia&gt; num = N*f
n|3⟩

julia&gt; qsimplify(num, rewriter=qsimplify_fock)
3|3⟩</code></pre><p>Constants are defined for number and ladder operators in unicode and ASCII:</p><ul><li><code>N = n̂</code> <span>$=\hat{n}$</span>,</li><li><code>Create = âꜛ</code> <span>$=\hat{a}^{\dagger}$</span>,</li><li><code>Destroy = â</code> <span>$=\hat{a}$</span>.</li></ul><p>Phase-shift <span>$U(\theta)$</span> and displacement <span>$D(\alpha)$</span> operators, defined respectively as <span>$U(\theta) = \exp\left(-i\theta\hat{n}\right) \quad \text{and} \quad D(\alpha) = \exp\left(\alpha\hat{a}^{\dagger} - \alpha\hat{a}\right),$</span> can be defined with usual simplification rules. Consider the following example:</p><pre><code class="language-julia-repl hljs">julia&gt; displace = DisplaceOp(im)
D(im)

julia&gt; c = qsimplify(displace*vac, rewriter=qsimplify_fock)
|im⟩

julia&gt; phase = PhaseShiftOp(pi)
U(π)

julia&gt; qsimplify(phase*c, rewriter=qsimplify_fock)
|1.2246467991473532e-16 - 1.0im⟩</code></pre><p>Here, we generated a coherent state <span>$|i\rangle$</span> from the vacuum state <span>$|0\rangle$</span> by applying the displacement operator defined by <code>DisplaceOp</code>. Then, we shifted its phase by <span>$\pi$</span> with the phase shift operator (which is called with <code>PhaseShiftOp</code>) to get the result <span>$|-i\rangle$</span>.</p><p>Summarized below are supported bosonic operators.</p><ul><li>Number operator: <code>NumberOp()</code>,</li><li>Creation operator: <code>CreateOp()</code>,</li><li>Annihilation operator: <code>DestroyOp()</code>,</li><li>Phase-shift operator: <code>PhaseShiftOp(phase::Number)</code>,</li><li>Displacement operator: <code>DisplaceOp(alpha::Number)</code>.</li></ul><h2 id="Numerical-Conversions-to-QuantumOptics.jl"><a class="docs-heading-anchor" href="#Numerical-Conversions-to-QuantumOptics.jl">Numerical Conversions to QuantumOptics.jl</a><a id="Numerical-Conversions-to-QuantumOptics.jl-1"></a><a class="docs-heading-anchor-permalink" href="#Numerical-Conversions-to-QuantumOptics.jl" title="Permalink"></a></h2><p>Bosonic systems can be translated to the ket representation with <code>express</code>. For instance:</p><pre><code class="language-julia-repl hljs">julia&gt; f = FockState(1);

julia&gt; express(f)
Ket(dim=3)
basis: Fock(cutoff=2)
0.0 + 0.0im
1.0 + 0.0im
0.0 + 0.0im

julia&gt; express(Create) |&gt; dense
Operator(dim=3x3)
basis: Fock(cutoff=2)
0.0+0.0im 0.0+0.0im 0.0+0.0im
1.0+0.0im 0.0+0.0im 0.0+0.0im
0.0+0.0im 1.41421+0.0im 0.0+0.0im

julia&gt; express(Create*f)
Ket(dim=3)
basis: Fock(cutoff=2)
0.0 + 0.0im
0.0 + 0.0im
1.4142135623730951 + 0.0im

julia&gt; express(Destroy*f)
Ket(dim=3)
basis: Fock(cutoff=2)
1.0 + 0.0im
0.0 + 0.0im
0.0 + 0.0im</code></pre><div class="admonition is-warning"><header class="admonition-header">Cutoff specifications for numerical representations of quantum harmonic oscillators</header><div class="admonition-body"><p>Symbolic bosonic states and operators are naturally represented in an infinite dimension basis. For numerical conversions of such quantum objects, a finite cutoff of the highest allowed state must be defined. By default, the basis dimension of numerical conversions is set to 3 (so the number representation cutoff is 2), as demonstrated above. To define a different cutoff, one must customize the <code>QuantumOpticsRepr</code> instance, e.g. provide <code>QuantumOpticsRepr(cutoff=n::Int)</code> to <code>express</code>.</p></div></div><p>If we wish to specify a different numerical cutoff, say 4, to the previous examples, then we rewrite them as follows:</p><pre><code class="language-julia-repl hljs">julia&gt; f = FockState(1);

julia&gt; express(f, QuantumOpticsRepr(cutoff=4))
Ket(dim=5)
basis: Fock(cutoff=4)
0.0 + 0.0im
1.0 + 0.0im
0.0 + 0.0im
0.0 + 0.0im
0.0 + 0.0im

julia&gt; express(Create, QuantumOpticsRepr(4)) |&gt; dense
Operator(dim=5x5)
basis: Fock(cutoff=4)
0.0+0.0im 0.0+0.0im 0.0+0.0im 0.0+0.0im 0.0+0.0im
1.0+0.0im 0.0+0.0im 0.0+0.0im 0.0+0.0im 0.0+0.0im
0.0+0.0im 1.41421+0.0im 0.0+0.0im 0.0+0.0im 0.0+0.0im
0.0+0.0im 0.0+0.0im 1.73205+0.0im 0.0+0.0im 0.0+0.0im
0.0+0.0im 0.0+0.0im 0.0+0.0im 2.0+0.0im 0.0+0.0im</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../qubit_basis/">« Qubit Basis Choice</a><a class="docs-footer-nextpage" href="../API/">API »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.5.0 on <span class="colophon-date" title="Sunday 11 August 2024 22:36">Sunday 11 August 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 22a03d5

Please sign in to comment.