diff options
361 files changed, 38295 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2f7e474 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/Gemfile.lock +/.bundle/* +/source/.jekyll-cache/* +/source/.jekyll-metadata +/public/* @@ -0,0 +1,15 @@ +source "https://rubygems.org" + +gem "jekyll" +gem "webrick" + +# https://github.com/rubyjs/mini_racer +gem "mini_racer" +# https://github.com/linjer/jekyll-katex +gem "jekyll-katex" +# https://github.com/toshimaru/jekyll-toc +gem "jekyll-toc" +# https://github.com/jekyll/jekyll-sitemap +gem "jekyll-sitemap" +# https://github.com/gjtorikian/jekyll-last-modified-at +gem "jekyll-last-modified-at" diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..b5df199 --- /dev/null +++ b/_config.yml @@ -0,0 +1,50 @@ +source: "./source" +destination: "./public" + +title: Prefetch +description: "Marcus R.A. Newman's personal website, mostly about physics and computing." +plugins: + - jekyll-katex + - jekyll-toc + - jekyll-sitemap + - jekyll-last-modified-at + +katex: + js_path: "/home/user/git/prefetch-jekyll/source/infra/js" + rendering_options: + macros: # Requires https://github.com/linjer/jekyll-katex/pull/34/commits + "\\Real": "\\mathop{\\mathrm{Re}}" + "\\Imag": "\\mathop{\\mathrm{Im}}" + "\\pv": "\\:\\mathop{\\mathcal{P}}" + "\\cross": "\\times" + "\\va": "\\vec{\\mathbf{#1}}" + "\\vb": "\\mathbf{#1}" + "\\vu": "\\hat{\\mathbf{#1}}" + "\\norm": "\\big\\| {#1} \\big\\|" + "\\Norm": "\\left\\| {#1} \\right\\|" + "\\Tr": "\\mathop{\\mathrm{Tr}}" + "\\dd": "\\mathop{\\mathrm{d} {#1}}" + "\\ddn": "\\mathop{\\mathrm{d}^{#1} {#2}}" + "\\dv": "\\frac{\\mathrm{d} {#1}}{\\mathrm{d} {#2}}" + "\\idv": "\\mathrm{d} {#1} / \\mathrm{d} {#2}" + "\\dvn": "\\frac{\\mathrm{d}^{#1} {#2}}{\\mathrm{d} #3^{#1}}" + "\\idvn": "\\mathrm{d}^{#1} {#2} / \\mathrm{d} #3^{#1}" + "\\pdv": "\\frac{\\partial {#1}}{\\partial {#2}}" + "\\pdvn": "\\frac{\\partial^{#1} {#2}}{\\partial #3^{#1}}" + "\\ipdv": "\\partial {#1} / \\partial {#2}" + "\\ipdvn": "\\partial^{#1} {#2} / \\partial #3^{#1}" + "\\mpdv": "\\frac{\\partial^2 {#1}}{\\partial {#2} \\partial {#3}}" + "\\expval": "\\braket{{#1}}" + "\\Expval": "\\left\\langle{#1}\\right\\rangle" # "\\Braket{{#1}}" fails if {#1} contains '|' + "\\inprod": "\\braket{{#1} | {#2}}" + "\\Inprod": "\\Braket{{#1} | {#2}}" + "\\exprod": "\\ket{{#1}} \\bra{{#2}}" + "\\Exprod": "\\Ket{{#1}} \\Bra{{#2}}" + "\\matrixel": "\\braket{{#1} | {#2} | {#3}}" + "\\Matrixel": "\\Braket{{#1} | {#2} | {#3}}" + "\\comm": "\\big[ {#1}, {#2} \\big]" + "\\Comm": "\\left[ {#1}, {#2} \\right]" + "\\acomm": "\\big\\{ {#1}, {#2} \\big\\}" + "\\Acomm": "\\left\\{ {#1}, {#2} \\right\\}" + "\\sech": "\\mathop{\\mathrm{sech}}" + diff --git a/source/_includes/footer.html b/source/_includes/footer.html new file mode 100644 index 0000000..8a11b00 --- /dev/null +++ b/source/_includes/footer.html @@ -0,0 +1,8 @@ +<hr> +<div class="footl noha"> +© Marcus R.A. Newman, +<a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>. +</div> +<div class="footr noha"> +Privacy-friendly statistics by <a href="https://www.goatcounter.com/">GoatCounter</a>. +</div> diff --git a/source/_includes/navigation.html b/source/_includes/navigation.html new file mode 100644 index 0000000..a5c835c --- /dev/null +++ b/source/_includes/navigation.html @@ -0,0 +1,9 @@ +<div class="nav noha"> +<div class="navl"><a href="/">PREFETCH</a></div> +<div class="navr"> +<a href="/blog/">blog</a>  +<a href="/code/">code</a>  +<a href="/know/">know</a> +</div> +</div> +<hr> diff --git a/source/_includes/preamble.html b/source/_includes/preamble.html new file mode 100644 index 0000000..312f1cf --- /dev/null +++ b/source/_includes/preamble.html @@ -0,0 +1,9 @@ +<meta charset="utf-8"> +{% if page.layout == "blog" or page.syntax %} +<link rel="stylesheet" href="/infra/css/syntax.css?v=20221008"> +{% endif %} +{% if page.layout == "concept" or page.maths %} +<link rel="stylesheet" href="/infra/css/katex.min.css?v=20221008"> +{% endif %} +<link rel="stylesheet" href="/infra/css/main.css?v=20221001"> +<script data-goatcounter="https://prefetch.goatcounter.com/count" async src="https://gc.zgo.at/count.js"></script> diff --git a/source/_layouts/blog.html b/source/_layouts/blog.html new file mode 100644 index 0000000..4049297 --- /dev/null +++ b/source/_layouts/blog.html @@ -0,0 +1,8 @@ +--- +layout: "default" +--- + +<h1>{{ page.title }}</h1> + +{{ content | toc_only }} +{{ content | inject_anchors }} diff --git a/source/_layouts/category.html b/source/_layouts/category.html new file mode 100644 index 0000000..8393bd6 --- /dev/null +++ b/source/_layouts/category.html @@ -0,0 +1,34 @@ +--- +layout: "default" +--- + +<h1>{{ page.title }}</h1> + +{% assign by_letter = site.pages + | where_exp: "item", "item.layout == 'concept'" + | where_exp: "item", "item.categories contains page.title" + | group_by_exp: "item", "item.title | truncate: 1, ''" + | sort: "name" +%} + +<p> +This is an alphabetical list of the concepts in this category. +</p> + +<div style="text-align: center;"> +‐ +{% for letter in by_letter %} +<a href="#{{ letter.name }}">{{ letter.name }}</a> +‐ +{% endfor %} +</div> + +{% for letter in by_letter %} +<h2 id="{{ letter.name }}">{{ letter.name }}</h2> +<ul> + {% assign items = letter.items | sort: "title" %} + {% for item in items %} + <li><a href="{{ item.url }}">{{ item.title }}</a></li> + {% endfor %} +</ul> +{% endfor %} diff --git a/source/_layouts/concept.html b/source/_layouts/concept.html new file mode 100644 index 0000000..7a0849c --- /dev/null +++ b/source/_layouts/concept.html @@ -0,0 +1,21 @@ +--- +layout: "default" +--- + +<p> +{% assign categories = page.categories | sort %} +Categories: +{% for category in categories %} +{% assign url = category | slugify %} +<a href="/know/category/{{ url }}">{{ category }}</a>{% if forloop.last == false %},{% endif %}{% endfor %}. +</p> + +<h1>{{ page.title }}</h1> + +{% capture markdown_after_katex %} +{% katexmm %} +{{ page.content }} +{% endkatexmm %} +{% endcapture %} + +{{ markdown_after_katex | markdownify }} diff --git a/source/_layouts/default.html b/source/_layouts/default.html new file mode 100644 index 0000000..2f1cac2 --- /dev/null +++ b/source/_layouts/default.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> +<head> +{% include preamble.html %} +<title>{{ page.title }} | {{ site.title }}</title> +</head> +<body> +{% include navigation.html %} +{{ content }} +{% include footer.html %} +</body> +</html> diff --git a/source/blog/2020/email-server-extras/index.md b/source/blog/2020/email-server-extras/index.md new file mode 100644 index 0000000..b19819b --- /dev/null +++ b/source/blog/2020/email-server-extras/index.md @@ -0,0 +1,431 @@ +--- +title: "Setting up an email server in 2020 with OpenSMTPD and Dovecot: extras" +date: 2020-04-28 +layout: "blog" +toc: true +--- + +This sequel to my post +"[Setting up an email server in 2020 with OpenSMTPD and Dovecot](/blog/2020/email-server/)" +gives extra tips and tricks to extend your email setup. +See also the sequel's sequel, +"[Revisiting my email server in 2022](/blog/2022/email-server-revisited/)". + +Last updated on 2022-09-12. + + +## General + +### Multiple domains + +You can generalize your setup to handle multiple domains +with very little effort. In the following, +I'll assume that your two domains are called `foo.com` and `bar.com`. + + +#### DNS records + +There should be MX, SPF, DKIM and DMARC records for both domains, +as explained in the previous guide. Fortunately, these records +can have identical contents for both domains! + +However, it remains essential that the mail server's mailname +and reverse DNS domain name match up exactly, +so you should create MX records with that in mind. +Therefore, if the email server for both domains has `mx1.foo.com` +as reverse DNS name, the MX records should look like this: +```sh +foo.com. MX 42 mx1.foo.com. +bar.com. MX 42 mx1.foo.com. +``` +This is perfectly valid: the only thing that matters is that +what your SMTP server calls itself agrees with what reverse DNS +says that the server is actually called. + + +#### Dovecot + +To make Dovecot aware of multiple domains, +you only need to update the `/etc/dovecot/users` file +to add accounts for both domains. +However, in the original guide, I said to only write `user` +in the file, without the `@foo.com`, for an address `user@foo.com`. +Unsurprisingly, that isn't an option for multiple domains, +so you must put the full address in `/etc/dovecot/users`. + +Then update `/etc/dovecot/dovecot.conf` to reflect that, +by changing `%n` to `%u` in `username_format`: +```sh +userdb { + driver = passwd-file + args = username_format=%u /etc/dovecot/users + override_fields = uid=vmail gid=vmail home=/home/vmail/%d/%n +} +``` +Also note the change in the `home` setting: +the inbox of a user `user@foo.com` will now be stored +in `/home/vmail/foo.com/user`. +That's all you need to change. + + +#### OpenSMTPD + +To inform OpenSMTPD of all the domains, +create a new file `/etc/smtpd/domains`, +and in there put all desired names on their own line: +```sh +foo.com +bar.com +``` +And as I mentioned when discussing the DNS records, +you should check that `/etc/smtpd/mailname` agrees +with your server's reverse DNS. + +Then, in the main configuration file, tell OpenSMTPD to +use the new domains file when deciding whether to accept an message, +by declaring a new table and changing the `match` line for inbound mail: +```sh +table domains "/etc/smtpd/domains" +# ... +match from any for domain <domains> action "RECV" +``` + +#### Rspamd + +The last thing to do is to inform Rspamd of the multiple domains. +It's really easy: simply add multiple domain blocks: +```c +domain { + foo.com { + path = "/path/to/dkim/private.key"; + selector = "hello"; + } +} +domain { + bar.com { + path = "/path/to/dkim/private.key"; + selector = "world"; + } +} +``` + +### Advanced security + +SPF, DKIM and DMARC are email's traditional DNS-based security systems, +but in 2018 the IETF released [RFC 8460](https://tools.ietf.org/html/rfc8460) and [RFC 8461](https://www.rfc-editor.org/rfc/rfc8461.txt), +which respectively define TLSRPT and MTA-STS, +two fancy new systems focused on TLS-encrypted email transport. + +These security mechanisms are pretty new, +so you won't get a huge benefit from enabling them, +but big email providers' draconian spam filters might like it. + + +#### TLSRPT + +TLS reporting, or TLSRPT for short, is very simple: +all it does is provide a contact email address in case +somebody has trouble with the TLS configuration of your SMTP server. + +To enable it for your custom email domain `example.com`, +simply create a DNS TXT record for the `_smtp._tls` subdomain: +```sh +_smtp._tls.example.com. TXT "v=TLSRPTv1; rua=mailto:<contact>" +``` +Where `<contact>` is an email address of your choosing. +That's all! + + +#### MTA-STS + +MTA Strict Transport Security (MTA-STS) tells other servers +that you take TLS encryption of messages very seriously, +so they should avoid sending you unencrypted email, +and should only accept certain certificates from your side. + +Compared to the previously discussed DNS-based security extensions, +MTA-STS is a bit more work to set up, +because you'll also need an HTTP web server. + +The DNS part is still pretty simple: +create yet another DNS TXT record, +this time for the subdomain `_mta-sts`: +```sh +_mta-sts.example.com. TXT "v=STSv1; id=<id>" +``` +The `<id>` should identify the version of your policy, +so other servers can quickly see if something changed. +I recommend using today's date. + +For the next part, I'll assume that you already have +a web server running on a server with the IP address `1.2.3.4`. +I use [nginx](https://nginx.org/) for this, running +on the same server as OpenSMTPD and Dovecot, +but you don't have to do the same. + +Create an A record which binds your server +to the subdomain `mta-sts` (without underscore): +```sh +mta-sts.example.com. A 1.2.3.4 +``` +Set your web server to serve the file +`https://mta-sts.example.com/.well-known/mta-sts.txt` +(we'll discuss that file in a moment). +Note that this policy file **must** be served over HTTPS, +so you need a valid TLS certificate for that domain. + +The contents of the `mta-sts.txt` policy file are as follows, +where `mx1.example.com` and `mx2.example.com` are the hosts +mentioned in `example.com`'s DNS MX records: +```sh +version: STSv1 +mode: enforce +mx: mx1.example.com +mx: mx2.example.com +max_age: <age> +``` +All MX servers must be mentioned this way. +If you're feeling cautious, you may want to set +`mode` to `testing` in the beginning. +This policy is valid for `<age>` seconds, +which is recommended to be several weeks, +but to start with, I suggest using 86400 seconds (one day). +Finally, ensure that this file has CRLF Windows-style line endings. + +To correctly pass an MTA-STS test, the TLS certificate +presented by e.g. `mx1.example.com` should be valid for `mx1.exaple.com`. +To achieve this without needing to manage too many certificates, +you can specify multiple domains when requesting a certificate, +or you can use a wildcard domain (`*.example.com`). +Note, however, that MTA-STS testing tools don't like +the latter option, so I recommend the former. + +Once you're done, check your work by using either +[ESMTP](https://esmtp.email/tools/mta-sts/)'s or [Ayke](https://aykevl.nl/apps/mta-sts/)'s +online MTA-STS validation tools, +ignoring any warnings about DNSSEC or DANE. +If all is good, great! + +Even if you did everything correctly, +these tools will warn you that you're not using DNSSEC/DANE. +It might then be tempting to set that up for even more security, +but I recommend against that for private servers: take a look at [this](https://dane.sys4.de/common_mistakes). + + + +## OpenSMTPD + +### Client certificates (in addition to passwords) + +You can configure OpenSMTPD to request a client certificate +for sending emails, as a second factor for authentication. + +UPDATE: When I wrote this two years ago, it worked, +but now it doesn't anymore, and I can't figure out why. +It seems OpenSMTPD always rejects the client certificates for being self-signed, +even if they can manually be verified for our CA using the `openssl` tool. +I'm leaving this tutorial here for anyone who's interested, +but it's unlikely I'll fix it anytime soon. + + +#### Certificates + +We need to start with some cryptography to create and verify certificates. +I recommend that you do all of this on your trusted *client* device, +and only copy the necessary files to the server later. + +DISCLAIMER: +All the keys and certificates that we'll generate in this section are +for **private use** only, to handle a small number of trusted clients. +I'm not a cryptography expert, so you should **not** listen to me +for large-scale systems that may involve untrusted devices. + +The first step is to set up a private Certificate Authority (CA), +which issues the client certificates and can be used to verify them. +Start by generating an RSA private key, +which you should store in a safe place and not share with anyone: +```sh +$ openssl genrsa -out mailca.key 2048 +``` +Extract a public certificate from this key as follows. +Because we're lazy, we give it a lifetime of 36500 days: +```sh +$ openssl req -new -x509 -days 36500 -key mailca.key -out mailca.crt +``` +When running this command, OpenSSL will ask you some questions +about who this certificate is intended for. +Since this is for personal use, your answers don't matter, +so just use the defaults. +Some fields (I think only *Country Name* and *Organization Name*) +cannot be empty, but the others can. + +Moving on to the client, once again generate an RSA private key: +```sh +$ openssl genrsa -out mailclient.key 2048 +``` +From this private key, create a Certificate Signing Request (CSR) +as follows, where you'll be asked the same questions as before: +```sh +$ openssl req -new -key mailclient.key -out mailclient.csr +``` +By feeding this CSR to the CA, we can create a signed client certificate +that can be verified using the CA's public certificate. +```sh +$ openssl x509 -req -in mailclient.csr -out mailclient.crt \ + -days 36499 -CA mailca.crt -CAkey mailca.key +``` +If you want to multiple client certificates, +just repeat the last few steps for each one. + + +#### Server + +OpenSMTPD needs to verify the validity of client certificates +using the CA's public certificate, so you should copy that +to somewhere on the server, e.g. `/etc/smtpd/mailca.crt`, +and declare it to OpenSMTPD by adding this near +the top of `/etc/smtpd/smtpd.conf`: +```sh +ca "mailca" cert "/etc/smtpd/mailca.crt" +``` +Then replace the entire configuration for outbound mail as follows. +Note that this removes SMTPS support, leaving only STARTTLS: +```sh +# Outbound +listen on eth0 port 587 tls-require verify pki "example.com" ca "mailca" auth <passwds> filter "rspamd" +action "SEND" relay srs +match from any auth for any action "SEND" +``` +The magic word here is "`verify`", which tells OpenSMTPD +to ask for a client certificate and to verify it using the given CA. + + +#### Client + +Now you won't be able to send emails if your client doesn't +present its certificate to the server! +Unfortunately, not all mail clients support this; personally +I use [Thunderbird](https://www.thunderbird.net/) with success. +I won't include any client-specific configuration here, +but I will say this: + +For some clients (like Thunderbird), you'll have an easier time +importing your client certificate if you encode it in the +[PKCS #12](https://en.wikipedia.org/wiki/PKCS_12) storage format: +```sh +$ openssl pkcs12 -export -in mailclient.crt -inkey mailclient.key \ + -certfile mailca.crt -out mailclient.pfx +``` +OpenSSL will ask you to set a password, which you'll need to +enter again when importing the certificate into the client. + + + +### ~~Client certificates (instead of passwords)~~ + +UPDATE: Don't do this. +As said above, OpenSMTPD's certificate verification is a mystery, +so for all I know, if you follow the instructions in this subsection, +you might find yourself running an *open* SMTP relay! +That would be bad, because anyone on the Internet +could send emails through your server with zero authentication. +In theory, the client certificates act as authentication, +but, again, the verification process is mysterious, +so I'm just not confident enough to say. + +If you really want to, you can use the client certificates +as a substitute for passwords. This is especially useful +if you set up a catchall inbox in Dovecot, +because this will allow you to send emails +from arbitrary addresses from your domain. + +To do this, follow the same procedure as in the previous section, +but with a slightly different OpenSMTPD configuration: +```sh +listen on eth0 port 587 tls-require verify pki "example.com" ca "mailca" filter "rspamd" tag "VALID" +action "SEND" relay srs +match from any tag "VALID" for any action "SEND" +``` +All incoming connections that present a good certificate +will be tagged as being `VALID`, and their mail will be relayed. + +Unfortunately, we're not quite done yet here, +because Rspamd is now very confused... + + +#### Rspamd + +When OpenSMTPD passes a message through Rspamd, it also includes +some metadata, most notably whether the sender has authenticated +successfully with OpenSMTPD... which is now no longer the case +for submissions, because we've removed the `auth` directive! + +Rspamd therefore starts regarding these outgoing emails +as *incoming* emails, because they don't seem +to come from a trusted user. So instead of signing them with DKIM +and handing them back to OpenSMTPD, it will do a full spam scan. +If they get a high spam score (which is likely for short test emails), +*your* spam filter, running on *your* server, +will be flagging *your* messages as spam! + +The solution is to whitelist your domain(s) in Rspamd, +so it won't scan them. To do this, create a new file +`/etc/rspamd/local.d/settings.conf` with these contents, +where `foo.com` and `bar.com` are the domains to whitelist: +```c +outbound { + priority = high; + from = "@foo.com"; + from = "@bar.com"; + apply { + actions { + add_header = 1000; + } + } +} +``` +Setting `priority` to `high` ensures that Rspamd checks +this rule before doing anything else. +You can add any number of `from` directives; +this rule will be applied if any of them match. +It only sets the threshold for the action `add_header` to `1000`. +That is, if the email doesn't get a spam score of at least 1000 +(the default is 6) Rspamd will not add any spam tags. + +Because Rspamd is still regarding your emails as inbound, +you also need to change the global settings of +the DKIM signer in `/etc/rspamd/local.d/dkim_signing.conf`, +such that they include the following: +```c +sign_inbound = true; +allow_hdrfrom_mismatch = true; +allow_username_mismatch = true; +``` +This tells Rspamd to add DKIM signatures to incoming emails, +which in this case includes yours. +Allowing these mismatches ensures that the messages still get signed, +even if you're sending from an arbitrary address. + + + +## Dovecot + +### Catchall inbox + +In Dovecot, you can create a catch-all inbox that will accept all +emails sent to your domain that don't match anyone in `/etc/dovecot/users`. +Just add another `userdb` block *after* the first: +```sh +userdb { + driver = static + args = uid=vmail gid=vmail home=/var/vmail/catchall allow_all_users=yes +} +``` +The `static` driver means there is no table file: +all configuration is directly within this `userdb` block. +If we don't specify `allow_all_users=yes`, then Dovecot +will check whether users exist using the `passdb` table, +and will conclude that the recipient is invalid. + + + diff --git a/source/blog/2020/email-server/index.md b/source/blog/2020/email-server/index.md new file mode 100644 index 0000000..962e6aa --- /dev/null +++ b/source/blog/2020/email-server/index.md @@ -0,0 +1,729 @@ +--- +title: "Setting up an email server in 2020 with OpenSMTPD and Dovecot" +date: 2020-04-27 +layout: "blog" +toc: true +--- + +So, you want to set up your own email server? In that case, welcome. + +There are many reasons to run a custom email server, +ranging from privacy concerns about providers like Google, +to just wanting to do it for fun and/or learning. +Since you're here, I assume you've already found a reason. + +Beware: this is a messy topic, and the available documentation +is even messier, so it could take a while before you get it to work properly. +I've compiled this guide according to my experiences +in an attempt to make this dark art more accessible, +but your mileage may vary considerably. I hope you find it useful. + +This guide is aimed at people who are comfortable with +the Linux/*BSD command line. + +When you're done (if you get that far), take a look at the sequels +"[Setting up an email server in 2020 with OpenSMTPD and Dovecot: extras](/blog/2020/email-server-extras/)" +and "[Revisiting my email server in 2022](/blog/2022/email-server-revisited/)" +for ideas on how to extend your setup. + +Last updated on 2022-09-12. + + + +## Preparation + +Setting up email is relatively complex compared to e.g. a static website, +because you need to configure not one, but *two* server programs, +*and* you need to shoehorn modern security features into email's Stone-Age design. +I'll start by explaining the general structure of a mail server setup. + + + +### How email works + +The programs involved in the exchange of emails are called [agents](https://en.wikipedia.org/wiki/Email_agent_(infrastructure)). +Officially, there are 5 different types of agent: MUA, MSA, MTA, MDA and MRA. +But fortunately, it's reasonable to treat the MRA and MSA +as being part of the MUA and MTA, respectively. + +The *Mail User Agent* (MUA) is simply the client on your device at home +that you use to send and receive emails, and this guide assumes +you already have a favourite program for this, e.g. [Thunderbird](https://www.thunderbird.net/en-US/). +Nowadays it's fashionable to use a web interface for emails, +but that's also beyond the scope of this guide. + +The *Mail Delivery Agent* (MDA) is a program that watches over +the server's copy of your mailbox: it manages your inbox, +remembers which messages you have or haven't read, +keeps a copy of your drafts, etc. +When you open your mailbox, your MUA will connect to +your server's MDA using the [IMAP](https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol) protocol +(or [POP3](https://en.wikipedia.org/wiki/Post_Office_Protocol), but that one's [obsolete](https://pop2imap.com/)). + +The *Mail Transfer Agent* (MTA) is responsible for +making messages arrive at the right destination. +When you send an email, your MUA will pass it on to your server's MTA, +which will in turn pass it on to the recipient's mail server. +Likewise, when someone sends *you* an email from another server, +the MTA will receive it and hand it over to the MDA so you can read it later. +In both cases the MTA speaks the [SMTP](https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol) protocol. + +In this guide our MDA will be [Dovecot](https://dovecot.org/), +which is a very popular choice for that role. +As for the MTA, there exist several options, +the most popular being [Postfix](http://www.postfix.org/) and [Exim](https://exim.org/). +However, this guide uses the newer, lesser-known [OpenSMTPD](https://opensmtpd.org/), +which in my experience is *much* easier to set up: +Postfix and Exim have complex configurations and +are geared towards large-scale email providers, +whereas OpenSMTPD is more beginner-friendly. + + + +### Security + +The base email system is horribly insecure on its own, +so we still need to duct-tape on some security features. +In this context, "security" has two meanings: +spam protecion and privacy protection (encryption). + +Spam protection also means two things here: +defending yourself against spammers, and +preventing that *your* emails get flagged as spam. +The former is optional, but the latter is not: +big providers such as Google and Microsoft +use infamously strict spam filters, +and if they decide that your server is a spammer, +there's almost nothing you can do about it. +Spam protection techniques will be discussed +in more detail over the course of this guide. + +Privacy protection is important in the 21st century: +you don't want a random router in the Internet to read all your emails, +which may contain sensitive information such as +private conversations and account password reset links. +You should therefore try to make sure that emails are +transported over an encrypted channel. +To do this, you have two options for encryption: +*mandatory* and *opportunistic* encryption. + +Mandatory encryption is only practical for client-server +communication (not server-server), and is provided by IMAPS and SMTPS, +which wrap the IMAP and SMTP protocols in [TLS](https://en.wikipedia.org/wiki/Transport_Layer_Security), +in the same way that [HTTPS](https://en.wikipedia.org/wiki/HTTPS) does for [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol). + +For server-server communication, the only option is +opportunistic encryption in the form of [STARTTLS](https://en.wikipedia.org/wiki/STARTTLS), +where communication is only encrypted if both parties agree +after a short unencrypted discussion. +That last part is vulnerable to [MitM](https://en.wikipedia.org/wiki/Man-in-the-middle_attack) attacks, +where anyone along the path of the email servers' discussion +can alter the exchange to block the use of encryption, +which sometimes actually [happens](https://www.eff.org/deeplinks/2014/11/starttls-downgrade-attacks) in practice. + +The only way to make sure that STARTTLS is used in that case +is to refuse any exchange unless the servers agree to use encryption. +Unfortunately, that's a risky approach that I can't recommend, +because not all servers support encryption (unbelievable, right?). +For example, I've received airline booking confirmations, +full of personal details, and made with billion-dollar companies, +sent across the Internet without any protection. + +This guide includes intructions to enable encryption, +but assumes that you already have a TLS certificate for that. +If not, find a guide to get one from [Let's Encrypt](https://letsencrypt.org/) (it's free!), +and remember that you'll need to renew it every few months. +Using a self-signed certificate *may* work, but I don't recommend it. + +In the rest of this guide I'll assume that +you have a public full-chain TLS certificate at `/etc/ssl/certs/example.com.pem`, +and a private encryption key at `/etc/ssl/private/example.com.pem`. + + + +### Server + +Obviously, you'll need a server to run the MTA and MDA on. +You can host your own at home, but the more reliable option is +to rent one in a data center ([VPS](https://en.wikipedia.org/wiki/Virtual_private_server)). +This guide was written with a Linux server in mind, +but in theory it should also work on the BSDs +([OpenBSD](https://www.openbsd.org/), [FreeBSD](https://www.freebsd.org/), +[NetBSD](https://www.netbsd.org/), etc.) with minimal adaptation. + +The server must be online 24/7, you must have root SSH access, +it must have a static IP address, and TCP network port 25 must be open. +Especially check that last one: you may need to explicitly ask +your home ISP or the server provider to enable port 25, +because they often close it to prevent spam. +You can usually do this from their web interface. + +You also must have a domain name, which I'll call `example.com`. +This will be necessary for basically everything: +DNS records, TLS certificate, MTA network configuration, etc. +If you don't have one yet, you can choose between many registrars +to rent one from. Personally I use and can recommend [Gandi](https://www.gandi.net/). + +Note that it's a **bad** idea to use a domain like `foo.bar.com`, +where you control the `foo` part but *not* the `bar` part: +in that case, a spammer in control of `qux.bar.com` +could negatively affect *your* reputation +in the eyes of other email providers. + +Lastly, when setting up an email server, you also have the choice +between using to *system* users or *virtual* users. +With system users, if an email arrives for `john@example.com`, +then the MTA and MDA will expect that there exists +a `john` Unix user on the server to deliver it to. +With virtual users, you have much more flexibility, so that's what we'll use. +All email will be managed under a single Unix user/group called `vmail`. +Create it as follows: +```sh +# GNU CoreUtils: +$ groupadd vmail +$ useradd -g vmail vmail +# BusyBox: +$ addgroup vmail +$ adduser -D -G vmail vmail +# *BSD: +$ no clue, but it should be similar +``` + + +## DNS records + +Now we must set up all the necessary DNS records, which +is usually possible from the domain registrar's web interface. +It may take a while for your changes to propagate over the Internet, +so I recommend doing this section now and the rest tomorrow. + +Firstly, you should already have an A and/or AAAA record +to associate your domain `example.com` with the server's IP address. +For email it is **essential** that you also have [reverse DNS](https://en.wikipedia.org/wiki/Reverse_DNS_lookup) +set up correctly. If you're renting your server remotely, +you can often do this from the provider's configuration tool, +otherwise, you should create a PTR-type DNS record, +although that's beyond the scope of this guide. + +Once you're done, I recommend testing your DNS records +using the [MX Lookup](https://mxtoolbox.com/MXLookup.aspx) online tool. + + + +### MX + +To inform the rest of the Internet that your server is an email server, +create an MX (Mail eXchanger) DNS record for your domain. +Note the dot at the end of the domain name: +```sh +example.com. MX 42 example.com. +``` +When a message is sent to an email address ending in `@example.com`, +the sender will query DNS for any MX records for `example.com`. +There it will find a domain name (in this case `example.com` again), +for which it will look up the IP address using an A/AAAA record. +The domain name in the record must **not** have an associated CNAME record; +it must be directly translatable to an IP address. + +You may have multiple MX records, containing different domain names, +each with a preference number (`42` in the example above). +The sender will try MX records with *lower* numbers first, +and if that server is unavailable, it will try a higher number. +If you have multiple mail servers (which is a good idea), +you can thus declare those as follows: +```sh +example.com. MX 13 mx1.example.com. +example.com. MX 42 mx2.example.com. +``` +Here, a server sending an email to your domain `example.com` +will try to send it to the IP address of `mx1.example.com` first, +and if that fails, it will move on to `mx2.example.com`. +If both `mx1` and `mx2` have the same number, then the sender +will randomly choose one, which is useful for load balancing, +although that's probably overkill for a private server. + + + +### SPF + +The [Sender Policy Framework](https://en.wikipedia.org/wiki/Sender_Policy_Framework) (SPF), +is a feature which helps prevent spammers from impersonating +your server in an attempt to get around blacklists. +This security feature is **required** nowadays: +if you don't use it, you'll probably get flagged as spam. + +SPF works by specifying which IP addresses are authorized +to send emails from your domain name. +You must publish this information in a +TXT-type DNS record (**not** SPF-type, which also exists!) with the following contents: +```sh +example.com. TXT "v=spf1 mx -all" +``` +Everything after the version `v=spf1` is a list of *verification mechanisms* +for a spam filter to try out in the given order. +The `-all` at the end says to reject your email +if all of the previous mechanisms fail. +See the [SPF spec](https://tools.ietf.org/html/rfc7208) for details. + +I recommend only using the `mx` mechanism, which tells the verifier +to look at the A/AAAA addresses of the domains in your MX records. +This allows you to add, remove, or change your servers +without needing to update this record. + + + +### DKIM + +Then we have [DomainKeys Identified Mail](https://en.wikipedia.org/wiki/DomainKeys_Identified_Mail) (DKIM), +which is a more comprehensive form of anti-impersonation, +and, like SPF, is practically **mandatory** in the modern era. + +It adds a cryptographic signature to all emails from your server, +which the receiver's spam filter will verify using the email's contents, +and a public key that you need to publish in a DNS record. +Again, you should implement *both* SPF and DKIM, despite their overlap. + +To set up DKIM, create an RSA keypair, using the `openssl` utility: +```sh +$ openssl genrsa -out /path/to/dkim/private.key 2048 +$ openssl rsa -in /path/to/dkim/private.key -out /path/to/dkim/public.key +``` +The minimum size is 1024 bits, but I recommend 2048 bits. +Bigger is better, but because DNS is involved you can't stretch it +to 4096 bits without causing discomfort to [some](https://serverfault.com/questions/747185/dkim-can-i-use-a-rsa-key-larger-than-2048bit-i-e-4096) servers. +And I think it goes without saying that you should keep the private key private. + +Importantly, the DKIM DNS record **cannot** be +attached directly to your domain `example.com`; +instead, it should belong to a subdomain of the form +`<selector>._domainkey.example.com`, +where `<selector>` is an alphanumeric string you can choose (e.g. today's date), +just remember your choice for later when configuring the DKIM signer. +And if you change your key, keep the old record around +for a while so old emails can still be verified. + +Your DKIM policy must be published in a TXT record +as follows, where `<pubkey>` is the public RSA key `MI...AB` +stored in `/path/to/dkim/public.key`, with the newlines removed: +```sh +<selector>._domainkey.example.com. TXT "v=DKIM1; t=s; h=sha256; p=<pubkey>" +``` +Here, `v=DKIM1` is the version and must be the first tag. +The flag `t=s` enables strict mode, as recommended by the [DKIM spec](https://tools.ietf.org/html/rfc6376), +meaning that emails sent from subdomains immediately fail verification. +The optional tag `h=sha256` blocks the use of the old SHA1 algorithm. + + + +### DMARC + +Lastly, we have [Domain-based Message Authentication, Reporting and Conformance](https://en.wikipedia.org/wiki/DMARC) (DMARC), +which is *technically* optional, but *highly* recommended, +because it will make you look more legitimate in the eyes of Google and Microsoft. +It can modify the behaviour of SPF and DKIM, +and also provides advice about what a receiver should do +if one of your emails fails verification. + +To enable it, create yet another TXT record, which, +similarly to DKIM, **must** belong to the subdomain `_dmarc.example.com`, +and give it the following contents, +where `<admin>` is an email address of your choosing, +which may or may not belong to your domain: +```sh +_dmarc.example.com. TXT "v=DMARC1; p=reject; sp=reject; pct=100; aspf=s; adkim=s; fo=1; ruf=mailto:<admin>" +``` +The version tag `v=DMARC1` must come first, +followed by `p=` and `sp=`, which control what to do to unverified messages +coming from the main domain and subdomains, respectively. +Here, `reject` means that delivery should be refused, +`none` asks to let it through anyway, and `quarantine` tells +the filter to take a closer look or to put it in a spam folder. +The percentage `pct=100` says how many of your emails to apply the policy to. +Next, `aspf=s` and `adkim=s` enable strict mode for SPF and DKIM, +which blocks subdomains from passing. +Finally, `fo=1` asks for a forensic report if verification fails, +and `ruf=` gives an address to send it to. +If in doubt, see the [DMARC spec](https://tools.ietf.org/html/rfc7489). + + + +## MDA: Dovecot + +[Dovecot](https://www.dovecot.org/) is a very popular IMAP server, +focused on being lightweight, simple, and secure, +and has extensive and up-to-date documentation. +It's very flexible and scalable, and keeps up well +with the lastest security best-practices. + +If you installed Dovecot via a package manager, +you'll probably have lots of configuration files +in the `/etc/dovecot` directory. +I want you to delete all of them. Yes, `rm -rf` that crap. +Dovecot is simple to configure, and doesn't care where +you put its settings, so having all that chaos in `/etc/dovecot` +just makes things unnecessarily confusing. + + + +### Network + +Create a new configuration file `/etc/dovecot/dovecot.conf`, +and start by filling in the details of your TLS certificate, +making clear that unencrypted connections are unacceptable: +```sh +ssl = required +ssl_cert = </etc/ssl/certs/example.com.pem +ssl_key = </etc/ssl/private/example.com.key + +ssl_min_protocol = TLSv1.2 +ssl_prefer_server_ciphers = yes + +disable_plaintext_auth = yes +``` +The final `disable_plaintext_auth` option tells Dovecot +to reject any passwords that were sent unencrypted. +This means it must be [hashed](https://en.wikipedia.org/wiki/Cryptographic_hash_function) +or sent over an encrypted connection, or both. + +Next, tell Dovecot which protocols to use +and where to expect them as follows: +```sh +protocols = lmtp imap + +service lmtp { + unix_listener lmtp { + user = vmail + group = vmail + } +} + +service imap-login { + inet_listener imap { + port = 143 + } + inet_listener imaps { + port = 993 + } +} +``` +LMTP is the Local Mail Transport Protocol, which is basically SMTP +but for exchanges within a single server or over a trusted network. +When an email is received, Dovecot will start a child process +under the `vmail` user/group to deliver the message to its recipient. + +Since we set `ssl = required` earlier, clients will only get their mail +if the STARTTLS handshake was successful during the IMAP exchange, +or if they connect via IMAPS to force the use of encryption. +You can therefore optionally remove one of the two +`inet_listener`s according to your preferences. + + + +### Users + +Next, we need to inform Dovecot which email addresses it should handle, +and what to do with their messages. Create a file `/etc/dovecot/users` for this, +which describes a user on each line in a similar format as `/etc/passwd`: +```sh +user:password:uid:gid::homedir +``` +In this guide, we're using the `vmail` user for all accounts, +so leave the `uid`, `gid`, and `homedir` fields blank. +We'll be storing all emails in `vmail`'s home directory. +The `user` field should be the email address excluding the `@example.com` +(in fact, you *can* include it, but this guides assumes a small-scale +server managing only one domain, so we exclude it). +Create the password hash to put in the `password` field as follows: +```sh +# If your server is fast and has lots of RAM: +$ doveadm pw -s ARGON2ID-CRYPT +# If you're using a potato: +$ doveadm pw -s SHA512-CRYPT +``` +After you've entered your password, simply copy-paste the entire +hash string outputted by the program into the `password` field. + +Now, Dovecot needs a file describing user accounts on two separate occasions: +* To check whether a client logging into the IMAP server + is valid and has given the right password. + This is handled by the `passdb` block(s) in the configuration. +* To know which email addresses the server is responsible for. + This is given by the `userdb` block(s) in the configuration. + +These functions aren't necessarily fulfilled by the same `users` file: +you can map multiple email addresses to one acccount, +or multiple accounts to one email address. +For simplicity, though, we'll use the `users` file for both: +```sh +passdb { + driver = passwd-file + args = scheme=ARGON2ID-CRYPT username_format=%n /etc/dovecot/users + #args = scheme=SHA512-CRYPT username_format=%n /etc/dovecot/users +} + +userdb { + driver = passwd-file + args = username_format=%n /etc/dovecot/users + override_fields = uid=vmail gid=vmail home=/home/vmail/%n +} +``` +The `driver` option sets the kind of table Dovecot should expect. +We tell it to use a file in the `passwd`-like format described above, +but other possibilities include e.g. an SQL database. +The options available in `args` depend on the chosen `driver`. + +In the `passdb` block, the hashing algorithm is given by `scheme`, +while `username_format=%n` says that the `users` file +only contains `name` out of `name@example.com`. + +In the `userdb` block, we force the use of `vmail:vmail` +for all accounts, and tell Dovecot to put their data in `/home/vmail/%n`, +where `%n` means the address up until the `@`, so +e.g. mail to `name@example.com` is stored in `/home/vmail/name`. + +Now that Dovecot knows where to store messages, +we just need to specify in what format to store them: +```sh +mail_location = maildir:~/Maildir +``` +The two standard mailbox formats to choose from are `maildir` and `mbox`. +I highly recommend `maildir`; it's more modern than the ancient `mbox` format. +That `~/Maildir` says which subfolder to use. +Ensure that `/home/vmail` is owned by `vmail:vmail`, +so that Dovecot has write access. + + + +## MTA: OpenSMTPD + +[OpenSMTPD](https://opensmtpd.org/) is an MTA by the [OpenBSD](https://www.openbsd.org/) project, +who are known for their focus on security and minimalism. +Compared to other MTAs it's a joy to set up, thanks to +its intuitive configuration syntax and to-the-point manual. +This guide is for OpenSMTPD version 6.4 or newer: +older versions used a substantially different syntax. + +If you have any problems with OpenSMTPD, +take a look at the maintainer's [blog](https://poolp.org/), +which contains a lot of useful information, +and was a big help when writing this guide. + + + +### Users + +To begin, delete the contents of the `/etc/smtpd/aliases` file, +if it exists, which maps recipient addresses to system users. +In our case, we're using `vmail` for everyone, +and we'll let Dovecot manage the details by simply writing: +```sh +@ vmail +``` +Then create a new file `/etc/smtpd/passwds` +and fill it in according to the following format, +where `<user>` could be anything you want, +not necessarily the same account name as in Dovecot: +```sh +<user> <hash> +``` +Generate the password hash with this command for each user. +Again, the password doesn't need to be the same as in Dovecot, +but for your own convenience it's probably best if it is: +```sh +$ smtpctl encrypt '<password>' +``` +Then, like with Dovecot, just delete the contents of +the main config file `/etc/smtpd/smtpd.conf`, +and start by putting in the following: +```sh +table aliases "/etc/smtpd/aliases" +table passwds "/etc/smtpd/passwds" +``` + + +### Network + +Write your domain name on a single line in `/etc/smtpd/mailname`. +This is the name that OpenSMTPD will use to introduce itself +to other servers, and it's important that this matches +the reverse DNS domain name of the server's IP: +```sh +example.com +# Or mx1.example.com or whatever +``` +Then continue in `/etc/smtpd/smtpd.conf` by importing your TLS certificate: +```sh +pki "example.com" cert "/etc/ssl/certs/example.com.pem" +pki "example.com" key "/etc/ssl/private/example.com.key" +``` +And tell OpenSMTPD which keys to use for the [Sender Rewriting Scheme](https://en.wikipedia.org/wiki/Sender_Rewriting_Scheme), +which prevents forwarded emails from breaking SPF and looking like spam: +```sh +srs key "<secret1>" +srs key backup "<secret2>" # optional, read below +``` +It's recommended to change the key every year or so, +but in that case you need to ensure that emails from the last month +can still be verified using the old one, so if you change it, +simply move it to the backup slot for a month. + +It's very important that the secrets can't be guessed, +otherwise *anyone* can send mail through your server, +so I recommend generating these keys randomly as follows: +```sh +$ head -c 30 /dev/urandom | base64 +``` +Next, define the spam filters as follows. +For the last line to work, you'll need to [download](https://github.com/poolpOrg/filter-rspamd) +and build the `filter-rspamd` adapter binary for yourself, +created by OpenSMTPD's official maintainer. +We'll set up the Rspamd service in the next section, +which will be responsible for spam filtering and DKIM signing: +```sh +filter "rdns" phase connect match !rdns disconnect "550 DNS error" +filter "fcrdns" phase connect match !fcrdns disconnect "550 DNS error" +filter "rspamd" proc-exec "/etc/smtpd/filter-rspamd" +``` +I cannot overstate the importance of the first two lines: +these will block hundreds of spam attempts, and have, +at least for me, never blocked anything legitimate so far. + +The only thing left to do here is to tell OpenSMTPD which ports to listen on +and what to do with the incoming traffic. +This comes in two parts: first, we listen on port 25 for incoming +messages for your domain coming from other email servers: +```sh +# Inbound +listen on eth0 port 25 tls pki "example.com" filter { "rdns", "fcrdns", "rspamd" } +action "RECV" lmtp "/var/run/dovecot/lmtp" rcpt-to virtual <aliases> +match from any for domain "example.com" action "RECV" +``` +Line 1 says to listen on `port 25` of interface `eth0`, +providing *optional* `tls` using the certificate for `example.com`, +and passing everything through the three filters definer earlier. +Making TLS mandatory is a **bad** idea here, because not all servers can use TLS. + +Line 2 defines an action called `RECV`, +which relays an email to Dovecot's LMTP socket, +with the `rcpt-to` and `virtual` making sure +that Dovecot will actually accept the message. + +Line 3 then simply says that any incoming mail +for your domain should have the action `RECV` applied to it, +unless the spam filters rejected it. + +Secondly, we listen on port 465 (SMTPS) +and/or port 587 (STARTTLS) for messages getting sent +from your email client to the rest of the world, +so we require user authentication: +```sh +# Outbound +listen on eth0 port 465 smtps pki "example.com" auth <passwds> filter "rspamd" +listen on eth0 port 587 tls-require pki "example.com" auth <passwds> filter "rspamd" +action "SEND" relay srs +match from any auth for any action "SEND" +``` +The only difference between lines 1 and 2 is the port and the protocol. +Both demand a mandatory TLS connection, and that users authenticate +themselves according to the password file created earlier. +The `filter` at the end is for DKIM signing of outgoing mail. + +Lines 3 and 4 are only triggered after successful `auth`entication, +and, unsurprisingly, `relay` the email to its destination. +The `srs` at the end enables using the SRS settings from earlier. + +OpenSMTPD is the only program in this setup that needs to handle +untrusted connections, when other MTAs send you messages. +Since, like most server software, it may have [vulnerabilities](https://opensmtpd.org/security.html), +it is **very** important that you keep it as up-to-date as possible. + + + +## Spam filter: Rspamd + +[Rspamd](https://www.rspamd.com/) is a modern spam filtering solution, +with many features that you could spend hours tweaking. +In this guide, however, we'll keep it short, +because we're only really interested in its ability add +our server's DKIM signature to outgoing messages. + +Besides, according to my limited experience, +for small-scale servers spam filtering isn't essential, +as long as you tell OpenSMTPD to check reverse DNS as described above. +However, there are some much more experienced people who disagree with me. + +Basically, for our purposes, don't touch any of Rspamd's default +configuration except for creating/editing the file +`/etc/rspamd/local.d/dkim_signing.conf` with the following contents, +where `<selector>` is the DKIM selector you chose in the DNS record: +```sh +allow_username_mismatch = true; + +domain { + example.com { + path = "/path/to/dkim/private.key"; + selector = "<selector>"; + } +} +``` +Make sure that the DKIM `private.key` file is +readable (and *only* readable) by `rspamd:rspamd`. +Allowing username mismatches is necessary, +because OpenSMTPD will only tell Rspamd about `username` +while the DKIM signer actually expects `username@example.com`. + +And... that's it! Of course, don't forget to start all the necessary daemons. + + + +## Testing + +Everything is set up now, so it's time to test. Fingers crossed! + +As mentioned earlier, you can check the validity +of your DNS using the [MX Lookup](https://mxtoolbox.com/MXLookup.aspx) tool. +You can use the same website to test OpenSMTPD +with the [SMTP Diagnostics](https://mxtoolbox.com/diagnostic.aspx) tool. + +All decent email clients include an option to set the server for an email account. +This guide doesn't include instructions for that, +because it will vary a lot from client to client. +If asked for your login type, choose plain/normal/unencrypted passwords. +Don't worry, the client-server connection is TLS-encrypted, +so nobody will be able to steal it. + +Next, to verify that you can send and receive messages, +and that your SPF/DKIM/DMARC is working, +the following websites will be useful: + +* [~~Is my email working?~~](http://ismyemailworking.com/) + UPDATE: no longer available. +* [DKIM validator](https://dkimvalidator.com/): + by sending an email, checks that SPF and DKIM are set up correctly. +* [Email deliverability tool](https://mxtoolbox.com/deliverability): + tests basically everything. + As of writing, there's a bug that causes DKIM signatures to fail verification + even if you did it right; just ignore that. +* [Learn and test DMARC](https://www.learndmarc.com/): + checks SPF, DKIM and DMARC in detail. + +If everything is good so far, congratulations! + +Now comes the big scary final test: +sending an email to one of the "big guys", like Google, Yahoo or Microsoft. +Their spam filters are very strict, so if you get through, great! +Try to write your test message so that it doesn't look like spam, +otherwise there's no point to this exercise. + +If something failed, then you have some investigating to do. +Either one of the daemons is misconfigured, or there's a problem +with your domain name and/or DNS records. +Do some research, and you'll get there, don't give up. + +But if everything works, congratulations! +You're now the proud administrator of a private email server. +Have fun with it, and don't forget to update your +TLS certificate and DKIM and SRS keys. + +PS: and please don't spam; you'll ruin it for everyone else. + diff --git a/source/blog/2022/email-server-revisited/index.md b/source/blog/2022/email-server-revisited/index.md new file mode 100644 index 0000000..4519bae --- /dev/null +++ b/source/blog/2022/email-server-revisited/index.md @@ -0,0 +1,302 @@ +--- +title: "Revisiting my email server in 2022" +date: 2022-09-12 +layout: "blog" +toc: true +--- + +More than two years have passed since my first post about +[setting up an email server in 2020 with OpenSMTPD and Dovecot](/blog/2020/email-server/) +and [its sequel](/blog/2020/email-server-extras/). +Since then, my server been going strong, with a few minor hiccups along the way. +In this post, I'll explain some of the changes I made. + +This assumes you've followed the preceding guides: +the configuration snippets given here +should be interpreted as modifications to those guides, +*not* as complete setups! + +Last updated on 2022-09-12. + + + +## More about DMARC + +When I wrote my original guide, +I didn't properly understand how DMARC works: +I misinterpreted it as an optional wrapper around SPF and DKIM. +But oh God, I was wrong. +Simon Andrews' article "[I figured out how DMARC works, and it almost broke me](https://simonandrews.ca/articles/how-to-set-up-spf-dkim-dmarc)" +showed me the ugly truth, +and I highly recommend reading it. +Briefly, DMARC does two arguably unrelated things. + +Firstly, DMARC provides a way to diagnose issues with your SPF and DKIM configurations, +in the form of reports that get sent to the `ruf=` and/or `rua=` email address(es) +you put in the DNS record. +Without this, there's no way of knowing why +your emails are getting marked as spam. + +Secondly, it improves the trustworthiness of SPF and DKIM by enforcing *alignment*. +This means something slightly different for SPF and DKIM, +and boils down to fixing a glaring issue: + +* For some reason, in vanilla SMTP, it turns out that the email's `From:` header + doesn't need to agree with the address in the SMTP `MAIL FROM` command; + in other words, the server can claim a different sender than what's written in the message's header. + SPF only verifies the former (i.e. it takes the domain in `MAIL FROM`), + so one SMTP server can impersonate another. +* An email's DKIM signature header states the domain of the signing server with the `d=` tag, + but, once again, that doesn't need to agree with the `From:` header's domain. + DKIM doesn't look at the latter, so an SMTP server can validly sign impersonated messages. + +DMARC's alignment refers to checking whether the domains match up for SPF and DKIM, +thus ensuring that an SMTP server can't pretend to be someone else. +It sounds obvious, but nope, apparently it wasn't before DMARC was made. + + + +## DKIMproxy + +To add DKIM signatures to my messages, +I switched from Rspamd to [DKIMproxy](http://dkimproxy.sourceforge.net/). + + + +### Motivation + +To sign outgoing emails for DKIM, my original guide used Rspamd --- +an unusual choice, since it's a spam filter designed to act on *incoming* messages. +Later, in the [sequel](/blog/2020/email-server-extras/) to that guide, +I needed some ugly workarounds to compensate for Rspamd's "smartness" +when I tried to play around with authentication schemes in OpenSMTPD. +Clearly, this wasn't ideal. + +However, the reason I cut my losses and switched to another DKIM signer +was actually a bug in +MXToolBox' [deliverability tool](https://mxtoolbox.com/deliverability). +It appears that no matter what you do, +this tool claims that your email's signature fails validation. +I'm not the first to notice this issue: +see e.g. [this question](https://serverfault.com/questions/1005818/dkim-validating-but-mxtoolbox-reports-as-dkim-signature-not-verified) on Server Fault. +Other tools like the [DKIM validator](https://dkimvalidator.com/) +say that my DKIM signatures are correct. + +There aren't many open-source alternatives out there for DKIM signing: +the only ones I know of are [OpenDKIM](http://www.opendkim.org/) +and DKIMproxy. +The former is a so-called "milter", +meaning it can only interact with MTAs via the milter API, +which is only supported by [Sendmail](https://www.proofpoint.com/us/products/email-protection/open-source-email-solution) +and [Postfix](https://www.postfix.org/). +Since we're using OpenSMTPD, +our only option is DKIMproxy, +which consists of two daemons: +`dkimproxy.out` to sign outgoing mail, +and `dkimproxy.in` to verify incoming mail. +We just need the former; +Rspamd is still convenient for handling the latter's functionality. + + + +### DKIM settings + +Let's start by disabling Rspamd's DKIM signer +in `/etc/rspamd/local.d/dkim_signing.conf`: +```sh +enabled = false; +``` +Then configure `dkimproxy.out` as follows +in `/etc/dkimproxy/dkimproxy_out.conf`. +If you placed your DKIM public key +in a TXT DNS record for `<selector>._domainkey.example.com.`, +and stored your private key in `/path/to/dkim/private.key`, +then: +```sh +# Receive emails on 10027, sign them, and forward them to 10028 +listen 127.0.0.1:10027 +relay 127.0.0.1:10028 + +# Settings for email signing +domain example.com +signature dkim(c=relaxed/relaxed,a=rsa-sha256) +keyfile /path/to/dkim/private.key +selector <selector> +``` +Here, `rsa-sha256` is the signature algorithm +(this is the best available, because DKIM is ancient), +and `relaxed/relaxed` is the so-called *canonicalization* method, +which is applied before signing and verification, +to prevents failures if e.g. the email's whitespace gets changed in transit. + + + +### OpenSMTPD settings + +OpenSMTPD needs to send all outbound mail through `dkimproxy.out`. +In `/etc/smtpd/smtpd.conf`, we tell it that all emails coming from the MUA +must be relayed through `localhost:10027`, and then, after DKIM signing, +picked up again on `localhost:10028`: +```sh +# Outbound +listen on eth0 port 465 smtps pki "example.com" auth <passwds> tag "TRUSTED" +listen on eth0 port 587 tls-require pki "example.com" auth <passwds> tag "TRUSTED" +action "SIGN" relay host "localhost:10027" +match from any tag "TRUSTED" for any action "SIGN" + +listen on lo port 10028 tag "SIGNED" +action "SEND" relay srs +match from any tag "SIGNED" for any action "SEND" +``` +The tag name `TRUSTED` reflects that only messages from trusted +(i.e. authenticated) MUAs should be signed. +After signing, emails get the tag `SIGNED`, +and are sent to their destination as usual. + + + +## SMTP relay + +Instead of sending my emails directly to their destinations, +I now send them to an SMTP relay server, +which then passes them on to their actual destinations. + + + +### Motivation + +Large email providers such as Google, Microsoft and Yahoo +manage many user accounts, so for them it makes sense +to keep track of IP-based sender reputations. +For example, if a number of low-quality emails are sent from a single IP +to many of the accounts they manage, +it's cheaper to simply blacklist that IP entirely at the MTA level, +rather than passing each message through a computationally-intensive spam filter. + +But, as usual, Microsoft has to ruin everything with their draconic policies. +In a stroke of genius, +someone there decided to blindly ban IPs, +seemingly in blocks belonging to VPS providers. +One day, I tried to send an email to an Outlook-based account, +and OpenSMTPD reported it had been unable to make the delivery, +because Microsoft had thrown an error: + +<a href="microsoft-bounce.png"> +<img src="microsoft-bounce.png" class="darkinv" style="width:100%"> +</a> + +To their credit, they seem to be offering a way out. +This approach is reasonable: preventively ban high-risk IP ranges, +and allow "trustworthy" servers at the owner's request. +I got error 5.7.511, asking me to send an email to a support address. +If you're lucky, you may have a different error, +and get the opportunity to use the slick [delist portal](https://sender.office.com/) instead. +The URL in the bounce message links to [this list](https://go.microsoft.com/fwlink/?LinkId=526653) of error codes. + +I confess, I never actually bothered to forward the message to the provided address: +my initial email was time-sensitive, +so I couldn't afford to wait for Microsoft's response. +Also, their customer support's stellar reputation precedes them, +so I chose to use my time more wisely. +Even if they would've resolved it nicely, +there's nothing preventing Microsoft (or any other provider) +from breaking my deliverability again in the future. +Instead, I opted for a compromise. + +As a result of providers' IP reputation systems, +a whole new business has appeared: SMTP relays. +They offer to take the issue out of your hands: +you send your emails through their servers, +and they do their best to deliver them to large providers. +SMTP relays are mostly used for sending marketing emails in bulk, +but are also useful to avoid small-scale problems as described above. +There are many SMTP relay services to choose from, at various prices. + +Using an SMTP relay results in more reliable delivery of your messages to large providers, +but an obvious concern is privacy: +the relay server can read all your outgoing emails (but not incoming), +so you'll have to trust the service you choose. +But it's no worse than using a major provider, +and if you're sending sensitive material, why use email in the first place? +Personally, I use [SMTP2GO](https://www.smtp2go.com/), +but I can't say how good they are; do your own research. + + + +### OpenSMTPD settings + +Once you've chosen an SMTP relay service, let's say `relay.com`, +and set up your account, +they'll let you create credentials to use their SMTP servers. +Suppose these credentials are `<username>` and `<password>`, +create a file `/etc/smtpd/relaypw` with contents: + +```sh +<label> <username>:<password> +``` + +Where `<label>` is a string of your choice. +Note that `<password>` must be plaintext, +because it needs to be provided to the relay server. +To tell OpenSMTPD to use the relay, +edit `/etc/smtpd/smtpd.conf` as follows, +i.e. register the `relaypw` table and modify the `SEND` action: + +```sh +table relaypw "/etc/smtpd/relaypw" + +#action "SEND" relay srs ### Replace this line with the following: +action "SEND" relay host "smtps://<label>@relay.com:465" auth <relaypw> pki "example.com" srs +``` + +With `<label>` replaced by the label you chose earlier, +and `relay.com:465` replaced by the host/port combination +given in the relay service's documentation. +Depending on what they support, you may also need to change the protocol `smtps://` (SMTP over TLS) +to `smtp://` (SMTP with optional STARTTLS) or `smtp+tls://` (SMTP with mandatory STARTTLS). +I recommend SMTPS. + + + +### DNS records + +If you've been paying attention so far, you have a burning question: +what about SPF and stuff? +Wasn't the point to prevent SMTP servers from sending emails on others' behalf? +Well, yes, so you'll need to add some DNS records for the relay to work. +The details depend on which service you choose, +so they'll tell you what to do when you're setting up your account. +As an example, based on my experience with SMTP2GO, +you may need to add two CNAME records like: + +```sh +emXXXXXX.example.com. CNAME return.relay.com. +sXXXXXX._domainkey.example.com. CNAME dkim.relay.com. +``` + +Which, roughly speaking, respectively enable SPF and DKIM. +Here, `XXXXXX` is an ID that the service will provide to you, +since the DNS addresses must be unique. + +Technically, those two DNS records should be enough for SPF and DKIM, +but in practice, it seems that different email providers/tools have slightly +different interpretations of these standards, +and can get confused when an email passes through multiple unaffiliated SMTP servers. +Therefore, I recommend explicitly adding the relay to your SPF policy: + +```sh +example.com TXT "v=spf1 mx include:spf.relay.com -all" +``` + +Your relay service might not publicly document their version of `spf.relay.com`, +but you can find it by looking up your CNAME `emXXXXXX.example.com` (or equivalent) +in MXToolBox' [ SPF tool](https://mxtoolbox.com/spf.aspx). + +I also recommend relaxing your DMARC domain policy for SPF and DKIM, +such that your CNAME subdomains still pass the alignment checks: +```sh +_dmarc.example.com. TXT "v=DMARC1; aspf=r; adkim=r; ..." +``` + +Be sure to check that it's set up correctly +using the website "[Learn and test DMARC](https://www.learndmarc.com/)". diff --git a/source/blog/2022/email-server-revisited/microsoft-bounce.png b/source/blog/2022/email-server-revisited/microsoft-bounce.png Binary files differnew file mode 100644 index 0000000..2d8a2e6 --- /dev/null +++ b/source/blog/2022/email-server-revisited/microsoft-bounce.png diff --git a/source/blog/2022/things-i-use/index.md b/source/blog/2022/things-i-use/index.md new file mode 100644 index 0000000..2f4a2bc --- /dev/null +++ b/source/blog/2022/things-i-use/index.md @@ -0,0 +1,156 @@ +--- +title: "Things I use and recommend" +date: 2022-09-28 +layout: "blog" +toc: true +--- + +I use a lot of software, most of it free and open-source. +I've tried to use much more, but it didn't always go so well, +so I've made a list of the programs I like enough to recommend. +Such a list has been on my website for a long time already; +this is its official publication. + +Last updated on 2022-09-28. + + +## General +* [Neovim](https://neovim.io/): + A modernized fork of the venerable [Vim](https://www.vim.org/) text editor. +* [restic](https://restic.net/): + Good command-line backup program. + You'll need to provide your own storage. +* [Syncthing](https://syncthing.net/): + Synchronizes folders across devices. Decentralized and easy to set up. + + +## Desktop +* [Arch Linux](https://www.archlinux.org/): + The distribution that, for me, delivers the best cost-benefit ratio. + I'm not a big fan of [systemd](https://freedesktop.org/wiki/Software/systemd/) + or [glibc](https://www.gnu.org/software/libc/), + but the fantastic package manager and the huge repositories + make Arch Linux unbeatable for working techies' day-to-day computing. +* [i3](https://i3wm.org/) and [Sway](https://swaywm.org/): + Lightweight window managers. + Once you go tiling, you can never go back. +* [Firefox](https://www.mozilla.org/en-US/firefox/): + Web browsers suck. + This ones sucks the least, and is developed by Mozilla, + who still seem to care about privacy and security, and + who created the [Rust](https://www.rust-lang.org/) language. + Firefox has all the necessary modern features, + and provides an excellent curated set of add-ons. + + [uBlock Origin](https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/): + The best adblocker out there. It's free *and* open-source! + + [HTTPS Everywhere](https://www.eff.org/https-everywhere): + In today's world, this should be included in all browsers. + The fact that it's rule-based is unfortunate, but hey, it works. +* [Thunderbird](https://www.thunderbird.net/): + Email clients suck, just like email itself. + This one just sucks less, since it's also made by Mozilla. +* [Alacritty](https://github.com/alacritty/alacritty): + Simple, lightning-fast terminal emulator with + extra goodies like 24-bit colours + and live configuration reloading. +* [pass](https://www.passwordstore.org/): + Password manager for techies. + It's simple, secure, and extensible. + However, I don't think I'll ever understand how to properly manage [GnuPG](https://gnupg.org/) keys, + so I gave up and switched to KeePassXC instead. +* [KeePassXC](https://keepassxc.org/): + User-friendly open-source password manager. + It stores everything in a local encrypted database file, + which is your responsibility to back up and sync. +* [EasyEffects](https://github.com/wwmm/easyeffects): + Real-time audio effects on Linux. + I use it to tweak my headphones' response according to the awesome + [AutoEQ](https://github.com/jaakkopasanen/AutoEq) project's data. +* [Anki](https://ankiweb.net/about): + Flashcard studying software, + with a big [library](https://ankiweb.net/shared/decks/) of community-made decks. + Frankly it's not very user-friendly, but it does the job. +* [Veusz](https://veusz.github.io/): + Fantastic plotting software, + and one of the most underrated open-source tools that I know of. + It gives beautiful plots, can handle *huge* data files, and, + because its files are just plain Python, + you can automatically generate plots with a bit of scripting. +* [KLayout](https://klayout.de/): + Open-source chip layout editor, with advanced scripting functionality. + I would've liked some more keyboard shortcuts by default, + but at least I can make my own. + + +## Server +* [Alpine Linux](https://alpinelinux.org/): + Minimalist distribution powered by + [BusyBox](https://www.busybox.net/) and [musl](https://musl.libc.org/). + It has a large-enough selection of both cutting-edge + and stable packages to be practical. +* [nginx](https://nginx.org/): + Fast, secure and popular HTTP server, + and a breeze to set up. +* [OpenSMTPD](https://opensmtpd.org/): + Email SMTP server by the venerable [OpenBSD](https://www.openbsd.org/) project, + and the only one of its kind that nails the setup experience. +* [Dovecot](https://dovecot.org/): + One of the, if not *the* most popular email IMAP server. + And for good reason: it's fast, secure, and a pleasure to set up. +* [Rspamd](https://www.rspamd.com/): + Spam filter for email. + To be honest, I haven't looked into this one much. + It has lots of advanced features that I barely understand, + but still seems to be the most modern and usable spam filter out there. +* [Zola](https://www.getzola.org/): + Straightforward static site generator written in Rust. + The only thing it's missing is some kind of LaTeX formula support, + which is why I migrated to Hugo. +* [Hugo](https://gohugo.io/): + Another good static site generator, although not quite as nice as Zola in my opinion, + since Hugo's template language is a bit messed up. It still works well though. +* [cgit](https://git.zx2c4.com/cgit/about/): + JavaScript-free online Git frontend, + perfect for private setups. + If you need something more advanced like user accounts, + [Gitea](https://gitea.io) is a good choice too. +* [acme.sh](https://github.com/acmesh-official/acme.sh): + Straightforward tool to manage TLS certificates + issued by [Let's Encrypt](https://letsencrypt.org/). + + +## Android +* [LineageOS](https://lineageos.org/): + Had enough of vendor-specific crap in Android? + This open-source distribution has good hardware support + and enough momentum to be the *de facto* standard version + of Android for tinkerers. +* [microG](https://microg.org/): + Takes the Google out of Android + by reimplementing proprietary libraries. + It works very well; the only problem I've experienced is + that push notifications take longer to arrive than usual. + Installation is tricky, but they offer + a [custom LineageOS](https://lineage.microg.org/) to make it easy. +* [AdAway](https://adaway.org/): + Effective system-wide adblocker + that should work for all your apps. +* [Aegis](https://getaegis.app/): + Secure open-source 2FA authenticator app. +* [Insular](https://f-droid.org/en/packages/com.oasisfeng.island.fdroid/): + Isolates untrusted apps in an Android Work Profile. +* [AnkiDroid](https://f-droid.org/en/packages/com.ichi2.anki/): + Good mobile frontend for [Anki](https://ankiweb.net/about). + + +## Services +* [Gandi](https://www.gandi.net/): + European domain registrar with the motto + "No bullshit since 1999". They provide an honest, + high-quality service at a competitive price. + This statement is not sponsored. +* [Let's Encrypt](https://letsencrypt.org/): + Provides free TLS encryption certificates + to anybody who asks politely, thereby making + online security more accessible for small sites like this one. + diff --git a/source/blog/index.md b/source/blog/index.md new file mode 100644 index 0000000..5a2cf54 --- /dev/null +++ b/source/blog/index.md @@ -0,0 +1,30 @@ +--- +title: "Blog" +date: 2021-02-22 +layout: "default" +--- + +# Blog + +Just a bunch of random ramblings. + +{% assign by_year = site.pages + | where_exp: "page", "page.layout == 'blog'" + | group_by_exp: "page", "page.date | date: '%Y'" + | reverse +%} +{% for year in by_year %} +<p>{{ year.name }}: +<ul> + {% assign in_year = year.items + | sort: "date" + | reverse + %} + {% for post in in_year %} + <li> + <a href="{{ post.url }}">{{ post.title }}</a> + </li> + {% endfor %} +</ul> +</p> +{% endfor %} diff --git a/source/index.md b/source/index.md new file mode 100644 index 0000000..680b577 --- /dev/null +++ b/source/index.md @@ -0,0 +1,19 @@ +--- +title: "Home" +date: 2021-02-22 +layout: "default" +--- + +<img src="/infra/image/logo256.png" class="darkinv" style="border: 2px solid #121212;"> + +Welcome to my website. + +Once in a blue moon, I post something related to my areas of interest: +physics, mathematics, programming and even linguistics. +Perhaps you're interested in my [knowledge base](/know/), +where I explain STEM concepts I've learned over the years. + +This website is made by me using [Hugo](https://gohugo.io), +and served to you by [nginx](https://nginx.org/). +I intend to keep it free of advertising and trackers, +and to maintain my A+ score for [TLS quality](https://www.ssllabs.com/ssltest/analyze.html?d=prefetch.eu). diff --git a/source/infra/css/katex.min.css b/source/infra/css/katex.min.css new file mode 100644 index 0000000..6281a70 --- /dev/null +++ b/source/infra/css/katex.min.css @@ -0,0 +1 @@ +@font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/infra/font/KaTeX_AMS-Regular.woff2) format("woff2"),url(/infra/font/KaTeX_AMS-Regular.woff) format("woff"),url(/infra/font/KaTeX_AMS-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/infra/font/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(/infra/font/KaTeX_Caligraphic-Bold.woff) format("woff"),url(/infra/font/KaTeX_Caligraphic-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/infra/font/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(/infra/font/KaTeX_Caligraphic-Regular.woff) format("woff"),url(/infra/font/KaTeX_Caligraphic-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/infra/font/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(/infra/font/KaTeX_Fraktur-Bold.woff) format("woff"),url(/infra/font/KaTeX_Fraktur-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/infra/font/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(/infra/font/KaTeX_Fraktur-Regular.woff) format("woff"),url(/infra/font/KaTeX_Fraktur-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/infra/font/KaTeX_Main-Bold.woff2) format("woff2"),url(/infra/font/KaTeX_Main-Bold.woff) format("woff"),url(/infra/font/KaTeX_Main-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/infra/font/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(/infra/font/KaTeX_Main-BoldItalic.woff) format("woff"),url(/infra/font/KaTeX_Main-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/infra/font/KaTeX_Main-Italic.woff2) format("woff2"),url(/infra/font/KaTeX_Main-Italic.woff) format("woff"),url(/infra/font/KaTeX_Main-Italic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/infra/font/KaTeX_Main-Regular.woff2) format("woff2"),url(/infra/font/KaTeX_Main-Regular.woff) format("woff"),url(/infra/font/KaTeX_Main-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/infra/font/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(/infra/font/KaTeX_Math-BoldItalic.woff) format("woff"),url(/infra/font/KaTeX_Math-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/infra/font/KaTeX_Math-Italic.woff2) format("woff2"),url(/infra/font/KaTeX_Math-Italic.woff) format("woff"),url(/infra/font/KaTeX_Math-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(/infra/font/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(/infra/font/KaTeX_SansSerif-Bold.woff) format("woff"),url(/infra/font/KaTeX_SansSerif-Bold.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(/infra/font/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(/infra/font/KaTeX_SansSerif-Italic.woff) format("woff"),url(/infra/font/KaTeX_SansSerif-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(/infra/font/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(/infra/font/KaTeX_SansSerif-Regular.woff) format("woff"),url(/infra/font/KaTeX_SansSerif-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/infra/font/KaTeX_Script-Regular.woff2) format("woff2"),url(/infra/font/KaTeX_Script-Regular.woff) format("woff"),url(/infra/font/KaTeX_Script-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/infra/font/KaTeX_Size1-Regular.woff2) format("woff2"),url(/infra/font/KaTeX_Size1-Regular.woff) format("woff"),url(/infra/font/KaTeX_Size1-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/infra/font/KaTeX_Size2-Regular.woff2) format("woff2"),url(/infra/font/KaTeX_Size2-Regular.woff) format("woff"),url(/infra/font/KaTeX_Size2-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(/infra/font/KaTeX_Size3-Regular.woff2) format("woff2"),url(/infra/font/KaTeX_Size3-Regular.woff) format("woff"),url(/infra/font/KaTeX_Size3-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/infra/font/KaTeX_Size4-Regular.woff2) format("woff2"),url(/infra/font/KaTeX_Size4-Regular.woff) format("woff"),url(/infra/font/KaTeX_Size4-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/infra/font/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(/infra/font/KaTeX_Typewriter-Regular.woff) format("woff"),url(/infra/font/KaTeX_Typewriter-Regular.ttf) format("truetype")}.katex{text-rendering:auto;font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.2"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.83333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.71428571em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.85714286em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14285714em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571429em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857143em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71428571em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714286em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857143em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96285714em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55428571em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.55555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.66666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.77777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.88888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.41666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.58333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.66666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.83333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.34722222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.41666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.48611111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.55555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.69444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.83333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44027778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.28935185em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.34722222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.40509259em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.46296296em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.52083333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.69444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.83333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023148em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981481em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108004em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.28929605em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.33751205em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.38572806em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.43394407em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216008em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.57859209em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.69431051em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.83317261em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961427em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.20096463em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.24115756em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.28135048em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.32154341em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.36173633em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.40192926em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.48231511em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.57877814em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.69453376em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.83360129em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo} diff --git a/source/infra/css/main.css b/source/infra/css/main.css new file mode 100644 index 0000000..5127873 --- /dev/null +++ b/source/infra/css/main.css @@ -0,0 +1,99 @@ +/* Colour scheme */ +:root { + --b: #ededed; + --f: #121212; + --a: #0000ff; +} +.darkinv {} +@media only screen and (prefers-color-scheme: dark) { + :root { + --b: #121212; + --f: #ededed; + --a: #ffff00; + } + .darkinv {filter: invert(100%)} +} + +/* Basic elements */ +body { + background: #ededed; + background: var(--b); + color: #121212; + color: var(--f); + + max-width: 80ch; + margin: auto; + padding: 1rem 0; + + font-family: sans-serif; + line-height: 1.5; +} +h1,h2,h3 {text-align: center;} +h1 {font-size: 2.0rem;} +h2 {font-size: 1.6rem;} +h3 {font-size: 1.2rem;} +a { + text-decoration: none; + color: #0000ff; + color: var(--a); +} +img { + display: block; + max-width: 100%; + height: auto; + margin: auto; +} + +/* Header and footer */ +.nav { + height: 3rem; + font-size: 2.4rem; + padding: 0.25rem 0; +} +.navl { + float: left; + text-align: left; +} +.navr { + float: right; + text-align: right; +} +.footl { + float: left; + text-align: left; +} +.footr { + float: right; + text-align: right; +} +@media only screen and (max-width: 72ch) { + .navl, .footl, .footr {width: 100%;} + .navr { + width: 100%; + font-size: 1.8rem; + } +} +.noha a:link, .noha a:visited { + color: #121212; + color: var(--f); +} +.noha a:hover, .noha a:focus, .noha a:active { + color: #0000ff; + color: var(--a); +} + +/* Collapsible boxes */ +label { + color: #0000ff; + color: var(--a); + cursor: pointer; +} +.accordion { + display: block; + padding: 0.3rem 0.5rem; + border-style: dotted; +} +input {display: none;} +input + label + .hidden {display: none;} +input:checked + label {display: none;} +input:checked + label + .hidden {display: block;} diff --git a/source/infra/css/syntax.css b/source/infra/css/syntax.css new file mode 100644 index 0000000..8772351 --- /dev/null +++ b/source/infra/css/syntax.css @@ -0,0 +1,147 @@ +/* From https://github.com/brazacz/rouge-themes/blob/main/css/github.css */ +.highlight { background-color: #f8f8f8; } +.highlight .bp { color: #999999; } +.highlight .c { color: #999988; font-style: italic; } +.highlight .c1 { color: #999988; font-style: italic; } +.highlight .cd { color: #999988; font-style: italic; } +.highlight .ch { color: #999988; font-style: italic; } +.highlight .cm { color: #999988; font-style: italic; } +.highlight .cp { color: #999999; font-weight: bold; } +.highlight .cpf { color: #999988; font-style: italic; } +.highlight .cs { color: #999999; font-weight: bold; font-style: italic; } +.highlight .dl { color: #dd1144; } +.highlight .err { color: #a61717; background-color: #e3d2d2; } +.highlight .fm { color: #990000; font-weight: bold; } +.highlight .gd { color: #000000; background-color: #ffdddd; } +.highlight .ge { color: #000000; font-style: italic; } +.highlight .gh { color: #999999; } +.highlight .gi { color: #000000; background-color: #ddffdd; } +.highlight .go { color: #888888; } +.highlight .gp { color: #555555; } +.highlight .gr { color: #aa0000; } +.highlight .gs { font-weight: bold; } +.highlight .gt { color: #aa0000; } +.highlight .gu { color: #aaaaaa; } +.highlight .il { color: #009999; } +.highlight .k { color: #000000; font-weight: bold; } +.highlight .kc { color: #000000; font-weight: bold; } +.highlight .kd { color: #000000; font-weight: bold; } +.highlight .kn { color: #000000; font-weight: bold; } +.highlight .kp { color: #000000; font-weight: bold; } +.highlight .kr { color: #000000; font-weight: bold; } +.highlight .kt { color: #445588; font-weight: bold; } +.highlight .kv { color: #000000; font-weight: bold; } +.highlight .m { color: #009999; } +.highlight .mb { color: #009999; } +.highlight .mf { color: #009999; } +.highlight .mh { color: #009999; } +.highlight .mi { color: #009999; } +.highlight .mo { color: #009999; } +.highlight .mx { color: #009999; } +.highlight .na { color: #008080; } +.highlight .nb { color: #0086B3; } +.highlight .nc { color: #445588; font-weight: bold; } +.highlight .nd { color: #3c5d5d; font-weight: bold; } +.highlight .ne { color: #990000; font-weight: bold; } +.highlight .nf { color: #990000; font-weight: bold; } +.highlight .ni { color: #800080; } +.highlight .nl { color: #990000; font-weight: bold; } +.highlight .nn { color: #555555; } +.highlight .no { color: #008080; } +.highlight .nt { color: #000080; } +.highlight .nv { color: #008080; } +.highlight .o { color: #000000; font-weight: bold; } +.highlight .ow { color: #000000; font-weight: bold; } +.highlight .s { color: #dd1144; } +.highlight .s1 { color: #dd1144; } +.highlight .s2 { color: #dd1144; } +.highlight .sa { color: #000000; font-weight: bold; } +.highlight .sb { color: #dd1144; } +.highlight .sc { color: #dd1144; } +.highlight .sd { color: #dd1144; } +.highlight .se { color: #dd1144; } +.highlight .sh { color: #dd1144; } +.highlight .si { color: #dd1144; } +.highlight .sr { color: #009926; } +.highlight .ss { color: #990073; } +.highlight .sx { color: #dd1144; } +.highlight .vc { color: #008080; } +.highlight .vg { color: #008080; } +.highlight .vi { color: #008080; } +.highlight .vm { color: #008080; } +.highlight .w { color: #bbbbbb; } + +@media only screen and (prefers-color-scheme: dark) { +/* From https://github.com/numist/highlight-css/blob/main/Pygments/github-dark.css */ +.highlight { background-color: #0d1117; } +.highlight .bp { color: #c9d1d9; } /* Name.Builtin.Pseudo */ +.highlight .c { color: #8b949e; font-style: italic; } /* Comment */ +.highlight .c1 { color: #8b949e; font-style: italic; } /* Comment.Single */ +.highlight .cd { color: #8b949e; font-style: italic; } /* ? */ +.highlight .ch { color: #8b949e; font-style: italic; } /* Comment.Hashbang */ +.highlight .cm { color: #8b949e; font-style: italic; } /* Comment.Multiline */ +.highlight .cp { color: #8b949e; font-weight: bold; font-style: italic; } /* Comment.Preproc */ +.highlight .cpf { color: #8b949e; font-style: italic; } /* Comment.PreprocFile */ +.highlight .cs { color: #8b949e; font-weight: bold; font-style: italic; } /* Comment.Special */ +.highlight .dl { color: #79c0ff; } /* Literal.String.Delimiter */ +.highlight .err { color: #f85149; } /* Error */ +.highlight .fm { color: #d2a8ff; font-weight: bold; } /* Name.Function.Magic */ +.highlight .gd { color: #ffa198; background-color: #490202; } /* Generic.Deleted */ +.highlight .ge { color: #c9d1d9; font-style: italic; } /* Generic.Emph */ +.highlight .gh { color: #79c0ff; font-weight: bold; } /* Generic.Heading */ +.highlight .gi { color: #56d364; background-color: #0f5323; } /* Generic.Inserted */ +.highlight .go { color: #8b949e; } /* Generic.Output */ +.highlight .gp { color: #8b949e; } /* Generic.Prompt */ +.highlight .gr { color: #ffa198; } /* Generic.Error */ +.highlight .gs { font-weight: bold; } /* Generic.Strong */ +.highlight .gt { color: #ff7b72; } /* Generic.Traceback */ +.highlight .gu { color: #79c0ff; } /* Generic.Subheading */ +.highlight .il { color: #a5d6ff; } /* Literal.Number.Integer.Long */ +.highlight .k { color: #ff7b72; } /* Keyword */ +.highlight .kc { color: #79c0ff; } /* Keyword.Constant */ +.highlight .kd { color: #ff7b72; } /* Keyword.Declaration */ +.highlight .kn { color: #ff7b72; } /* Keyword.Namespace */ +.highlight .kp { color: #79c0ff; } /* Keyword.Pseudo */ +.highlight .kr { color: #ff7b72; } /* Keyword.Reserved */ +.highlight .kt { color: #ff7b72; } /* Keyword.Type */ +.highlight .kv { color: #ff7b72; } /* ? */ +.highlight .m { color: #a5d6ff; } /* Literal.Number */ +.highlight .mb { color: #a5d6ff; } /* Literal.Number.Bin */ +.highlight .mf { color: #a5d6ff; } /* Literal.Number.Float */ +.highlight .mh { color: #a5d6ff; } /* Literal.Number.Hex */ +.highlight .mi { color: #a5d6ff; } /* Literal.Number.Integer */ +.highlight .mo { color: #a5d6ff; } /* Literal.Number.Oct */ +.highlight .mx { color: #a5d6ff; } /* ? */ +.highlight .na { color: #c9d1d9; } /* Name.Attribute */ +.highlight .nb { color: #c9d1d9; } /* Name.Builtin */ +.highlight .nc { color: #f0883e; font-weight: bold; } /* Name.Class */ +.highlight .nd { color: #d2a8ff; font-weight: bold; } /* Name.Decorator */ +.highlight .ne { color: #f0883e; font-weight: bold; } /* Name.Exception */ +.highlight .nf { color: #d2a8ff; font-weight: bold; } /* Name.Function */ +.highlight .ni { color: #ffa657; } /* Name.Entity */ +.highlight .nl { color: #79c0ff; font-weight: bold; } /* Name.Label */ +.highlight .nn { color: #ff7b72; } /* Name.Namespace */ +.highlight .no { color: #79c0ff; font-weight: bold; } /* Name.Constant */ +.highlight .nt { color: #7ee787; } /* Name.Tag */ +.highlight .nv { color: #79c0ff; } /* Name.Variable */ +.highlight .o { color: #ff7b72; font-weight: bold; } /* Operator */ +.highlight .ow { color: #ff7b72; font-weight: bold; } /* Operator.Word */ +.highlight .s { color: #a5d6ff; } /* Literal.String */ +.highlight .s1 { color: #a5d6ff; } /* Literal.String.Single */ +.highlight .s2 { color: #a5d6ff; } /* Literal.String.Double */ +.highlight .sa { color: #79c0ff; } /* Literal.String.Affix */ +.highlight .sb { color: #a5d6ff; } /* Literal.String.Backtick */ +.highlight .sc { color: #a5d6ff; } /* Literal.String.Char */ +.highlight .sd { color: #a5d6ff; } /* Literal.String.Doc */ +.highlight .se { color: #79c0ff; } /* Literal.String.Escape */ +.highlight .sh { color: #79c0ff; } /* Literal.String.Heredoc */ +.highlight .si { color: #a5d6ff; } /* Literal.String.Interpol */ +.highlight .sr { color: #79c0ff; } /* Literal.String.Regex */ +.highlight .ss { color: #a5d6ff; } /* Literal.String.Symbol */ +.highlight .sx { color: #a5d6ff; } /* Literal.String.Other */ +.highlight .vc { color: #79c0ff; } /* Name.Variable.Class */ +.highlight .vg { color: #79c0ff; } /* Name.Variable.Global */ +.highlight .vi { color: #79c0ff; } /* Name.Variable.Instance */ +.highlight .vm { color: #79c0ff; } /* Name.Variable.Magic */ +.highlight .w { color: #6e7681; } /* Text.Whitespace */ +} diff --git a/source/infra/font/KaTeX_AMS-Regular.ttf b/source/infra/font/KaTeX_AMS-Regular.ttf Binary files differnew file mode 100644 index 0000000..c6f9a5e --- /dev/null +++ b/source/infra/font/KaTeX_AMS-Regular.ttf diff --git a/source/infra/font/KaTeX_AMS-Regular.woff b/source/infra/font/KaTeX_AMS-Regular.woff Binary files differnew file mode 100644 index 0000000..b804d7b --- /dev/null +++ b/source/infra/font/KaTeX_AMS-Regular.woff diff --git a/source/infra/font/KaTeX_AMS-Regular.woff2 b/source/infra/font/KaTeX_AMS-Regular.woff2 Binary files differnew file mode 100644 index 0000000..0acaaff --- /dev/null +++ b/source/infra/font/KaTeX_AMS-Regular.woff2 diff --git a/source/infra/font/KaTeX_Caligraphic-Bold.ttf b/source/infra/font/KaTeX_Caligraphic-Bold.ttf Binary files differnew file mode 100644 index 0000000..9ff4a5e --- /dev/null +++ b/source/infra/font/KaTeX_Caligraphic-Bold.ttf diff --git a/source/infra/font/KaTeX_Caligraphic-Bold.woff b/source/infra/font/KaTeX_Caligraphic-Bold.woff Binary files differnew file mode 100644 index 0000000..9759710 --- /dev/null +++ b/source/infra/font/KaTeX_Caligraphic-Bold.woff diff --git a/source/infra/font/KaTeX_Caligraphic-Bold.woff2 b/source/infra/font/KaTeX_Caligraphic-Bold.woff2 Binary files differnew file mode 100644 index 0000000..f390922 --- /dev/null +++ b/source/infra/font/KaTeX_Caligraphic-Bold.woff2 diff --git a/source/infra/font/KaTeX_Caligraphic-Regular.ttf b/source/infra/font/KaTeX_Caligraphic-Regular.ttf Binary files differnew file mode 100644 index 0000000..f522294 --- /dev/null +++ b/source/infra/font/KaTeX_Caligraphic-Regular.ttf diff --git a/source/infra/font/KaTeX_Caligraphic-Regular.woff b/source/infra/font/KaTeX_Caligraphic-Regular.woff Binary files differnew file mode 100644 index 0000000..9bdd534 --- /dev/null +++ b/source/infra/font/KaTeX_Caligraphic-Regular.woff diff --git a/source/infra/font/KaTeX_Caligraphic-Regular.woff2 b/source/infra/font/KaTeX_Caligraphic-Regular.woff2 Binary files differnew file mode 100644 index 0000000..75344a1 --- /dev/null +++ b/source/infra/font/KaTeX_Caligraphic-Regular.woff2 diff --git a/source/infra/font/KaTeX_Fraktur-Bold.ttf b/source/infra/font/KaTeX_Fraktur-Bold.ttf Binary files differnew file mode 100644 index 0000000..4e98259 --- /dev/null +++ b/source/infra/font/KaTeX_Fraktur-Bold.ttf diff --git a/source/infra/font/KaTeX_Fraktur-Bold.woff b/source/infra/font/KaTeX_Fraktur-Bold.woff Binary files differnew file mode 100644 index 0000000..e7730f6 --- /dev/null +++ b/source/infra/font/KaTeX_Fraktur-Bold.woff diff --git a/source/infra/font/KaTeX_Fraktur-Bold.woff2 b/source/infra/font/KaTeX_Fraktur-Bold.woff2 Binary files differnew file mode 100644 index 0000000..395f28b --- /dev/null +++ b/source/infra/font/KaTeX_Fraktur-Bold.woff2 diff --git a/source/infra/font/KaTeX_Fraktur-Regular.ttf b/source/infra/font/KaTeX_Fraktur-Regular.ttf Binary files differnew file mode 100644 index 0000000..b8461b2 --- /dev/null +++ b/source/infra/font/KaTeX_Fraktur-Regular.ttf diff --git a/source/infra/font/KaTeX_Fraktur-Regular.woff b/source/infra/font/KaTeX_Fraktur-Regular.woff Binary files differnew file mode 100644 index 0000000..acab069 --- /dev/null +++ b/source/infra/font/KaTeX_Fraktur-Regular.woff diff --git a/source/infra/font/KaTeX_Fraktur-Regular.woff2 b/source/infra/font/KaTeX_Fraktur-Regular.woff2 Binary files differnew file mode 100644 index 0000000..735f694 --- /dev/null +++ b/source/infra/font/KaTeX_Fraktur-Regular.woff2 diff --git a/source/infra/font/KaTeX_Main-Bold.ttf b/source/infra/font/KaTeX_Main-Bold.ttf Binary files differnew file mode 100644 index 0000000..4060e62 --- /dev/null +++ b/source/infra/font/KaTeX_Main-Bold.ttf diff --git a/source/infra/font/KaTeX_Main-Bold.woff b/source/infra/font/KaTeX_Main-Bold.woff Binary files differnew file mode 100644 index 0000000..f38136a --- /dev/null +++ b/source/infra/font/KaTeX_Main-Bold.woff diff --git a/source/infra/font/KaTeX_Main-Bold.woff2 b/source/infra/font/KaTeX_Main-Bold.woff2 Binary files differnew file mode 100644 index 0000000..ab2ad21 --- /dev/null +++ b/source/infra/font/KaTeX_Main-Bold.woff2 diff --git a/source/infra/font/KaTeX_Main-BoldItalic.ttf b/source/infra/font/KaTeX_Main-BoldItalic.ttf Binary files differnew file mode 100644 index 0000000..dc00797 --- /dev/null +++ b/source/infra/font/KaTeX_Main-BoldItalic.ttf diff --git a/source/infra/font/KaTeX_Main-BoldItalic.woff b/source/infra/font/KaTeX_Main-BoldItalic.woff Binary files differnew file mode 100644 index 0000000..67807b0 --- /dev/null +++ b/source/infra/font/KaTeX_Main-BoldItalic.woff diff --git a/source/infra/font/KaTeX_Main-BoldItalic.woff2 b/source/infra/font/KaTeX_Main-BoldItalic.woff2 Binary files differnew file mode 100644 index 0000000..5931794 --- /dev/null +++ b/source/infra/font/KaTeX_Main-BoldItalic.woff2 diff --git a/source/infra/font/KaTeX_Main-Italic.ttf b/source/infra/font/KaTeX_Main-Italic.ttf Binary files differnew file mode 100644 index 0000000..0e9b0f3 --- /dev/null +++ b/source/infra/font/KaTeX_Main-Italic.ttf diff --git a/source/infra/font/KaTeX_Main-Italic.woff b/source/infra/font/KaTeX_Main-Italic.woff Binary files differnew file mode 100644 index 0000000..6f43b59 --- /dev/null +++ b/source/infra/font/KaTeX_Main-Italic.woff diff --git a/source/infra/font/KaTeX_Main-Italic.woff2 b/source/infra/font/KaTeX_Main-Italic.woff2 Binary files differnew file mode 100644 index 0000000..b50920e --- /dev/null +++ b/source/infra/font/KaTeX_Main-Italic.woff2 diff --git a/source/infra/font/KaTeX_Main-Regular.ttf b/source/infra/font/KaTeX_Main-Regular.ttf Binary files differnew file mode 100644 index 0000000..dd45e1e --- /dev/null +++ b/source/infra/font/KaTeX_Main-Regular.ttf diff --git a/source/infra/font/KaTeX_Main-Regular.woff b/source/infra/font/KaTeX_Main-Regular.woff Binary files differnew file mode 100644 index 0000000..21f5812 --- /dev/null +++ b/source/infra/font/KaTeX_Main-Regular.woff diff --git a/source/infra/font/KaTeX_Main-Regular.woff2 b/source/infra/font/KaTeX_Main-Regular.woff2 Binary files differnew file mode 100644 index 0000000..eb24a7b --- /dev/null +++ b/source/infra/font/KaTeX_Main-Regular.woff2 diff --git a/source/infra/font/KaTeX_Math-BoldItalic.ttf b/source/infra/font/KaTeX_Math-BoldItalic.ttf Binary files differnew file mode 100644 index 0000000..728ce7a --- /dev/null +++ b/source/infra/font/KaTeX_Math-BoldItalic.ttf diff --git a/source/infra/font/KaTeX_Math-BoldItalic.woff b/source/infra/font/KaTeX_Math-BoldItalic.woff Binary files differnew file mode 100644 index 0000000..0ae390d --- /dev/null +++ b/source/infra/font/KaTeX_Math-BoldItalic.woff diff --git a/source/infra/font/KaTeX_Math-BoldItalic.woff2 b/source/infra/font/KaTeX_Math-BoldItalic.woff2 Binary files differnew file mode 100644 index 0000000..2965702 --- /dev/null +++ b/source/infra/font/KaTeX_Math-BoldItalic.woff2 diff --git a/source/infra/font/KaTeX_Math-Italic.ttf b/source/infra/font/KaTeX_Math-Italic.ttf Binary files differnew file mode 100644 index 0000000..70d559b --- /dev/null +++ b/source/infra/font/KaTeX_Math-Italic.ttf diff --git a/source/infra/font/KaTeX_Math-Italic.woff b/source/infra/font/KaTeX_Math-Italic.woff Binary files differnew file mode 100644 index 0000000..eb5159d --- /dev/null +++ b/source/infra/font/KaTeX_Math-Italic.woff diff --git a/source/infra/font/KaTeX_Math-Italic.woff2 b/source/infra/font/KaTeX_Math-Italic.woff2 Binary files differnew file mode 100644 index 0000000..215c143 --- /dev/null +++ b/source/infra/font/KaTeX_Math-Italic.woff2 diff --git a/source/infra/font/KaTeX_SansSerif-Bold.ttf b/source/infra/font/KaTeX_SansSerif-Bold.ttf Binary files differnew file mode 100644 index 0000000..2f65a8a --- /dev/null +++ b/source/infra/font/KaTeX_SansSerif-Bold.ttf diff --git a/source/infra/font/KaTeX_SansSerif-Bold.woff b/source/infra/font/KaTeX_SansSerif-Bold.woff Binary files differnew file mode 100644 index 0000000..8d47c02 --- /dev/null +++ b/source/infra/font/KaTeX_SansSerif-Bold.woff diff --git a/source/infra/font/KaTeX_SansSerif-Bold.woff2 b/source/infra/font/KaTeX_SansSerif-Bold.woff2 Binary files differnew file mode 100644 index 0000000..cfaa3bd --- /dev/null +++ b/source/infra/font/KaTeX_SansSerif-Bold.woff2 diff --git a/source/infra/font/KaTeX_SansSerif-Italic.ttf b/source/infra/font/KaTeX_SansSerif-Italic.ttf Binary files differnew file mode 100644 index 0000000..d5850df --- /dev/null +++ b/source/infra/font/KaTeX_SansSerif-Italic.ttf diff --git a/source/infra/font/KaTeX_SansSerif-Italic.woff b/source/infra/font/KaTeX_SansSerif-Italic.woff Binary files differnew file mode 100644 index 0000000..7e02df9 --- /dev/null +++ b/source/infra/font/KaTeX_SansSerif-Italic.woff diff --git a/source/infra/font/KaTeX_SansSerif-Italic.woff2 b/source/infra/font/KaTeX_SansSerif-Italic.woff2 Binary files differnew file mode 100644 index 0000000..349c06d --- /dev/null +++ b/source/infra/font/KaTeX_SansSerif-Italic.woff2 diff --git a/source/infra/font/KaTeX_SansSerif-Regular.ttf b/source/infra/font/KaTeX_SansSerif-Regular.ttf Binary files differnew file mode 100644 index 0000000..537279f --- /dev/null +++ b/source/infra/font/KaTeX_SansSerif-Regular.ttf diff --git a/source/infra/font/KaTeX_SansSerif-Regular.woff b/source/infra/font/KaTeX_SansSerif-Regular.woff Binary files differnew file mode 100644 index 0000000..31b8482 --- /dev/null +++ b/source/infra/font/KaTeX_SansSerif-Regular.woff diff --git a/source/infra/font/KaTeX_SansSerif-Regular.woff2 b/source/infra/font/KaTeX_SansSerif-Regular.woff2 Binary files differnew file mode 100644 index 0000000..a90eea8 --- /dev/null +++ b/source/infra/font/KaTeX_SansSerif-Regular.woff2 diff --git a/source/infra/font/KaTeX_Script-Regular.ttf b/source/infra/font/KaTeX_Script-Regular.ttf Binary files differnew file mode 100644 index 0000000..fd679bf --- /dev/null +++ b/source/infra/font/KaTeX_Script-Regular.ttf diff --git a/source/infra/font/KaTeX_Script-Regular.woff b/source/infra/font/KaTeX_Script-Regular.woff Binary files differnew file mode 100644 index 0000000..0e7da82 --- /dev/null +++ b/source/infra/font/KaTeX_Script-Regular.woff diff --git a/source/infra/font/KaTeX_Script-Regular.woff2 b/source/infra/font/KaTeX_Script-Regular.woff2 Binary files differnew file mode 100644 index 0000000..b3048fc --- /dev/null +++ b/source/infra/font/KaTeX_Script-Regular.woff2 diff --git a/source/infra/font/KaTeX_Size1-Regular.ttf b/source/infra/font/KaTeX_Size1-Regular.ttf Binary files differnew file mode 100644 index 0000000..871fd7d --- /dev/null +++ b/source/infra/font/KaTeX_Size1-Regular.ttf diff --git a/source/infra/font/KaTeX_Size1-Regular.woff b/source/infra/font/KaTeX_Size1-Regular.woff Binary files differnew file mode 100644 index 0000000..7f292d9 --- /dev/null +++ b/source/infra/font/KaTeX_Size1-Regular.woff diff --git a/source/infra/font/KaTeX_Size1-Regular.woff2 b/source/infra/font/KaTeX_Size1-Regular.woff2 Binary files differnew file mode 100644 index 0000000..c5a8462 --- /dev/null +++ b/source/infra/font/KaTeX_Size1-Regular.woff2 diff --git a/source/infra/font/KaTeX_Size2-Regular.ttf b/source/infra/font/KaTeX_Size2-Regular.ttf Binary files differnew file mode 100644 index 0000000..7a212ca --- /dev/null +++ b/source/infra/font/KaTeX_Size2-Regular.ttf diff --git a/source/infra/font/KaTeX_Size2-Regular.woff b/source/infra/font/KaTeX_Size2-Regular.woff Binary files differnew file mode 100644 index 0000000..d241d9b --- /dev/null +++ b/source/infra/font/KaTeX_Size2-Regular.woff diff --git a/source/infra/font/KaTeX_Size2-Regular.woff2 b/source/infra/font/KaTeX_Size2-Regular.woff2 Binary files differnew file mode 100644 index 0000000..e1bccfe --- /dev/null +++ b/source/infra/font/KaTeX_Size2-Regular.woff2 diff --git a/source/infra/font/KaTeX_Size3-Regular.ttf b/source/infra/font/KaTeX_Size3-Regular.ttf Binary files differnew file mode 100644 index 0000000..00bff34 --- /dev/null +++ b/source/infra/font/KaTeX_Size3-Regular.ttf diff --git a/source/infra/font/KaTeX_Size3-Regular.woff b/source/infra/font/KaTeX_Size3-Regular.woff Binary files differnew file mode 100644 index 0000000..e6e9b65 --- /dev/null +++ b/source/infra/font/KaTeX_Size3-Regular.woff diff --git a/source/infra/font/KaTeX_Size3-Regular.woff2 b/source/infra/font/KaTeX_Size3-Regular.woff2 Binary files differnew file mode 100644 index 0000000..249a286 --- /dev/null +++ b/source/infra/font/KaTeX_Size3-Regular.woff2 diff --git a/source/infra/font/KaTeX_Size4-Regular.ttf b/source/infra/font/KaTeX_Size4-Regular.ttf Binary files differnew file mode 100644 index 0000000..74f0892 --- /dev/null +++ b/source/infra/font/KaTeX_Size4-Regular.ttf diff --git a/source/infra/font/KaTeX_Size4-Regular.woff b/source/infra/font/KaTeX_Size4-Regular.woff Binary files differnew file mode 100644 index 0000000..e1ec545 --- /dev/null +++ b/source/infra/font/KaTeX_Size4-Regular.woff diff --git a/source/infra/font/KaTeX_Size4-Regular.woff2 b/source/infra/font/KaTeX_Size4-Regular.woff2 Binary files differnew file mode 100644 index 0000000..680c130 --- /dev/null +++ b/source/infra/font/KaTeX_Size4-Regular.woff2 diff --git a/source/infra/font/KaTeX_Typewriter-Regular.ttf b/source/infra/font/KaTeX_Typewriter-Regular.ttf Binary files differnew file mode 100644 index 0000000..c83252c --- /dev/null +++ b/source/infra/font/KaTeX_Typewriter-Regular.ttf diff --git a/source/infra/font/KaTeX_Typewriter-Regular.woff b/source/infra/font/KaTeX_Typewriter-Regular.woff Binary files differnew file mode 100644 index 0000000..2432419 --- /dev/null +++ b/source/infra/font/KaTeX_Typewriter-Regular.woff diff --git a/source/infra/font/KaTeX_Typewriter-Regular.woff2 b/source/infra/font/KaTeX_Typewriter-Regular.woff2 Binary files differnew file mode 100644 index 0000000..771f1af --- /dev/null +++ b/source/infra/font/KaTeX_Typewriter-Regular.woff2 diff --git a/source/infra/image/favicon.ico b/source/infra/image/favicon.ico Binary files differnew file mode 100644 index 0000000..49450b2 --- /dev/null +++ b/source/infra/image/favicon.ico diff --git a/source/infra/image/logo256.png b/source/infra/image/logo256.png Binary files differnew file mode 100644 index 0000000..d6b9961 --- /dev/null +++ b/source/infra/image/logo256.png diff --git a/source/infra/image/logo96x64.gif b/source/infra/image/logo96x64.gif Binary files differnew file mode 100644 index 0000000..869890b --- /dev/null +++ b/source/infra/image/logo96x64.gif diff --git a/source/infra/js/katex.min.js b/source/infra/js/katex.min.js new file mode 100644 index 0000000..f5fc1c1 --- /dev/null +++ b/source/infra/js/katex.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.katex=t():e.katex=t()}("undefined"!=typeof self?self:this,(function(){return function(){"use strict";var e={d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t={};e.d(t,{default:function(){return Qn}});var r=function e(t,r){this.position=void 0;var n,a="KaTeX parse error: "+t,i=r&&r.loc;if(i&&i.start<=i.end){var o=i.lexer.input;n=i.start;var s=i.end;n===o.length?a+=" at end of input: ":a+=" at position "+(n+1)+": ";var l=o.slice(n,s).replace(/[^]/g,"$&\u0332");a+=(n>15?"\u2026"+o.slice(n-15,n):o.slice(0,n))+l+(s+15<o.length?o.slice(s,s+15)+"\u2026":o.slice(s))}var h=new Error(a);return h.name="ParseError",h.__proto__=e.prototype,h.position=n,h};r.prototype.__proto__=Error.prototype;var n=r,a=/([A-Z])/g,i={"&":"&",">":">","<":"<",'"':""","'":"'"},o=/[&><"']/g;var s=function e(t){return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},l={contains:function(e,t){return-1!==e.indexOf(t)},deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace(o,(function(e){return i[e]}))},hyphenate:function(e){return e.replace(a,"-$1").toLowerCase()},getBaseElem:s,isCharacterBox:function(e){var t=s(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){var t=/^\s*([^\\/#]*?)(?::|�*58|�*3a)/i.exec(e);return null!=t?t[1]:"_relative"}},h={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:function(e){return"#"+e}},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:function(e,t){return t.push(e),t}},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:function(e){return Math.max(0,e)},cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:function(e){return Math.max(0,e)},cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:function(e){return Math.max(0,e)},cli:"-e, --max-expand <n>",cliProcessor:function(e){return"Infinity"===e?1/0:parseInt(e)}},globalGroup:{type:"boolean",cli:!1}};function c(e){if(e.default)return e.default;var t=e.type,r=Array.isArray(t)?t[0]:t;if("string"!=typeof r)return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}var m=function(){function e(e){for(var t in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},h)if(h.hasOwnProperty(t)){var r=h[t];this[t]=void 0!==e[t]?r.processor?r.processor(e[t]):e[t]:c(r)}}var t=e.prototype;return t.reportNonstrict=function(e,t,r){var a=this.strict;if("function"==typeof a&&(a=a(e,t,r)),a&&"ignore"!==a){if(!0===a||"error"===a)throw new n("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",r);"warn"===a?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+a+"': "+t+" ["+e+"]")}},t.useStrictBehavior=function(e,t,r){var n=this.strict;if("function"==typeof n)try{n=n(e,t,r)}catch(e){n="error"}return!(!n||"ignore"===n)&&(!0===n||"error"===n||("warn"===n?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+n+"': "+t+" ["+e+"]"),!1)))},t.isTrusted=function(e){e.url&&!e.protocol&&(e.protocol=l.protocolFromUrl(e.url));var t="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(t)},e}(),u=function(){function e(e,t,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=r}var t=e.prototype;return t.sup=function(){return p[d[this.id]]},t.sub=function(){return p[f[this.id]]},t.fracNum=function(){return p[g[this.id]]},t.fracDen=function(){return p[v[this.id]]},t.cramp=function(){return p[y[this.id]]},t.text=function(){return p[b[this.id]]},t.isTight=function(){return this.size>=2},e}(),p=[new u(0,0,!1),new u(1,0,!0),new u(2,1,!1),new u(3,1,!0),new u(4,2,!1),new u(5,2,!0),new u(6,3,!1),new u(7,3,!0)],d=[4,5,4,5,6,7,6,7],f=[5,5,5,5,7,7,7,7],g=[2,3,4,5,6,7,6,7],v=[3,3,5,5,7,7,7,7],y=[1,1,3,3,5,5,7,7],b=[0,1,2,3,2,3,2,3],x={DISPLAY:p[0],TEXT:p[2],SCRIPT:p[4],SCRIPTSCRIPT:p[6]},w=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];var k=[];function S(e){for(var t=0;t<k.length;t+=2)if(e>=k[t]&&e<=k[t+1])return!0;return!1}w.forEach((function(e){return e.blocks.forEach((function(e){return k.push.apply(k,e)}))}));var M=80,z={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"},A=function(){function e(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}var t=e.prototype;return t.hasClass=function(e){return l.contains(this.classes,e)},t.toNode=function(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e},t.toMarkup=function(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e},t.toText=function(){var e=function(e){return e.toText()};return this.children.map(e).join("")},e}(),T={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},B={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},C={"\xc5":"A","\xd0":"D","\xde":"o","\xe5":"a","\xf0":"d","\xfe":"o","\u0410":"A","\u0411":"B","\u0412":"B","\u0413":"F","\u0414":"A","\u0415":"E","\u0416":"K","\u0417":"3","\u0418":"N","\u0419":"N","\u041a":"K","\u041b":"N","\u041c":"M","\u041d":"H","\u041e":"O","\u041f":"N","\u0420":"P","\u0421":"C","\u0422":"T","\u0423":"y","\u0424":"O","\u0425":"X","\u0426":"U","\u0427":"h","\u0428":"W","\u0429":"W","\u042a":"B","\u042b":"X","\u042c":"B","\u042d":"3","\u042e":"X","\u042f":"R","\u0430":"a","\u0431":"b","\u0432":"a","\u0433":"r","\u0434":"y","\u0435":"e","\u0436":"m","\u0437":"e","\u0438":"n","\u0439":"n","\u043a":"n","\u043b":"n","\u043c":"m","\u043d":"n","\u043e":"o","\u043f":"n","\u0440":"p","\u0441":"c","\u0442":"o","\u0443":"y","\u0444":"b","\u0445":"x","\u0446":"n","\u0447":"n","\u0448":"w","\u0449":"w","\u044a":"a","\u044b":"m","\u044c":"a","\u044d":"e","\u044e":"m","\u044f":"r"};function N(e,t,r){if(!T[t])throw new Error("Font metrics not found for font: "+t+".");var n=e.charCodeAt(0),a=T[t][n];if(!a&&e[0]in C&&(n=C[e[0]].charCodeAt(0),a=T[t][n]),a||"text"!==r||S(n)&&(a=T[t][77]),a)return{depth:a[0],height:a[1],italic:a[2],skew:a[3],width:a[4]}}var q={};var I=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],R=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],H=function(e,t){return t.size<2?e:I[e-1][t.size-1]},O=function(){function e(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||e.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=R[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}var t=e.prototype;return t.extend=function(t){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);return new e(r)},t.havingStyle=function(e){return this.style===e?this:this.extend({style:e,size:H(this.textSize,e)})},t.havingCrampedStyle=function(){return this.havingStyle(this.style.cramp())},t.havingSize=function(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:R[e-1]})},t.havingBaseStyle=function(t){t=t||this.style.text();var r=H(e.BASESIZE,t);return this.size===r&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:r})},t.havingBaseSizing=function(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})},t.withColor=function(e){return this.extend({color:e})},t.withPhantom=function(){return this.extend({phantom:!0})},t.withFont=function(e){return this.extend({font:e})},t.withTextFontFamily=function(e){return this.extend({fontFamily:e,font:""})},t.withTextFontWeight=function(e){return this.extend({fontWeight:e,font:""})},t.withTextFontShape=function(e){return this.extend({fontShape:e,font:""})},t.sizingClasses=function(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]},t.baseSizingClasses=function(){return this.size!==e.BASESIZE?["sizing","reset-size"+this.size,"size"+e.BASESIZE]:[]},t.fontMetrics=function(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!q[t=e>=5?0:e>=3?1:2]){var r=q[t]={cssEmPerMu:B.quad[t]/18};for(var n in B)B.hasOwnProperty(n)&&(r[n]=B[n][t])}return q[t]}(this.size)),this._fontMetrics},t.getColor=function(){return this.phantom?"transparent":this.color},e}();O.BASESIZE=6;var E=O,L={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},D={ex:!0,em:!0,mu:!0},V=function(e){return"string"!=typeof e&&(e=e.unit),e in L||e in D||"ex"===e},P=function(e,t){var r;if(e.unit in L)r=L[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)r=t.fontMetrics().cssEmPerMu;else{var a;if(a=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)r=a.fontMetrics().xHeight;else{if("em"!==e.unit)throw new n("Invalid unit: '"+e.unit+"'");r=a.fontMetrics().quad}a!==t&&(r*=a.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*r,t.maxSize)},F=function(e){return+e.toFixed(4)+"em"},G=function(e){return e.filter((function(e){return e})).join(" ")},U=function(e,t,r){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var n=t.getColor();n&&(this.style.color=n)}},Y=function(e){var t=document.createElement(e);for(var r in t.className=G(this.classes),this.style)this.style.hasOwnProperty(r)&&(t.style[r]=this.style[r]);for(var n in this.attributes)this.attributes.hasOwnProperty(n)&&t.setAttribute(n,this.attributes[n]);for(var a=0;a<this.children.length;a++)t.appendChild(this.children[a].toNode());return t},X=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+l.escape(G(this.classes))+'"');var r="";for(var n in this.style)this.style.hasOwnProperty(n)&&(r+=l.hyphenate(n)+":"+this.style[n]+";");for(var a in r&&(t+=' style="'+l.escape(r)+'"'),this.attributes)this.attributes.hasOwnProperty(a)&&(t+=" "+a+'="'+l.escape(this.attributes[a])+'"');t+=">";for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+="</"+e+">"},W=function(){function e(e,t,r,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,U.call(this,e,r,n),this.children=t||[]}var t=e.prototype;return t.setAttribute=function(e,t){this.attributes[e]=t},t.hasClass=function(e){return l.contains(this.classes,e)},t.toNode=function(){return Y.call(this,"span")},t.toMarkup=function(){return X.call(this,"span")},e}(),_=function(){function e(e,t,r,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,U.call(this,t,n),this.children=r||[],this.setAttribute("href",e)}var t=e.prototype;return t.setAttribute=function(e,t){this.attributes[e]=t},t.hasClass=function(e){return l.contains(this.classes,e)},t.toNode=function(){return Y.call(this,"a")},t.toMarkup=function(){return X.call(this,"a")},e}(),j=function(){function e(e,t,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=r}var t=e.prototype;return t.hasClass=function(e){return l.contains(this.classes,e)},t.toNode=function(){var e=document.createElement("img");for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e},t.toMarkup=function(){var e="<img src='"+this.src+" 'alt='"+this.alt+"' ",t="";for(var r in this.style)this.style.hasOwnProperty(r)&&(t+=l.hyphenate(r)+":"+this.style[r]+";");return t&&(e+=' style="'+l.escape(t)+'"'),e+="'/>"},e}(),$={"\xee":"\u0131\u0302","\xef":"\u0131\u0308","\xed":"\u0131\u0301","\xec":"\u0131\u0300"},Z=function(){function e(e,t,r,n,a,i,o,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=r||0,this.italic=n||0,this.skew=a||0,this.width=i||0,this.classes=o||[],this.style=s||{},this.maxFontSize=0;var l=function(e){for(var t=0;t<w.length;t++)for(var r=w[t],n=0;n<r.blocks.length;n++){var a=r.blocks[n];if(e>=a[0]&&e<=a[1])return r.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[\xee\xef\xed\xec]/.test(this.text)&&(this.text=$[this.text])}var t=e.prototype;return t.hasClass=function(e){return l.contains(this.classes,e)},t.toNode=function(){var e=document.createTextNode(this.text),t=null;for(var r in this.italic>0&&((t=document.createElement("span")).style.marginRight=F(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=G(this.classes)),this.style)this.style.hasOwnProperty(r)&&((t=t||document.createElement("span")).style[r]=this.style[r]);return t?(t.appendChild(e),t):e},t.toMarkup=function(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=l.escape(G(this.classes)),t+='"');var r="";for(var n in this.italic>0&&(r+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(n)&&(r+=l.hyphenate(n)+":"+this.style[n]+";");r&&(e=!0,t+=' style="'+l.escape(r)+'"');var a=l.escape(this.text);return e?(t+=">",t+=a,t+="</span>"):a},e}(),K=function(){function e(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}var t=e.prototype;return t.toNode=function(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var r=0;r<this.children.length;r++)e.appendChild(this.children[r].toNode());return e},t.toMarkup=function(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+"='"+this.attributes[t]+"'");e+=">";for(var r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e+="</svg>"},e}(),J=function(){function e(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}var t=e.prototype;return t.toNode=function(){var e=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?e.setAttribute("d",this.alternate):e.setAttribute("d",z[this.pathName]),e},t.toMarkup=function(){return this.alternate?"<path d='"+this.alternate+"'/>":"<path d='"+z[this.pathName]+"'/>"},e}(),Q=function(){function e(e){this.attributes=void 0,this.attributes=e||{}}var t=e.prototype;return t.toNode=function(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e},t.toMarkup=function(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+"='"+this.attributes[t]+"'");return e+="/>"},e}();function ee(e){if(e instanceof Z)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}var te={bin:1,close:1,inner:1,open:1,punct:1,rel:1},re={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},ne={math:{},text:{}},ae=ne;function ie(e,t,r,n,a,i){ne[e][a]={font:t,group:r,replace:n},i&&n&&(ne[e][n]=ne[e][a])}var oe="math",se="text",le="main",he="ams",ce="accent-token",me="bin",ue="close",pe="inner",de="mathord",fe="op-token",ge="open",ve="punct",ye="rel",be="spacing",xe="textord";ie(oe,le,ye,"\u2261","\\equiv",!0),ie(oe,le,ye,"\u227a","\\prec",!0),ie(oe,le,ye,"\u227b","\\succ",!0),ie(oe,le,ye,"\u223c","\\sim",!0),ie(oe,le,ye,"\u22a5","\\perp"),ie(oe,le,ye,"\u2aaf","\\preceq",!0),ie(oe,le,ye,"\u2ab0","\\succeq",!0),ie(oe,le,ye,"\u2243","\\simeq",!0),ie(oe,le,ye,"\u2223","\\mid",!0),ie(oe,le,ye,"\u226a","\\ll",!0),ie(oe,le,ye,"\u226b","\\gg",!0),ie(oe,le,ye,"\u224d","\\asymp",!0),ie(oe,le,ye,"\u2225","\\parallel"),ie(oe,le,ye,"\u22c8","\\bowtie",!0),ie(oe,le,ye,"\u2323","\\smile",!0),ie(oe,le,ye,"\u2291","\\sqsubseteq",!0),ie(oe,le,ye,"\u2292","\\sqsupseteq",!0),ie(oe,le,ye,"\u2250","\\doteq",!0),ie(oe,le,ye,"\u2322","\\frown",!0),ie(oe,le,ye,"\u220b","\\ni",!0),ie(oe,le,ye,"\u221d","\\propto",!0),ie(oe,le,ye,"\u22a2","\\vdash",!0),ie(oe,le,ye,"\u22a3","\\dashv",!0),ie(oe,le,ye,"\u220b","\\owns"),ie(oe,le,ve,".","\\ldotp"),ie(oe,le,ve,"\u22c5","\\cdotp"),ie(oe,le,xe,"#","\\#"),ie(se,le,xe,"#","\\#"),ie(oe,le,xe,"&","\\&"),ie(se,le,xe,"&","\\&"),ie(oe,le,xe,"\u2135","\\aleph",!0),ie(oe,le,xe,"\u2200","\\forall",!0),ie(oe,le,xe,"\u210f","\\hbar",!0),ie(oe,le,xe,"\u2203","\\exists",!0),ie(oe,le,xe,"\u2207","\\nabla",!0),ie(oe,le,xe,"\u266d","\\flat",!0),ie(oe,le,xe,"\u2113","\\ell",!0),ie(oe,le,xe,"\u266e","\\natural",!0),ie(oe,le,xe,"\u2663","\\clubsuit",!0),ie(oe,le,xe,"\u2118","\\wp",!0),ie(oe,le,xe,"\u266f","\\sharp",!0),ie(oe,le,xe,"\u2662","\\diamondsuit",!0),ie(oe,le,xe,"\u211c","\\Re",!0),ie(oe,le,xe,"\u2661","\\heartsuit",!0),ie(oe,le,xe,"\u2111","\\Im",!0),ie(oe,le,xe,"\u2660","\\spadesuit",!0),ie(oe,le,xe,"\xa7","\\S",!0),ie(se,le,xe,"\xa7","\\S"),ie(oe,le,xe,"\xb6","\\P",!0),ie(se,le,xe,"\xb6","\\P"),ie(oe,le,xe,"\u2020","\\dag"),ie(se,le,xe,"\u2020","\\dag"),ie(se,le,xe,"\u2020","\\textdagger"),ie(oe,le,xe,"\u2021","\\ddag"),ie(se,le,xe,"\u2021","\\ddag"),ie(se,le,xe,"\u2021","\\textdaggerdbl"),ie(oe,le,ue,"\u23b1","\\rmoustache",!0),ie(oe,le,ge,"\u23b0","\\lmoustache",!0),ie(oe,le,ue,"\u27ef","\\rgroup",!0),ie(oe,le,ge,"\u27ee","\\lgroup",!0),ie(oe,le,me,"\u2213","\\mp",!0),ie(oe,le,me,"\u2296","\\ominus",!0),ie(oe,le,me,"\u228e","\\uplus",!0),ie(oe,le,me,"\u2293","\\sqcap",!0),ie(oe,le,me,"\u2217","\\ast"),ie(oe,le,me,"\u2294","\\sqcup",!0),ie(oe,le,me,"\u25ef","\\bigcirc",!0),ie(oe,le,me,"\u2219","\\bullet",!0),ie(oe,le,me,"\u2021","\\ddagger"),ie(oe,le,me,"\u2240","\\wr",!0),ie(oe,le,me,"\u2a3f","\\amalg"),ie(oe,le,me,"&","\\And"),ie(oe,le,ye,"\u27f5","\\longleftarrow",!0),ie(oe,le,ye,"\u21d0","\\Leftarrow",!0),ie(oe,le,ye,"\u27f8","\\Longleftarrow",!0),ie(oe,le,ye,"\u27f6","\\longrightarrow",!0),ie(oe,le,ye,"\u21d2","\\Rightarrow",!0),ie(oe,le,ye,"\u27f9","\\Longrightarrow",!0),ie(oe,le,ye,"\u2194","\\leftrightarrow",!0),ie(oe,le,ye,"\u27f7","\\longleftrightarrow",!0),ie(oe,le,ye,"\u21d4","\\Leftrightarrow",!0),ie(oe,le,ye,"\u27fa","\\Longleftrightarrow",!0),ie(oe,le,ye,"\u21a6","\\mapsto",!0),ie(oe,le,ye,"\u27fc","\\longmapsto",!0),ie(oe,le,ye,"\u2197","\\nearrow",!0),ie(oe,le,ye,"\u21a9","\\hookleftarrow",!0),ie(oe,le,ye,"\u21aa","\\hookrightarrow",!0),ie(oe,le,ye,"\u2198","\\searrow",!0),ie(oe,le,ye,"\u21bc","\\leftharpoonup",!0),ie(oe,le,ye,"\u21c0","\\rightharpoonup",!0),ie(oe,le,ye,"\u2199","\\swarrow",!0),ie(oe,le,ye,"\u21bd","\\leftharpoondown",!0),ie(oe,le,ye,"\u21c1","\\rightharpoondown",!0),ie(oe,le,ye,"\u2196","\\nwarrow",!0),ie(oe,le,ye,"\u21cc","\\rightleftharpoons",!0),ie(oe,he,ye,"\u226e","\\nless",!0),ie(oe,he,ye,"\ue010","\\@nleqslant"),ie(oe,he,ye,"\ue011","\\@nleqq"),ie(oe,he,ye,"\u2a87","\\lneq",!0),ie(oe,he,ye,"\u2268","\\lneqq",!0),ie(oe,he,ye,"\ue00c","\\@lvertneqq"),ie(oe,he,ye,"\u22e6","\\lnsim",!0),ie(oe,he,ye,"\u2a89","\\lnapprox",!0),ie(oe,he,ye,"\u2280","\\nprec",!0),ie(oe,he,ye,"\u22e0","\\npreceq",!0),ie(oe,he,ye,"\u22e8","\\precnsim",!0),ie(oe,he,ye,"\u2ab9","\\precnapprox",!0),ie(oe,he,ye,"\u2241","\\nsim",!0),ie(oe,he,ye,"\ue006","\\@nshortmid"),ie(oe,he,ye,"\u2224","\\nmid",!0),ie(oe,he,ye,"\u22ac","\\nvdash",!0),ie(oe,he,ye,"\u22ad","\\nvDash",!0),ie(oe,he,ye,"\u22ea","\\ntriangleleft"),ie(oe,he,ye,"\u22ec","\\ntrianglelefteq",!0),ie(oe,he,ye,"\u228a","\\subsetneq",!0),ie(oe,he,ye,"\ue01a","\\@varsubsetneq"),ie(oe,he,ye,"\u2acb","\\subsetneqq",!0),ie(oe,he,ye,"\ue017","\\@varsubsetneqq"),ie(oe,he,ye,"\u226f","\\ngtr",!0),ie(oe,he,ye,"\ue00f","\\@ngeqslant"),ie(oe,he,ye,"\ue00e","\\@ngeqq"),ie(oe,he,ye,"\u2a88","\\gneq",!0),ie(oe,he,ye,"\u2269","\\gneqq",!0),ie(oe,he,ye,"\ue00d","\\@gvertneqq"),ie(oe,he,ye,"\u22e7","\\gnsim",!0),ie(oe,he,ye,"\u2a8a","\\gnapprox",!0),ie(oe,he,ye,"\u2281","\\nsucc",!0),ie(oe,he,ye,"\u22e1","\\nsucceq",!0),ie(oe,he,ye,"\u22e9","\\succnsim",!0),ie(oe,he,ye,"\u2aba","\\succnapprox",!0),ie(oe,he,ye,"\u2246","\\ncong",!0),ie(oe,he,ye,"\ue007","\\@nshortparallel"),ie(oe,he,ye,"\u2226","\\nparallel",!0),ie(oe,he,ye,"\u22af","\\nVDash",!0),ie(oe,he,ye,"\u22eb","\\ntriangleright"),ie(oe,he,ye,"\u22ed","\\ntrianglerighteq",!0),ie(oe,he,ye,"\ue018","\\@nsupseteqq"),ie(oe,he,ye,"\u228b","\\supsetneq",!0),ie(oe,he,ye,"\ue01b","\\@varsupsetneq"),ie(oe,he,ye,"\u2acc","\\supsetneqq",!0),ie(oe,he,ye,"\ue019","\\@varsupsetneqq"),ie(oe,he,ye,"\u22ae","\\nVdash",!0),ie(oe,he,ye,"\u2ab5","\\precneqq",!0),ie(oe,he,ye,"\u2ab6","\\succneqq",!0),ie(oe,he,ye,"\ue016","\\@nsubseteqq"),ie(oe,he,me,"\u22b4","\\unlhd"),ie(oe,he,me,"\u22b5","\\unrhd"),ie(oe,he,ye,"\u219a","\\nleftarrow",!0),ie(oe,he,ye,"\u219b","\\nrightarrow",!0),ie(oe,he,ye,"\u21cd","\\nLeftarrow",!0),ie(oe,he,ye,"\u21cf","\\nRightarrow",!0),ie(oe,he,ye,"\u21ae","\\nleftrightarrow",!0),ie(oe,he,ye,"\u21ce","\\nLeftrightarrow",!0),ie(oe,he,ye,"\u25b3","\\vartriangle"),ie(oe,he,xe,"\u210f","\\hslash"),ie(oe,he,xe,"\u25bd","\\triangledown"),ie(oe,he,xe,"\u25ca","\\lozenge"),ie(oe,he,xe,"\u24c8","\\circledS"),ie(oe,he,xe,"\xae","\\circledR"),ie(se,he,xe,"\xae","\\circledR"),ie(oe,he,xe,"\u2221","\\measuredangle",!0),ie(oe,he,xe,"\u2204","\\nexists"),ie(oe,he,xe,"\u2127","\\mho"),ie(oe,he,xe,"\u2132","\\Finv",!0),ie(oe,he,xe,"\u2141","\\Game",!0),ie(oe,he,xe,"\u2035","\\backprime"),ie(oe,he,xe,"\u25b2","\\blacktriangle"),ie(oe,he,xe,"\u25bc","\\blacktriangledown"),ie(oe,he,xe,"\u25a0","\\blacksquare"),ie(oe,he,xe,"\u29eb","\\blacklozenge"),ie(oe,he,xe,"\u2605","\\bigstar"),ie(oe,he,xe,"\u2222","\\sphericalangle",!0),ie(oe,he,xe,"\u2201","\\complement",!0),ie(oe,he,xe,"\xf0","\\eth",!0),ie(se,le,xe,"\xf0","\xf0"),ie(oe,he,xe,"\u2571","\\diagup"),ie(oe,he,xe,"\u2572","\\diagdown"),ie(oe,he,xe,"\u25a1","\\square"),ie(oe,he,xe,"\u25a1","\\Box"),ie(oe,he,xe,"\u25ca","\\Diamond"),ie(oe,he,xe,"\xa5","\\yen",!0),ie(se,he,xe,"\xa5","\\yen",!0),ie(oe,he,xe,"\u2713","\\checkmark",!0),ie(se,he,xe,"\u2713","\\checkmark"),ie(oe,he,xe,"\u2136","\\beth",!0),ie(oe,he,xe,"\u2138","\\daleth",!0),ie(oe,he,xe,"\u2137","\\gimel",!0),ie(oe,he,xe,"\u03dd","\\digamma",!0),ie(oe,he,xe,"\u03f0","\\varkappa"),ie(oe,he,ge,"\u250c","\\@ulcorner",!0),ie(oe,he,ue,"\u2510","\\@urcorner",!0),ie(oe,he,ge,"\u2514","\\@llcorner",!0),ie(oe,he,ue,"\u2518","\\@lrcorner",!0),ie(oe,he,ye,"\u2266","\\leqq",!0),ie(oe,he,ye,"\u2a7d","\\leqslant",!0),ie(oe,he,ye,"\u2a95","\\eqslantless",!0),ie(oe,he,ye,"\u2272","\\lesssim",!0),ie(oe,he,ye,"\u2a85","\\lessapprox",!0),ie(oe,he,ye,"\u224a","\\approxeq",!0),ie(oe,he,me,"\u22d6","\\lessdot"),ie(oe,he,ye,"\u22d8","\\lll",!0),ie(oe,he,ye,"\u2276","\\lessgtr",!0),ie(oe,he,ye,"\u22da","\\lesseqgtr",!0),ie(oe,he,ye,"\u2a8b","\\lesseqqgtr",!0),ie(oe,he,ye,"\u2251","\\doteqdot"),ie(oe,he,ye,"\u2253","\\risingdotseq",!0),ie(oe,he,ye,"\u2252","\\fallingdotseq",!0),ie(oe,he,ye,"\u223d","\\backsim",!0),ie(oe,he,ye,"\u22cd","\\backsimeq",!0),ie(oe,he,ye,"\u2ac5","\\subseteqq",!0),ie(oe,he,ye,"\u22d0","\\Subset",!0),ie(oe,he,ye,"\u228f","\\sqsubset",!0),ie(oe,he,ye,"\u227c","\\preccurlyeq",!0),ie(oe,he,ye,"\u22de","\\curlyeqprec",!0),ie(oe,he,ye,"\u227e","\\precsim",!0),ie(oe,he,ye,"\u2ab7","\\precapprox",!0),ie(oe,he,ye,"\u22b2","\\vartriangleleft"),ie(oe,he,ye,"\u22b4","\\trianglelefteq"),ie(oe,he,ye,"\u22a8","\\vDash",!0),ie(oe,he,ye,"\u22aa","\\Vvdash",!0),ie(oe,he,ye,"\u2323","\\smallsmile"),ie(oe,he,ye,"\u2322","\\smallfrown"),ie(oe,he,ye,"\u224f","\\bumpeq",!0),ie(oe,he,ye,"\u224e","\\Bumpeq",!0),ie(oe,he,ye,"\u2267","\\geqq",!0),ie(oe,he,ye,"\u2a7e","\\geqslant",!0),ie(oe,he,ye,"\u2a96","\\eqslantgtr",!0),ie(oe,he,ye,"\u2273","\\gtrsim",!0),ie(oe,he,ye,"\u2a86","\\gtrapprox",!0),ie(oe,he,me,"\u22d7","\\gtrdot"),ie(oe,he,ye,"\u22d9","\\ggg",!0),ie(oe,he,ye,"\u2277","\\gtrless",!0),ie(oe,he,ye,"\u22db","\\gtreqless",!0),ie(oe,he,ye,"\u2a8c","\\gtreqqless",!0),ie(oe,he,ye,"\u2256","\\eqcirc",!0),ie(oe,he,ye,"\u2257","\\circeq",!0),ie(oe,he,ye,"\u225c","\\triangleq",!0),ie(oe,he,ye,"\u223c","\\thicksim"),ie(oe,he,ye,"\u2248","\\thickapprox"),ie(oe,he,ye,"\u2ac6","\\supseteqq",!0),ie(oe,he,ye,"\u22d1","\\Supset",!0),ie(oe,he,ye,"\u2290","\\sqsupset",!0),ie(oe,he,ye,"\u227d","\\succcurlyeq",!0),ie(oe,he,ye,"\u22df","\\curlyeqsucc",!0),ie(oe,he,ye,"\u227f","\\succsim",!0),ie(oe,he,ye,"\u2ab8","\\succapprox",!0),ie(oe,he,ye,"\u22b3","\\vartriangleright"),ie(oe,he,ye,"\u22b5","\\trianglerighteq"),ie(oe,he,ye,"\u22a9","\\Vdash",!0),ie(oe,he,ye,"\u2223","\\shortmid"),ie(oe,he,ye,"\u2225","\\shortparallel"),ie(oe,he,ye,"\u226c","\\between",!0),ie(oe,he,ye,"\u22d4","\\pitchfork",!0),ie(oe,he,ye,"\u221d","\\varpropto"),ie(oe,he,ye,"\u25c0","\\blacktriangleleft"),ie(oe,he,ye,"\u2234","\\therefore",!0),ie(oe,he,ye,"\u220d","\\backepsilon"),ie(oe,he,ye,"\u25b6","\\blacktriangleright"),ie(oe,he,ye,"\u2235","\\because",!0),ie(oe,he,ye,"\u22d8","\\llless"),ie(oe,he,ye,"\u22d9","\\gggtr"),ie(oe,he,me,"\u22b2","\\lhd"),ie(oe,he,me,"\u22b3","\\rhd"),ie(oe,he,ye,"\u2242","\\eqsim",!0),ie(oe,le,ye,"\u22c8","\\Join"),ie(oe,he,ye,"\u2251","\\Doteq",!0),ie(oe,he,me,"\u2214","\\dotplus",!0),ie(oe,he,me,"\u2216","\\smallsetminus"),ie(oe,he,me,"\u22d2","\\Cap",!0),ie(oe,he,me,"\u22d3","\\Cup",!0),ie(oe,he,me,"\u2a5e","\\doublebarwedge",!0),ie(oe,he,me,"\u229f","\\boxminus",!0),ie(oe,he,me,"\u229e","\\boxplus",!0),ie(oe,he,me,"\u22c7","\\divideontimes",!0),ie(oe,he,me,"\u22c9","\\ltimes",!0),ie(oe,he,me,"\u22ca","\\rtimes",!0),ie(oe,he,me,"\u22cb","\\leftthreetimes",!0),ie(oe,he,me,"\u22cc","\\rightthreetimes",!0),ie(oe,he,me,"\u22cf","\\curlywedge",!0),ie(oe,he,me,"\u22ce","\\curlyvee",!0),ie(oe,he,me,"\u229d","\\circleddash",!0),ie(oe,he,me,"\u229b","\\circledast",!0),ie(oe,he,me,"\u22c5","\\centerdot"),ie(oe,he,me,"\u22ba","\\intercal",!0),ie(oe,he,me,"\u22d2","\\doublecap"),ie(oe,he,me,"\u22d3","\\doublecup"),ie(oe,he,me,"\u22a0","\\boxtimes",!0),ie(oe,he,ye,"\u21e2","\\dashrightarrow",!0),ie(oe,he,ye,"\u21e0","\\dashleftarrow",!0),ie(oe,he,ye,"\u21c7","\\leftleftarrows",!0),ie(oe,he,ye,"\u21c6","\\leftrightarrows",!0),ie(oe,he,ye,"\u21da","\\Lleftarrow",!0),ie(oe,he,ye,"\u219e","\\twoheadleftarrow",!0),ie(oe,he,ye,"\u21a2","\\leftarrowtail",!0),ie(oe,he,ye,"\u21ab","\\looparrowleft",!0),ie(oe,he,ye,"\u21cb","\\leftrightharpoons",!0),ie(oe,he,ye,"\u21b6","\\curvearrowleft",!0),ie(oe,he,ye,"\u21ba","\\circlearrowleft",!0),ie(oe,he,ye,"\u21b0","\\Lsh",!0),ie(oe,he,ye,"\u21c8","\\upuparrows",!0),ie(oe,he,ye,"\u21bf","\\upharpoonleft",!0),ie(oe,he,ye,"\u21c3","\\downharpoonleft",!0),ie(oe,le,ye,"\u22b6","\\origof",!0),ie(oe,le,ye,"\u22b7","\\imageof",!0),ie(oe,he,ye,"\u22b8","\\multimap",!0),ie(oe,he,ye,"\u21ad","\\leftrightsquigarrow",!0),ie(oe,he,ye,"\u21c9","\\rightrightarrows",!0),ie(oe,he,ye,"\u21c4","\\rightleftarrows",!0),ie(oe,he,ye,"\u21a0","\\twoheadrightarrow",!0),ie(oe,he,ye,"\u21a3","\\rightarrowtail",!0),ie(oe,he,ye,"\u21ac","\\looparrowright",!0),ie(oe,he,ye,"\u21b7","\\curvearrowright",!0),ie(oe,he,ye,"\u21bb","\\circlearrowright",!0),ie(oe,he,ye,"\u21b1","\\Rsh",!0),ie(oe,he,ye,"\u21ca","\\downdownarrows",!0),ie(oe,he,ye,"\u21be","\\upharpoonright",!0),ie(oe,he,ye,"\u21c2","\\downharpoonright",!0),ie(oe,he,ye,"\u21dd","\\rightsquigarrow",!0),ie(oe,he,ye,"\u21dd","\\leadsto"),ie(oe,he,ye,"\u21db","\\Rrightarrow",!0),ie(oe,he,ye,"\u21be","\\restriction"),ie(oe,le,xe,"\u2018","`"),ie(oe,le,xe,"$","\\$"),ie(se,le,xe,"$","\\$"),ie(se,le,xe,"$","\\textdollar"),ie(oe,le,xe,"%","\\%"),ie(se,le,xe,"%","\\%"),ie(oe,le,xe,"_","\\_"),ie(se,le,xe,"_","\\_"),ie(se,le,xe,"_","\\textunderscore"),ie(oe,le,xe,"\u2220","\\angle",!0),ie(oe,le,xe,"\u221e","\\infty",!0),ie(oe,le,xe,"\u2032","\\prime"),ie(oe,le,xe,"\u25b3","\\triangle"),ie(oe,le,xe,"\u0393","\\Gamma",!0),ie(oe,le,xe,"\u0394","\\Delta",!0),ie(oe,le,xe,"\u0398","\\Theta",!0),ie(oe,le,xe,"\u039b","\\Lambda",!0),ie(oe,le,xe,"\u039e","\\Xi",!0),ie(oe,le,xe,"\u03a0","\\Pi",!0),ie(oe,le,xe,"\u03a3","\\Sigma",!0),ie(oe,le,xe,"\u03a5","\\Upsilon",!0),ie(oe,le,xe,"\u03a6","\\Phi",!0),ie(oe,le,xe,"\u03a8","\\Psi",!0),ie(oe,le,xe,"\u03a9","\\Omega",!0),ie(oe,le,xe,"A","\u0391"),ie(oe,le,xe,"B","\u0392"),ie(oe,le,xe,"E","\u0395"),ie(oe,le,xe,"Z","\u0396"),ie(oe,le,xe,"H","\u0397"),ie(oe,le,xe,"I","\u0399"),ie(oe,le,xe,"K","\u039a"),ie(oe,le,xe,"M","\u039c"),ie(oe,le,xe,"N","\u039d"),ie(oe,le,xe,"O","\u039f"),ie(oe,le,xe,"P","\u03a1"),ie(oe,le,xe,"T","\u03a4"),ie(oe,le,xe,"X","\u03a7"),ie(oe,le,xe,"\xac","\\neg",!0),ie(oe,le,xe,"\xac","\\lnot"),ie(oe,le,xe,"\u22a4","\\top"),ie(oe,le,xe,"\u22a5","\\bot"),ie(oe,le,xe,"\u2205","\\emptyset"),ie(oe,he,xe,"\u2205","\\varnothing"),ie(oe,le,de,"\u03b1","\\alpha",!0),ie(oe,le,de,"\u03b2","\\beta",!0),ie(oe,le,de,"\u03b3","\\gamma",!0),ie(oe,le,de,"\u03b4","\\delta",!0),ie(oe,le,de,"\u03f5","\\epsilon",!0),ie(oe,le,de,"\u03b6","\\zeta",!0),ie(oe,le,de,"\u03b7","\\eta",!0),ie(oe,le,de,"\u03b8","\\theta",!0),ie(oe,le,de,"\u03b9","\\iota",!0),ie(oe,le,de,"\u03ba","\\kappa",!0),ie(oe,le,de,"\u03bb","\\lambda",!0),ie(oe,le,de,"\u03bc","\\mu",!0),ie(oe,le,de,"\u03bd","\\nu",!0),ie(oe,le,de,"\u03be","\\xi",!0),ie(oe,le,de,"\u03bf","\\omicron",!0),ie(oe,le,de,"\u03c0","\\pi",!0),ie(oe,le,de,"\u03c1","\\rho",!0),ie(oe,le,de,"\u03c3","\\sigma",!0),ie(oe,le,de,"\u03c4","\\tau",!0),ie(oe,le,de,"\u03c5","\\upsilon",!0),ie(oe,le,de,"\u03d5","\\phi",!0),ie(oe,le,de,"\u03c7","\\chi",!0),ie(oe,le,de,"\u03c8","\\psi",!0),ie(oe,le,de,"\u03c9","\\omega",!0),ie(oe,le,de,"\u03b5","\\varepsilon",!0),ie(oe,le,de,"\u03d1","\\vartheta",!0),ie(oe,le,de,"\u03d6","\\varpi",!0),ie(oe,le,de,"\u03f1","\\varrho",!0),ie(oe,le,de,"\u03c2","\\varsigma",!0),ie(oe,le,de,"\u03c6","\\varphi",!0),ie(oe,le,me,"\u2217","*",!0),ie(oe,le,me,"+","+"),ie(oe,le,me,"\u2212","-",!0),ie(oe,le,me,"\u22c5","\\cdot",!0),ie(oe,le,me,"\u2218","\\circ",!0),ie(oe,le,me,"\xf7","\\div",!0),ie(oe,le,me,"\xb1","\\pm",!0),ie(oe,le,me,"\xd7","\\times",!0),ie(oe,le,me,"\u2229","\\cap",!0),ie(oe,le,me,"\u222a","\\cup",!0),ie(oe,le,me,"\u2216","\\setminus",!0),ie(oe,le,me,"\u2227","\\land"),ie(oe,le,me,"\u2228","\\lor"),ie(oe,le,me,"\u2227","\\wedge",!0),ie(oe,le,me,"\u2228","\\vee",!0),ie(oe,le,xe,"\u221a","\\surd"),ie(oe,le,ge,"\u27e8","\\langle",!0),ie(oe,le,ge,"\u2223","\\lvert"),ie(oe,le,ge,"\u2225","\\lVert"),ie(oe,le,ue,"?","?"),ie(oe,le,ue,"!","!"),ie(oe,le,ue,"\u27e9","\\rangle",!0),ie(oe,le,ue,"\u2223","\\rvert"),ie(oe,le,ue,"\u2225","\\rVert"),ie(oe,le,ye,"=","="),ie(oe,le,ye,":",":"),ie(oe,le,ye,"\u2248","\\approx",!0),ie(oe,le,ye,"\u2245","\\cong",!0),ie(oe,le,ye,"\u2265","\\ge"),ie(oe,le,ye,"\u2265","\\geq",!0),ie(oe,le,ye,"\u2190","\\gets"),ie(oe,le,ye,">","\\gt",!0),ie(oe,le,ye,"\u2208","\\in",!0),ie(oe,le,ye,"\ue020","\\@not"),ie(oe,le,ye,"\u2282","\\subset",!0),ie(oe,le,ye,"\u2283","\\supset",!0),ie(oe,le,ye,"\u2286","\\subseteq",!0),ie(oe,le,ye,"\u2287","\\supseteq",!0),ie(oe,he,ye,"\u2288","\\nsubseteq",!0),ie(oe,he,ye,"\u2289","\\nsupseteq",!0),ie(oe,le,ye,"\u22a8","\\models"),ie(oe,le,ye,"\u2190","\\leftarrow",!0),ie(oe,le,ye,"\u2264","\\le"),ie(oe,le,ye,"\u2264","\\leq",!0),ie(oe,le,ye,"<","\\lt",!0),ie(oe,le,ye,"\u2192","\\rightarrow",!0),ie(oe,le,ye,"\u2192","\\to"),ie(oe,he,ye,"\u2271","\\ngeq",!0),ie(oe,he,ye,"\u2270","\\nleq",!0),ie(oe,le,be,"\xa0","\\ "),ie(oe,le,be,"\xa0","\\space"),ie(oe,le,be,"\xa0","\\nobreakspace"),ie(se,le,be,"\xa0","\\ "),ie(se,le,be,"\xa0"," "),ie(se,le,be,"\xa0","\\space"),ie(se,le,be,"\xa0","\\nobreakspace"),ie(oe,le,be,null,"\\nobreak"),ie(oe,le,be,null,"\\allowbreak"),ie(oe,le,ve,",",","),ie(oe,le,ve,";",";"),ie(oe,he,me,"\u22bc","\\barwedge",!0),ie(oe,he,me,"\u22bb","\\veebar",!0),ie(oe,le,me,"\u2299","\\odot",!0),ie(oe,le,me,"\u2295","\\oplus",!0),ie(oe,le,me,"\u2297","\\otimes",!0),ie(oe,le,xe,"\u2202","\\partial",!0),ie(oe,le,me,"\u2298","\\oslash",!0),ie(oe,he,me,"\u229a","\\circledcirc",!0),ie(oe,he,me,"\u22a1","\\boxdot",!0),ie(oe,le,me,"\u25b3","\\bigtriangleup"),ie(oe,le,me,"\u25bd","\\bigtriangledown"),ie(oe,le,me,"\u2020","\\dagger"),ie(oe,le,me,"\u22c4","\\diamond"),ie(oe,le,me,"\u22c6","\\star"),ie(oe,le,me,"\u25c3","\\triangleleft"),ie(oe,le,me,"\u25b9","\\triangleright"),ie(oe,le,ge,"{","\\{"),ie(se,le,xe,"{","\\{"),ie(se,le,xe,"{","\\textbraceleft"),ie(oe,le,ue,"}","\\}"),ie(se,le,xe,"}","\\}"),ie(se,le,xe,"}","\\textbraceright"),ie(oe,le,ge,"{","\\lbrace"),ie(oe,le,ue,"}","\\rbrace"),ie(oe,le,ge,"[","\\lbrack",!0),ie(se,le,xe,"[","\\lbrack",!0),ie(oe,le,ue,"]","\\rbrack",!0),ie(se,le,xe,"]","\\rbrack",!0),ie(oe,le,ge,"(","\\lparen",!0),ie(oe,le,ue,")","\\rparen",!0),ie(se,le,xe,"<","\\textless",!0),ie(se,le,xe,">","\\textgreater",!0),ie(oe,le,ge,"\u230a","\\lfloor",!0),ie(oe,le,ue,"\u230b","\\rfloor",!0),ie(oe,le,ge,"\u2308","\\lceil",!0),ie(oe,le,ue,"\u2309","\\rceil",!0),ie(oe,le,xe,"\\","\\backslash"),ie(oe,le,xe,"\u2223","|"),ie(oe,le,xe,"\u2223","\\vert"),ie(se,le,xe,"|","\\textbar",!0),ie(oe,le,xe,"\u2225","\\|"),ie(oe,le,xe,"\u2225","\\Vert"),ie(se,le,xe,"\u2225","\\textbardbl"),ie(se,le,xe,"~","\\textasciitilde"),ie(se,le,xe,"\\","\\textbackslash"),ie(se,le,xe,"^","\\textasciicircum"),ie(oe,le,ye,"\u2191","\\uparrow",!0),ie(oe,le,ye,"\u21d1","\\Uparrow",!0),ie(oe,le,ye,"\u2193","\\downarrow",!0),ie(oe,le,ye,"\u21d3","\\Downarrow",!0),ie(oe,le,ye,"\u2195","\\updownarrow",!0),ie(oe,le,ye,"\u21d5","\\Updownarrow",!0),ie(oe,le,fe,"\u2210","\\coprod"),ie(oe,le,fe,"\u22c1","\\bigvee"),ie(oe,le,fe,"\u22c0","\\bigwedge"),ie(oe,le,fe,"\u2a04","\\biguplus"),ie(oe,le,fe,"\u22c2","\\bigcap"),ie(oe,le,fe,"\u22c3","\\bigcup"),ie(oe,le,fe,"\u222b","\\int"),ie(oe,le,fe,"\u222b","\\intop"),ie(oe,le,fe,"\u222c","\\iint"),ie(oe,le,fe,"\u222d","\\iiint"),ie(oe,le,fe,"\u220f","\\prod"),ie(oe,le,fe,"\u2211","\\sum"),ie(oe,le,fe,"\u2a02","\\bigotimes"),ie(oe,le,fe,"\u2a01","\\bigoplus"),ie(oe,le,fe,"\u2a00","\\bigodot"),ie(oe,le,fe,"\u222e","\\oint"),ie(oe,le,fe,"\u222f","\\oiint"),ie(oe,le,fe,"\u2230","\\oiiint"),ie(oe,le,fe,"\u2a06","\\bigsqcup"),ie(oe,le,fe,"\u222b","\\smallint"),ie(se,le,pe,"\u2026","\\textellipsis"),ie(oe,le,pe,"\u2026","\\mathellipsis"),ie(se,le,pe,"\u2026","\\ldots",!0),ie(oe,le,pe,"\u2026","\\ldots",!0),ie(oe,le,pe,"\u22ef","\\@cdots",!0),ie(oe,le,pe,"\u22f1","\\ddots",!0),ie(oe,le,xe,"\u22ee","\\varvdots"),ie(oe,le,ce,"\u02ca","\\acute"),ie(oe,le,ce,"\u02cb","\\grave"),ie(oe,le,ce,"\xa8","\\ddot"),ie(oe,le,ce,"~","\\tilde"),ie(oe,le,ce,"\u02c9","\\bar"),ie(oe,le,ce,"\u02d8","\\breve"),ie(oe,le,ce,"\u02c7","\\check"),ie(oe,le,ce,"^","\\hat"),ie(oe,le,ce,"\u20d7","\\vec"),ie(oe,le,ce,"\u02d9","\\dot"),ie(oe,le,ce,"\u02da","\\mathring"),ie(oe,le,de,"\ue131","\\@imath"),ie(oe,le,de,"\ue237","\\@jmath"),ie(oe,le,xe,"\u0131","\u0131"),ie(oe,le,xe,"\u0237","\u0237"),ie(se,le,xe,"\u0131","\\i",!0),ie(se,le,xe,"\u0237","\\j",!0),ie(se,le,xe,"\xdf","\\ss",!0),ie(se,le,xe,"\xe6","\\ae",!0),ie(se,le,xe,"\u0153","\\oe",!0),ie(se,le,xe,"\xf8","\\o",!0),ie(se,le,xe,"\xc6","\\AE",!0),ie(se,le,xe,"\u0152","\\OE",!0),ie(se,le,xe,"\xd8","\\O",!0),ie(se,le,ce,"\u02ca","\\'"),ie(se,le,ce,"\u02cb","\\`"),ie(se,le,ce,"\u02c6","\\^"),ie(se,le,ce,"\u02dc","\\~"),ie(se,le,ce,"\u02c9","\\="),ie(se,le,ce,"\u02d8","\\u"),ie(se,le,ce,"\u02d9","\\."),ie(se,le,ce,"\xb8","\\c"),ie(se,le,ce,"\u02da","\\r"),ie(se,le,ce,"\u02c7","\\v"),ie(se,le,ce,"\xa8",'\\"'),ie(se,le,ce,"\u02dd","\\H"),ie(se,le,ce,"\u25ef","\\textcircled");var we={"--":!0,"---":!0,"``":!0,"''":!0};ie(se,le,xe,"\u2013","--",!0),ie(se,le,xe,"\u2013","\\textendash"),ie(se,le,xe,"\u2014","---",!0),ie(se,le,xe,"\u2014","\\textemdash"),ie(se,le,xe,"\u2018","`",!0),ie(se,le,xe,"\u2018","\\textquoteleft"),ie(se,le,xe,"\u2019","'",!0),ie(se,le,xe,"\u2019","\\textquoteright"),ie(se,le,xe,"\u201c","``",!0),ie(se,le,xe,"\u201c","\\textquotedblleft"),ie(se,le,xe,"\u201d","''",!0),ie(se,le,xe,"\u201d","\\textquotedblright"),ie(oe,le,xe,"\xb0","\\degree",!0),ie(se,le,xe,"\xb0","\\degree"),ie(se,le,xe,"\xb0","\\textdegree",!0),ie(oe,le,xe,"\xa3","\\pounds"),ie(oe,le,xe,"\xa3","\\mathsterling",!0),ie(se,le,xe,"\xa3","\\pounds"),ie(se,le,xe,"\xa3","\\textsterling",!0),ie(oe,he,xe,"\u2720","\\maltese"),ie(se,he,xe,"\u2720","\\maltese");for(var ke='0123456789/@."',Se=0;Se<ke.length;Se++){var Me=ke.charAt(Se);ie(oe,le,xe,Me,Me)}for(var ze='0123456789!@*()-=+";:?/.,',Ae=0;Ae<ze.length;Ae++){var Te=ze.charAt(Ae);ie(se,le,xe,Te,Te)}for(var Be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ce=0;Ce<Be.length;Ce++){var Ne=Be.charAt(Ce);ie(oe,le,de,Ne,Ne),ie(se,le,xe,Ne,Ne)}ie(oe,he,xe,"C","\u2102"),ie(se,he,xe,"C","\u2102"),ie(oe,he,xe,"H","\u210d"),ie(se,he,xe,"H","\u210d"),ie(oe,he,xe,"N","\u2115"),ie(se,he,xe,"N","\u2115"),ie(oe,he,xe,"P","\u2119"),ie(se,he,xe,"P","\u2119"),ie(oe,he,xe,"Q","\u211a"),ie(se,he,xe,"Q","\u211a"),ie(oe,he,xe,"R","\u211d"),ie(se,he,xe,"R","\u211d"),ie(oe,he,xe,"Z","\u2124"),ie(se,he,xe,"Z","\u2124"),ie(oe,le,de,"h","\u210e"),ie(se,le,de,"h","\u210e");for(var qe="",Ie=0;Ie<Be.length;Ie++){var Re=Be.charAt(Ie);ie(oe,le,de,Re,qe=String.fromCharCode(55349,56320+Ie)),ie(se,le,xe,Re,qe),ie(oe,le,de,Re,qe=String.fromCharCode(55349,56372+Ie)),ie(se,le,xe,Re,qe),ie(oe,le,de,Re,qe=String.fromCharCode(55349,56424+Ie)),ie(se,le,xe,Re,qe),ie(oe,le,de,Re,qe=String.fromCharCode(55349,56580+Ie)),ie(se,le,xe,Re,qe),ie(oe,le,de,Re,qe=String.fromCharCode(55349,56736+Ie)),ie(se,le,xe,Re,qe),ie(oe,le,de,Re,qe=String.fromCharCode(55349,56788+Ie)),ie(se,le,xe,Re,qe),ie(oe,le,de,Re,qe=String.fromCharCode(55349,56840+Ie)),ie(se,le,xe,Re,qe),ie(oe,le,de,Re,qe=String.fromCharCode(55349,56944+Ie)),ie(se,le,xe,Re,qe),Ie<26&&(ie(oe,le,de,Re,qe=String.fromCharCode(55349,56632+Ie)),ie(se,le,xe,Re,qe),ie(oe,le,de,Re,qe=String.fromCharCode(55349,56476+Ie)),ie(se,le,xe,Re,qe))}ie(oe,le,de,"k",qe=String.fromCharCode(55349,56668)),ie(se,le,xe,"k",qe);for(var He=0;He<10;He++){var Oe=He.toString();ie(oe,le,de,Oe,qe=String.fromCharCode(55349,57294+He)),ie(se,le,xe,Oe,qe),ie(oe,le,de,Oe,qe=String.fromCharCode(55349,57314+He)),ie(se,le,xe,Oe,qe),ie(oe,le,de,Oe,qe=String.fromCharCode(55349,57324+He)),ie(se,le,xe,Oe,qe),ie(oe,le,de,Oe,qe=String.fromCharCode(55349,57334+He)),ie(se,le,xe,Oe,qe)}for(var Ee="\xd0\xde\xfe",Le=0;Le<Ee.length;Le++){var De=Ee.charAt(Le);ie(oe,le,de,De,De),ie(se,le,xe,De,De)}var Ve=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["","",""],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],Pe=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],Fe=function(e,t,r){return ae[r][e]&&ae[r][e].replace&&(e=ae[r][e].replace),{value:e,metrics:N(e,t,r)}},Ge=function(e,t,r,n,a){var i,o=Fe(e,t,r),s=o.metrics;if(e=o.value,s){var l=s.italic;("text"===r||n&&"mathit"===n.font)&&(l=0),i=new Z(e,s.height,s.depth,l,s.skew,s.width,a)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+r+"'"),i=new Z(e,0,0,0,0,0,a);if(n){i.maxFontSize=n.sizeMultiplier,n.style.isTight()&&i.classes.push("mtight");var h=n.getColor();h&&(i.style.color=h)}return i},Ue=function(e,t){if(G(e.classes)!==G(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(1===e.classes.length){var r=e.classes[0];if("mbin"===r||"mord"===r)return!1}for(var n in e.style)if(e.style.hasOwnProperty(n)&&e.style[n]!==t.style[n])return!1;for(var a in t.style)if(t.style.hasOwnProperty(a)&&e.style[a]!==t.style[a])return!1;return!0},Ye=function(e){for(var t=0,r=0,n=0,a=0;a<e.children.length;a++){var i=e.children[a];i.height>t&&(t=i.height),i.depth>r&&(r=i.depth),i.maxFontSize>n&&(n=i.maxFontSize)}e.height=t,e.depth=r,e.maxFontSize=n},Xe=function(e,t,r,n){var a=new W(e,t,r,n);return Ye(a),a},We=function(e,t,r,n){return new W(e,t,r,n)},_e=function(e){var t=new A(e);return Ye(t),t},je=function(e,t,r){var n="";switch(e){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=e}return n+"-"+("textbf"===t&&"textit"===r?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")},$e={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Ze={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Ke={fontMap:$e,makeSymbol:Ge,mathsym:function(e,t,r,n){return void 0===n&&(n=[]),"boldsymbol"===r.font&&Fe(e,"Main-Bold",t).metrics?Ge(e,"Main-Bold",t,r,n.concat(["mathbf"])):"\\"===e||"main"===ae[t][e].font?Ge(e,"Main-Regular",t,r,n):Ge(e,"AMS-Regular",t,r,n.concat(["amsrm"]))},makeSpan:Xe,makeSvgSpan:We,makeLineSpan:function(e,t,r){var n=Xe([e],[],t);return n.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),n.style.borderBottomWidth=F(n.height),n.maxFontSize=1,n},makeAnchor:function(e,t,r,n){var a=new _(e,t,r,n);return Ye(a),a},makeFragment:_e,wrapFragment:function(e,t){return e instanceof A?Xe([],[e],t):e},makeVList:function(e,t){for(var r=function(e){if("individualShift"===e.positionType){for(var t=e.children,r=[t[0]],n=-t[0].shift-t[0].elem.depth,a=n,i=1;i<t.length;i++){var o=-t[i].shift-a-t[i].elem.depth,s=o-(t[i-1].elem.height+t[i-1].elem.depth);a+=o,r.push({type:"kern",size:s}),r.push(t[i])}return{children:r,depth:n}}var l;if("top"===e.positionType){for(var h=e.positionData,c=0;c<e.children.length;c++){var m=e.children[c];h-="kern"===m.type?m.size:m.elem.height+m.elem.depth}l=h}else if("bottom"===e.positionType)l=-e.positionData;else{var u=e.children[0];if("elem"!==u.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)l=-u.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");l=-u.elem.depth}}return{children:e.children,depth:l}}(e),n=r.children,a=r.depth,i=0,o=0;o<n.length;o++){var s=n[o];if("elem"===s.type){var l=s.elem;i=Math.max(i,l.maxFontSize,l.height)}}i+=2;var h=Xe(["pstrut"],[]);h.style.height=F(i);for(var c=[],m=a,u=a,p=a,d=0;d<n.length;d++){var f=n[d];if("kern"===f.type)p+=f.size;else{var g=f.elem,v=f.wrapperClasses||[],y=f.wrapperStyle||{},b=Xe(v,[h,g],void 0,y);b.style.top=F(-i-p-g.depth),f.marginLeft&&(b.style.marginLeft=f.marginLeft),f.marginRight&&(b.style.marginRight=f.marginRight),c.push(b),p+=g.height+g.depth}m=Math.min(m,p),u=Math.max(u,p)}var x,w=Xe(["vlist"],c);if(w.style.height=F(u),m<0){var k=Xe([],[]),S=Xe(["vlist"],[k]);S.style.height=F(-m);var M=Xe(["vlist-s"],[new Z("\u200b")]);x=[Xe(["vlist-r"],[w,M]),Xe(["vlist-r"],[S])]}else x=[Xe(["vlist-r"],[w])];var z=Xe(["vlist-t"],x);return 2===x.length&&z.classes.push("vlist-t2"),z.height=u,z.depth=-m,z},makeOrd:function(e,t,r){var a=e.mode,i=e.text,o=["mord"],s="math"===a||"text"===a&&t.font,l=s?t.font:t.fontFamily;if(55349===i.charCodeAt(0)){var h=function(e,t){var r=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536,a="math"===t?0:1;if(119808<=r&&r<120484){var i=Math.floor((r-119808)/26);return[Ve[i][2],Ve[i][a]]}if(120782<=r&&r<=120831){var o=Math.floor((r-120782)/10);return[Pe[o][2],Pe[o][a]]}if(120485===r||120486===r)return[Ve[0][2],Ve[0][a]];if(120486<r&&r<120782)return["",""];throw new n("Unsupported character: "+e)}(i,a),c=h[0],m=h[1];return Ge(i,c,a,t,o.concat(m))}if(l){var u,p;if("boldsymbol"===l){var d=function(e,t,r,n,a){return"textord"!==a&&Fe(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(i,a,0,0,r);u=d.fontName,p=[d.fontClass]}else s?(u=$e[l].fontName,p=[l]):(u=je(l,t.fontWeight,t.fontShape),p=[l,t.fontWeight,t.fontShape]);if(Fe(i,u,a).metrics)return Ge(i,u,a,t,o.concat(p));if(we.hasOwnProperty(i)&&"Typewriter"===u.slice(0,10)){for(var f=[],g=0;g<i.length;g++)f.push(Ge(i[g],u,a,t,o.concat(p)));return _e(f)}}if("mathord"===r)return Ge(i,"Math-Italic",a,t,o.concat(["mathnormal"]));if("textord"===r){var v=ae[a][i]&&ae[a][i].font;if("ams"===v){var y=je("amsrm",t.fontWeight,t.fontShape);return Ge(i,y,a,t,o.concat("amsrm",t.fontWeight,t.fontShape))}if("main"!==v&&v){var b=je(v,t.fontWeight,t.fontShape);return Ge(i,b,a,t,o.concat(b,t.fontWeight,t.fontShape))}var x=je("textrm",t.fontWeight,t.fontShape);return Ge(i,x,a,t,o.concat(t.fontWeight,t.fontShape))}throw new Error("unexpected type: "+r+" in makeOrd")},makeGlue:function(e,t){var r=Xe(["mspace"],[],t),n=P(e,t);return r.style.marginRight=F(n),r},staticSvg:function(e,t){var r=Ze[e],n=r[0],a=r[1],i=r[2],o=new J(n),s=new K([o],{width:F(a),height:F(i),style:"width:"+F(a),viewBox:"0 0 "+1e3*a+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),l=We(["overlay"],[s],t);return l.height=i,l.style.height=F(i),l.style.width=F(a),l},svgData:Ze,tryCombineChars:function(e){for(var t=0;t<e.length-1;t++){var r=e[t],n=e[t+1];r instanceof Z&&n instanceof Z&&Ue(r,n)&&(r.text+=n.text,r.height=Math.max(r.height,n.height),r.depth=Math.max(r.depth,n.depth),r.italic=n.italic,e.splice(t+1,1),t--)}return e}},Je={number:3,unit:"mu"},Qe={number:4,unit:"mu"},et={number:5,unit:"mu"},tt={mord:{mop:Je,mbin:Qe,mrel:et,minner:Je},mop:{mord:Je,mop:Je,mrel:et,minner:Je},mbin:{mord:Qe,mop:Qe,mopen:Qe,minner:Qe},mrel:{mord:et,mop:et,mopen:et,minner:et},mopen:{},mclose:{mop:Je,mbin:Qe,mrel:et,minner:Je},mpunct:{mord:Je,mop:Je,mrel:et,mopen:Je,mclose:Je,mpunct:Je,minner:Je},minner:{mord:Je,mop:Je,mbin:Qe,mrel:et,mopen:Je,mpunct:Je,minner:Je}},rt={mord:{mop:Je},mop:{mord:Je,mop:Je},mbin:{},mrel:{},mopen:{},mclose:{mop:Je},mpunct:{},minner:{mop:Je}},nt={},at={},it={};function ot(e){for(var t=e.type,r=e.names,n=e.props,a=e.handler,i=e.htmlBuilder,o=e.mathmlBuilder,s={type:t,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:void 0===n.allowedInMath||n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:a},l=0;l<r.length;++l)nt[r[l]]=s;t&&(i&&(at[t]=i),o&&(it[t]=o))}function st(e){ot({type:e.type,names:[],props:{numArgs:0},handler:function(){throw new Error("Should never be called.")},htmlBuilder:e.htmlBuilder,mathmlBuilder:e.mathmlBuilder})}var lt=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e},ht=function(e){return"ordgroup"===e.type?e.body:[e]},ct=Ke.makeSpan,mt=["leftmost","mbin","mopen","mrel","mop","mpunct"],ut=["rightmost","mrel","mclose","mpunct"],pt={display:x.DISPLAY,text:x.TEXT,script:x.SCRIPT,scriptscript:x.SCRIPTSCRIPT},dt={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},ft=function(e,t,r,n){void 0===n&&(n=[null,null]);for(var a=[],i=0;i<e.length;i++){var o=wt(e[i],t);if(o instanceof A){var s=o.children;a.push.apply(a,s)}else a.push(o)}if(Ke.tryCombineChars(a),!r)return a;var h=t;if(1===e.length){var c=e[0];"sizing"===c.type?h=t.havingSize(c.size):"styling"===c.type&&(h=t.havingStyle(pt[c.style]))}var m=ct([n[0]||"leftmost"],[],t),u=ct([n[1]||"rightmost"],[],t),p="root"===r;return gt(a,(function(e,t){var r=t.classes[0],n=e.classes[0];"mbin"===r&&l.contains(ut,n)?t.classes[0]="mord":"mbin"===n&&l.contains(mt,r)&&(e.classes[0]="mord")}),{node:m},u,p),gt(a,(function(e,t){var r=bt(t),n=bt(e),a=r&&n?e.hasClass("mtight")?rt[r][n]:tt[r][n]:null;if(a)return Ke.makeGlue(a,h)}),{node:m},u,p),a},gt=function e(t,r,n,a,i){a&&t.push(a);for(var o=0;o<t.length;o++){var s=t[o],l=vt(s);if(l)e(l.children,r,n,null,i);else{var h=!s.hasClass("mspace");if(h){var c=r(s,n.node);c&&(n.insertAfter?n.insertAfter(c):(t.unshift(c),o++))}h?n.node=s:i&&s.hasClass("newline")&&(n.node=ct(["leftmost"])),n.insertAfter=function(e){return function(r){t.splice(e+1,0,r),o++}}(o)}}a&&t.pop()},vt=function(e){return e instanceof A||e instanceof _||e instanceof W&&e.hasClass("enclosing")?e:null},yt=function e(t,r){var n=vt(t);if(n){var a=n.children;if(a.length){if("right"===r)return e(a[a.length-1],"right");if("left"===r)return e(a[0],"left")}}return t},bt=function(e,t){return e?(t&&(e=yt(e,t)),dt[e.classes[0]]||null):null},xt=function(e,t){var r=["nulldelimiter"].concat(e.baseSizingClasses());return ct(t.concat(r))},wt=function(e,t,r){if(!e)return ct();if(at[e.type]){var a=at[e.type](e,t);if(r&&t.size!==r.size){a=ct(t.sizingClasses(r),[a],t);var i=t.sizeMultiplier/r.sizeMultiplier;a.height*=i,a.depth*=i}return a}throw new n("Got group of unknown type: '"+e.type+"'")};function kt(e,t){var r=ct(["base"],e,t),n=ct(["strut"]);return n.style.height=F(r.height+r.depth),r.depth&&(n.style.verticalAlign=F(-r.depth)),r.children.unshift(n),r}function St(e,t){var r=null;1===e.length&&"tag"===e[0].type&&(r=e[0].tag,e=e[0].body);var n,a=ft(e,t,"root");2===a.length&&a[1].hasClass("tag")&&(n=a.pop());for(var i,o=[],s=[],l=0;l<a.length;l++)if(s.push(a[l]),a[l].hasClass("mbin")||a[l].hasClass("mrel")||a[l].hasClass("allowbreak")){for(var h=!1;l<a.length-1&&a[l+1].hasClass("mspace")&&!a[l+1].hasClass("newline");)l++,s.push(a[l]),a[l].hasClass("nobreak")&&(h=!0);h||(o.push(kt(s,t)),s=[])}else a[l].hasClass("newline")&&(s.pop(),s.length>0&&(o.push(kt(s,t)),s=[]),o.push(a[l]));s.length>0&&o.push(kt(s,t)),r?((i=kt(ft(r,t,!0))).classes=["tag"],o.push(i)):n&&o.push(n);var c=ct(["katex-html"],o);if(c.setAttribute("aria-hidden","true"),i){var m=i.children[0];m.style.height=F(c.height+c.depth),c.depth&&(m.style.verticalAlign=F(-c.depth))}return c}function Mt(e){return new A(e)}var zt=function(){function e(e,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=r||[]}var t=e.prototype;return t.setAttribute=function(e,t){this.attributes[e]=t},t.getAttribute=function(e){return this.attributes[e]},t.toNode=function(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=G(this.classes));for(var r=0;r<this.children.length;r++)e.appendChild(this.children[r].toNode());return e},t.toMarkup=function(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=l.escape(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+l.escape(G(this.classes))+'"'),e+=">";for(var r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e+="</"+this.type+">"},t.toText=function(){return this.children.map((function(e){return e.toText()})).join("")},e}(),At=function(){function e(e){this.text=void 0,this.text=e}var t=e.prototype;return t.toNode=function(){return document.createTextNode(this.text)},t.toMarkup=function(){return l.escape(this.toText())},t.toText=function(){return this.text},e}(),Tt={MathNode:zt,TextNode:At,SpaceNode:function(){function e(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?"\u200a":e>=.1666&&e<=.1667?"\u2009":e>=.2222&&e<=.2223?"\u2005":e>=.2777&&e<=.2778?"\u2005\u200a":e>=-.05556&&e<=-.05555?"\u200a\u2063":e>=-.1667&&e<=-.1666?"\u2009\u2063":e>=-.2223&&e<=-.2222?"\u205f\u2063":e>=-.2778&&e<=-.2777?"\u2005\u2063":null}var t=e.prototype;return t.toNode=function(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",F(this.width)),e},t.toMarkup=function(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+F(this.width)+'"/>'},t.toText=function(){return this.character?this.character:" "},e}(),newDocumentFragment:Mt},Bt=function(e,t,r){return!ae[t][e]||!ae[t][e].replace||55349===e.charCodeAt(0)||we.hasOwnProperty(e)&&r&&(r.fontFamily&&"tt"===r.fontFamily.slice(4,6)||r.font&&"tt"===r.font.slice(4,6))||(e=ae[t][e].replace),new Tt.TextNode(e)},Ct=function(e){return 1===e.length?e[0]:new Tt.MathNode("mrow",e)},Nt=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";var r=t.font;if(!r||"mathnormal"===r)return null;var n=e.mode;if("mathit"===r)return"italic";if("boldsymbol"===r)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===r)return"bold";if("mathbb"===r)return"double-struck";if("mathfrak"===r)return"fraktur";if("mathscr"===r||"mathcal"===r)return"script";if("mathsf"===r)return"sans-serif";if("mathtt"===r)return"monospace";var a=e.text;return l.contains(["\\imath","\\jmath"],a)?null:(ae[n][a]&&ae[n][a].replace&&(a=ae[n][a].replace),N(a,Ke.fontMap[r].fontName,n)?Ke.fontMap[r].variant:null)},qt=function(e,t,r){if(1===e.length){var n=Rt(e[0],t);return r&&n instanceof zt&&"mo"===n.type&&(n.setAttribute("lspace","0em"),n.setAttribute("rspace","0em")),[n]}for(var a,i=[],o=0;o<e.length;o++){var s=Rt(e[o],t);if(s instanceof zt&&a instanceof zt){if("mtext"===s.type&&"mtext"===a.type&&s.getAttribute("mathvariant")===a.getAttribute("mathvariant")){var l;(l=a.children).push.apply(l,s.children);continue}if("mn"===s.type&&"mn"===a.type){var h;(h=a.children).push.apply(h,s.children);continue}if("mi"===s.type&&1===s.children.length&&"mn"===a.type){var c=s.children[0];if(c instanceof At&&"."===c.text){var m;(m=a.children).push.apply(m,s.children);continue}}else if("mi"===a.type&&1===a.children.length){var u=a.children[0];if(u instanceof At&&"\u0338"===u.text&&("mo"===s.type||"mi"===s.type||"mn"===s.type)){var p=s.children[0];p instanceof At&&p.text.length>0&&(p.text=p.text.slice(0,1)+"\u0338"+p.text.slice(1),i.pop())}}}i.push(s),a=s}return i},It=function(e,t,r){return Ct(qt(e,t,r))},Rt=function(e,t){if(!e)return new Tt.MathNode("mrow");if(it[e.type])return it[e.type](e,t);throw new n("Got group of unknown type: '"+e.type+"'")};function Ht(e,t,r,n,a){var i,o=qt(e,r);i=1===o.length&&o[0]instanceof zt&&l.contains(["mrow","mtable"],o[0].type)?o[0]:new Tt.MathNode("mrow",o);var s=new Tt.MathNode("annotation",[new Tt.TextNode(t)]);s.setAttribute("encoding","application/x-tex");var h=new Tt.MathNode("semantics",[i,s]),c=new Tt.MathNode("math",[h]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&c.setAttribute("display","block");var m=a?"katex":"katex-mathml";return Ke.makeSpan([m],[c])}var Ot=function(e){return new E({style:e.displayMode?x.DISPLAY:x.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},Et=function(e,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),e=Ke.makeSpan(r,[e])}return e},Lt=function(e,t,r){var n,a=Ot(r);if("mathml"===r.output)return Ht(e,t,a,r.displayMode,!0);if("html"===r.output){var i=St(e,a);n=Ke.makeSpan(["katex"],[i])}else{var o=Ht(e,t,a,r.displayMode,!1),s=St(e,a);n=Ke.makeSpan(["katex"],[o,s])}return Et(n,r)},Dt={widehat:"^",widecheck:"\u02c7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23df",overbrace:"\u23de",overgroup:"\u23e0",undergroup:"\u23e1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21d2",xRightarrow:"\u21d2",overleftharpoon:"\u21bc",xleftharpoonup:"\u21bc",overrightharpoon:"\u21c0",xrightharpoonup:"\u21c0",xLeftarrow:"\u21d0",xLeftrightarrow:"\u21d4",xhookleftarrow:"\u21a9",xhookrightarrow:"\u21aa",xmapsto:"\u21a6",xrightharpoondown:"\u21c1",xleftharpoondown:"\u21bd",xrightleftharpoons:"\u21cc",xleftrightharpoons:"\u21cb",xtwoheadleftarrow:"\u219e",xtwoheadrightarrow:"\u21a0",xlongequal:"=",xtofrom:"\u21c4",xrightleftarrows:"\u21c4",xrightequilibrium:"\u21cc",xleftequilibrium:"\u21cb","\\cdrightarrow":"\u2192","\\cdleftarrow":"\u2190","\\cdlongequal":"="},Vt={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Pt=function(e,t,r,n,a){var i,o=e.height+e.depth+r+n;if(/fbox|color|angl/.test(t)){if(i=Ke.makeSpan(["stretchy",t],[],a),"fbox"===t){var s=a.color&&a.getColor();s&&(i.style.borderColor=s)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new Q({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new Q({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new K(l,{width:"100%",height:F(o)});i=Ke.makeSvgSpan([],[h],a)}return i.height=o,i.style.height=F(o),i},Ft=function(e){var t=new Tt.MathNode("mo",[new Tt.TextNode(Dt[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Gt=function(e,t){var r=function(){var r=4e5,n=e.label.slice(1);if(l.contains(["widehat","widecheck","widetilde","utilde"],n)){var a,i,o,s="ordgroup"===(d=e.base).type?d.body.length:1;if(s>5)"widehat"===n||"widecheck"===n?(a=420,r=2364,o=.42,i=n+"4"):(a=312,r=2340,o=.34,i="tilde4");else{var h=[1,1,2,2,3,3][s];"widehat"===n||"widecheck"===n?(r=[0,1062,2364,2364,2364][h],a=[0,239,300,360,420][h],o=[0,.24,.3,.3,.36,.42][h],i=n+h):(r=[0,600,1033,2339,2340][h],a=[0,260,286,306,312][h],o=[0,.26,.286,.3,.306,.34][h],i="tilde"+h)}var c=new J(i),m=new K([c],{width:"100%",height:F(o),viewBox:"0 0 "+r+" "+a,preserveAspectRatio:"none"});return{span:Ke.makeSvgSpan([],[m],t),minWidth:0,height:o}}var u,p,d,f=[],g=Vt[n],v=g[0],y=g[1],b=g[2],x=b/1e3,w=v.length;if(1===w)u=["hide-tail"],p=[g[3]];else if(2===w)u=["halfarrow-left","halfarrow-right"],p=["xMinYMin","xMaxYMin"];else{if(3!==w)throw new Error("Correct katexImagesData or update code here to support\n "+w+" children.");u=["brace-left","brace-center","brace-right"],p=["xMinYMin","xMidYMin","xMaxYMin"]}for(var k=0;k<w;k++){var S=new J(v[k]),M=new K([S],{width:"400em",height:F(x),viewBox:"0 0 "+r+" "+b,preserveAspectRatio:p[k]+" slice"}),z=Ke.makeSvgSpan([u[k]],[M],t);if(1===w)return{span:z,minWidth:y,height:x};z.style.height=F(x),f.push(z)}return{span:Ke.makeSpan(["stretchy"],f,t),minWidth:y,height:x}}(),n=r.span,a=r.minWidth,i=r.height;return n.height=i,n.style.height=F(i),a>0&&(n.style.minWidth=F(a)),n};function Ut(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Yt(e){var t=Xt(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Xt(e){return e&&("atom"===e.type||re.hasOwnProperty(e.type))?e:null}var Wt=function(e,t){var r,n,a;e&&"supsub"===e.type?(r=(n=Ut(e.base,"accent")).base,e.base=r,a=function(e){if(e instanceof W)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(wt(e,t)),e.base=n):r=(n=Ut(e,"accent")).base;var i=wt(r,t.havingCrampedStyle()),o=0;if(n.isShifty&&l.isCharacterBox(r)){var s=l.getBaseElem(r);o=ee(wt(s,t.havingCrampedStyle())).skew}var h,c="\\c"===n.label,m=c?i.height+i.depth:Math.min(i.height,t.fontMetrics().xHeight);if(n.isStretchy)h=Gt(n,t),h=Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+F(2*o)+")",marginLeft:F(2*o)}:void 0}]},t);else{var u,p;"\\vec"===n.label?(u=Ke.staticSvg("vec",t),p=Ke.svgData.vec[1]):((u=ee(u=Ke.makeOrd({mode:n.mode,text:n.label},t,"textord"))).italic=0,p=u.width,c&&(m+=u.depth)),h=Ke.makeSpan(["accent-body"],[u]);var d="\\textcircled"===n.label;d&&(h.classes.push("accent-full"),m=i.height);var f=o;d||(f-=p/2),h.style.left=F(f),"\\textcircled"===n.label&&(h.style.top=".2em"),h=Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-m},{type:"elem",elem:h}]},t)}var g=Ke.makeSpan(["mord","accent"],[h],t);return a?(a.children[0]=g,a.height=Math.max(g.height,a.height),a.classes[0]="mord",a):g},_t=function(e,t){var r=e.isStretchy?Ft(e.label):new Tt.MathNode("mo",[Bt(e.label,e.mode)]),n=new Tt.MathNode("mover",[Rt(e.base,t),r]);return n.setAttribute("accent","true"),n},jt=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((function(e){return"\\"+e})).join("|"));ot({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:function(e,t){var r=lt(t[0]),n=!jt.test(e.funcName),a=!n||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:n,isShifty:a,base:r}},htmlBuilder:Wt,mathmlBuilder:_t}),ot({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:function(e,t){var r=t[0],n=e.parser.mode;return"math"===n&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:e.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:Wt,mathmlBuilder:_t}),ot({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"accentUnder",mode:r.mode,label:n,base:a}},htmlBuilder:function(e,t){var r=wt(e.base,t),n=Gt(e,t),a="\\utilde"===e.label?.12:0,i=Ke.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:a},{type:"elem",elem:r}]},t);return Ke.makeSpan(["mord","accentunder"],[i],t)},mathmlBuilder:function(e,t){var r=Ft(e.label),n=new Tt.MathNode("munder",[Rt(e.base,t),r]);return n.setAttribute("accentunder","true"),n}});var $t=function(e){var t=new Tt.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};ot({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler:function(e,t,r){var n=e.parser,a=e.funcName;return{type:"xArrow",mode:n.mode,label:a,body:t[0],below:r[0]}},htmlBuilder:function(e,t){var r,n=t.style,a=t.havingStyle(n.sup()),i=Ke.wrapFragment(wt(e.body,a,t),t),o="\\x"===e.label.slice(0,2)?"x":"cd";i.classes.push(o+"-arrow-pad"),e.below&&(a=t.havingStyle(n.sub()),(r=Ke.wrapFragment(wt(e.below,a,t),t)).classes.push(o+"-arrow-pad"));var s,l=Gt(e,t),h=-t.fontMetrics().axisHeight+.5*l.height,c=-t.fontMetrics().axisHeight-.5*l.height-.111;if((i.depth>.25||"\\xleftequilibrium"===e.label)&&(c-=i.depth),r){var m=-t.fontMetrics().axisHeight+r.height+.5*l.height+.111;s=Ke.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:l,shift:h},{type:"elem",elem:r,shift:m}]},t)}else s=Ke.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:l,shift:h}]},t);return s.children[0].children[0].children[1].classes.push("svg-align"),Ke.makeSpan(["mrel","x-arrow"],[s],t)},mathmlBuilder:function(e,t){var r,n=Ft(e.label);if(n.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var a=$t(Rt(e.body,t));if(e.below){var i=$t(Rt(e.below,t));r=new Tt.MathNode("munderover",[n,i,a])}else r=new Tt.MathNode("mover",[n,a])}else if(e.below){var o=$t(Rt(e.below,t));r=new Tt.MathNode("munder",[n,o])}else r=$t(),r=new Tt.MathNode("mover",[n,r]);return r}});var Zt=Ke.makeSpan;function Kt(e,t){var r=ft(e.body,t,!0);return Zt([e.mclass],r,t)}function Jt(e,t){var r,n=qt(e.body,t);return"minner"===e.mclass?r=new Tt.MathNode("mpadded",n):"mord"===e.mclass?e.isCharacterBox?(r=n[0]).type="mi":r=new Tt.MathNode("mi",n):(e.isCharacterBox?(r=n[0]).type="mo":r=new Tt.MathNode("mo",n),"mbin"===e.mclass?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):"mpunct"===e.mclass?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(r.attributes.lspace="0em",r.attributes.rspace="0em"):"minner"===e.mclass&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}ot({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:ht(a),isCharacterBox:l.isCharacterBox(a)}},htmlBuilder:Kt,mathmlBuilder:Jt});var Qt=function(e){var t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};ot({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler:function(e,t){return{type:"mclass",mode:e.parser.mode,mclass:Qt(t[0]),body:ht(t[1]),isCharacterBox:l.isCharacterBox(t[1])}}}),ot({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler:function(e,t){var r,n=e.parser,a=e.funcName,i=t[1],o=t[0];r="\\stackrel"!==a?Qt(i):"mrel";var s={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==a,body:ht(i)},h={type:"supsub",mode:o.mode,base:s,sup:"\\underset"===a?null:o,sub:"\\underset"===a?o:null};return{type:"mclass",mode:n.mode,mclass:r,body:[h],isCharacterBox:l.isCharacterBox(h)}},htmlBuilder:Kt,mathmlBuilder:Jt}),ot({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){return{type:"pmb",mode:e.parser.mode,mclass:Qt(t[0]),body:ht(t[0])}},htmlBuilder:function(e,t){var r=ft(e.body,t,!0),n=Ke.makeSpan([e.mclass],r,t);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder:function(e,t){var r=qt(e.body,t),n=new Tt.MathNode("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var er={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},tr=function(e){return"textord"===e.type&&"@"===e.text};function rr(e,t,r){var n=er[e];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var a={type:"atom",text:n,mode:"math",family:"rel"},i={type:"ordgroup",mode:"math",body:[r.callFunction("\\\\cdleft",[t[0]],[]),r.callFunction("\\Big",[a],[]),r.callFunction("\\\\cdright",[t[1]],[])]};return r.callFunction("\\\\cdparent",[i],[]);case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return r.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}ot({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=e.funcName;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:t[0]}},htmlBuilder:function(e,t){var r=t.havingStyle(t.style.sup()),n=Ke.wrapFragment(wt(e.label,r,t),t);return n.classes.push("cd-label-"+e.side),n.style.bottom=F(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mrow",[Rt(e.label,t)]);return(r=new Tt.MathNode("mpadded",[r])).setAttribute("width","0"),"left"===e.side&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),(r=new Tt.MathNode("mstyle",[r])).setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}}),ot({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler:function(e,t){return{type:"cdlabelparent",mode:e.parser.mode,fragment:t[0]}},htmlBuilder:function(e,t){var r=Ke.wrapFragment(wt(e.fragment,t),t);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder:function(e,t){return new Tt.MathNode("mrow",[Rt(e.fragment,t)])}}),ot({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){for(var r=e.parser,a=Ut(t[0],"ordgroup").body,i="",o=0;o<a.length;o++){i+=Ut(a[o],"textord").text}var s,l=parseInt(i);if(isNaN(l))throw new n("\\@char has non-numeric argument "+i);if(l<0||l>=1114111)throw new n("\\@char with invalid code point "+i);return l<=65535?s=String.fromCharCode(l):(l-=65536,s=String.fromCharCode(55296+(l>>10),56320+(1023&l))),{type:"textord",mode:r.mode,text:s}}});var nr=function(e,t){var r=ft(e.body,t.withColor(e.color),!1);return Ke.makeFragment(r)},ar=function(e,t){var r=qt(e.body,t.withColor(e.color)),n=new Tt.MathNode("mstyle",r);return n.setAttribute("mathcolor",e.color),n};ot({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler:function(e,t){var r=e.parser,n=Ut(t[0],"color-token").color,a=t[1];return{type:"color",mode:r.mode,color:n,body:ht(a)}},htmlBuilder:nr,mathmlBuilder:ar}),ot({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler:function(e,t){var r=e.parser,n=e.breakOnTokenText,a=Ut(t[0],"color-token").color;r.gullet.macros.set("\\current@color",a);var i=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:a,body:i}},htmlBuilder:nr,mathmlBuilder:ar}),ot({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:1,argTypes:["size"],allowedInText:!0},handler:function(e,t,r){var n=e.parser,a=r[0],i=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:i,size:a&&Ut(a,"size").value}},htmlBuilder:function(e,t){var r=Ke.makeSpan(["mspace"],[],t);return e.newLine&&(r.classes.push("newline"),e.size&&(r.style.marginTop=F(P(e.size,t)))),r},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mspace");return e.newLine&&(r.setAttribute("linebreak","newline"),e.size&&r.setAttribute("height",F(P(e.size,t)))),r}});var ir={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},or=function(e){var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new n("Expected a control sequence",e);return t},sr=function(e,t,r,n){var a=e.gullet.macros.get(r.text);null==a&&(r.noexpand=!0,a={tokens:[r],numArgs:0,unexpandable:!e.gullet.isExpandable(r.text)}),e.gullet.macros.set(t,a,n)};ot({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler:function(e){var t=e.parser,r=e.funcName;t.consumeSpaces();var a=t.fetch();if(ir[a.text])return"\\global"!==r&&"\\\\globallong"!==r||(a.text=ir[a.text]),Ut(t.parseFunction(),"internal");throw new n("Invalid token after macro prefix",a)}}),ot({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler:function(e){var t=e.parser,r=e.funcName,a=t.gullet.popToken(),i=a.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new n("Expected a control sequence",a);for(var o,s=0,l=[[]];"{"!==t.gullet.future().text;)if("#"===(a=t.gullet.popToken()).text){if("{"===t.gullet.future().text){o=t.gullet.future(),l[s].push("{");break}if(a=t.gullet.popToken(),!/^[1-9]$/.test(a.text))throw new n('Invalid argument number "'+a.text+'"');if(parseInt(a.text)!==s+1)throw new n('Argument number "'+a.text+'" out of order');s++,l.push([])}else{if("EOF"===a.text)throw new n("Expected a macro definition");l[s].push(a.text)}var h=t.gullet.consumeArg().tokens;return o&&h.unshift(o),"\\edef"!==r&&"\\xdef"!==r||(h=t.gullet.expandTokens(h)).reverse(),t.gullet.macros.set(i,{tokens:h,numArgs:s,delimiters:l},r===ir[r]),{type:"internal",mode:t.mode}}}),ot({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler:function(e){var t=e.parser,r=e.funcName,n=or(t.gullet.popToken());t.gullet.consumeSpaces();var a=function(e){var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t}(t);return sr(t,n,a,"\\\\globallet"===r),{type:"internal",mode:t.mode}}}),ot({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler:function(e){var t=e.parser,r=e.funcName,n=or(t.gullet.popToken()),a=t.gullet.popToken(),i=t.gullet.popToken();return sr(t,n,i,"\\\\globalfuture"===r),t.gullet.pushToken(i),t.gullet.pushToken(a),{type:"internal",mode:t.mode}}});var lr=function(e,t,r){var n=N(ae.math[e]&&ae.math[e].replace||e,t,r);if(!n)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return n},hr=function(e,t,r,n){var a=r.havingBaseStyle(t),i=Ke.makeSpan(n.concat(a.sizingClasses(r)),[e],r),o=a.sizeMultiplier/r.sizeMultiplier;return i.height*=o,i.depth*=o,i.maxFontSize=a.sizeMultiplier,i},cr=function(e,t,r){var n=t.havingBaseStyle(r),a=(1-t.sizeMultiplier/n.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=F(a),e.height-=a,e.depth+=a},mr=function(e,t,r,n,a,i){var o=function(e,t,r,n){return Ke.makeSymbol(e,"Size"+t+"-Regular",r,n)}(e,t,a,n),s=hr(Ke.makeSpan(["delimsizing","size"+t],[o],n),x.TEXT,n,i);return r&&cr(s,n,x.TEXT),s},ur=function(e,t,r){var n;return n="Size1-Regular"===t?"delim-size1":"delim-size4",{type:"elem",elem:Ke.makeSpan(["delimsizinginner",n],[Ke.makeSpan([],[Ke.makeSymbol(e,t,r)])])}},pr=function(e,t,r){var n=T["Size4-Regular"][e.charCodeAt(0)]?T["Size4-Regular"][e.charCodeAt(0)][4]:T["Size1-Regular"][e.charCodeAt(0)][4],a=new J("inner",function(e,t){switch(e){case"\u239c":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"\u2223":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"\u2225":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145zM367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z";case"\u239f":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"\u23a2":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"\u23a5":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"\u23aa":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"\u23d0":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"\u2016":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),i=new K([a],{width:F(n),height:F(t),style:"width:"+F(n),viewBox:"0 0 "+1e3*n+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=Ke.makeSvgSpan([],[i],r);return o.height=t,o.style.height=F(t),o.style.width=F(n),{type:"elem",elem:o}},dr={type:"kern",size:-.008},fr=["|","\\lvert","\\rvert","\\vert"],gr=["\\|","\\lVert","\\rVert","\\Vert"],vr=function(e,t,r,n,a,i){var o,s,h,c,m="",u=0;o=h=c=e,s=null;var p="Size1-Regular";"\\uparrow"===e?h=c="\u23d0":"\\Uparrow"===e?h=c="\u2016":"\\downarrow"===e?o=h="\u23d0":"\\Downarrow"===e?o=h="\u2016":"\\updownarrow"===e?(o="\\uparrow",h="\u23d0",c="\\downarrow"):"\\Updownarrow"===e?(o="\\Uparrow",h="\u2016",c="\\Downarrow"):l.contains(fr,e)?(h="\u2223",m="vert",u=333):l.contains(gr,e)?(h="\u2225",m="doublevert",u=556):"["===e||"\\lbrack"===e?(o="\u23a1",h="\u23a2",c="\u23a3",p="Size4-Regular",m="lbrack",u=667):"]"===e||"\\rbrack"===e?(o="\u23a4",h="\u23a5",c="\u23a6",p="Size4-Regular",m="rbrack",u=667):"\\lfloor"===e||"\u230a"===e?(h=o="\u23a2",c="\u23a3",p="Size4-Regular",m="lfloor",u=667):"\\lceil"===e||"\u2308"===e?(o="\u23a1",h=c="\u23a2",p="Size4-Regular",m="lceil",u=667):"\\rfloor"===e||"\u230b"===e?(h=o="\u23a5",c="\u23a6",p="Size4-Regular",m="rfloor",u=667):"\\rceil"===e||"\u2309"===e?(o="\u23a4",h=c="\u23a5",p="Size4-Regular",m="rceil",u=667):"("===e||"\\lparen"===e?(o="\u239b",h="\u239c",c="\u239d",p="Size4-Regular",m="lparen",u=875):")"===e||"\\rparen"===e?(o="\u239e",h="\u239f",c="\u23a0",p="Size4-Regular",m="rparen",u=875):"\\{"===e||"\\lbrace"===e?(o="\u23a7",s="\u23a8",c="\u23a9",h="\u23aa",p="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(o="\u23ab",s="\u23ac",c="\u23ad",h="\u23aa",p="Size4-Regular"):"\\lgroup"===e||"\u27ee"===e?(o="\u23a7",c="\u23a9",h="\u23aa",p="Size4-Regular"):"\\rgroup"===e||"\u27ef"===e?(o="\u23ab",c="\u23ad",h="\u23aa",p="Size4-Regular"):"\\lmoustache"===e||"\u23b0"===e?(o="\u23a7",c="\u23ad",h="\u23aa",p="Size4-Regular"):"\\rmoustache"!==e&&"\u23b1"!==e||(o="\u23ab",c="\u23a9",h="\u23aa",p="Size4-Regular");var d=lr(o,p,a),f=d.height+d.depth,g=lr(h,p,a),v=g.height+g.depth,y=lr(c,p,a),b=y.height+y.depth,w=0,k=1;if(null!==s){var S=lr(s,p,a);w=S.height+S.depth,k=2}var M=f+b+w,z=M+Math.max(0,Math.ceil((t-M)/(k*v)))*k*v,A=n.fontMetrics().axisHeight;r&&(A*=n.sizeMultiplier);var T=z/2-A,B=[];if(m.length>0){var C=z-f-b,N=Math.round(1e3*z),q=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(m,Math.round(1e3*C)),I=new J(m,q),R=(u/1e3).toFixed(3)+"em",H=(N/1e3).toFixed(3)+"em",O=new K([I],{width:R,height:H,viewBox:"0 0 "+u+" "+N}),E=Ke.makeSvgSpan([],[O],n);E.height=N/1e3,E.style.width=R,E.style.height=H,B.push({type:"elem",elem:E})}else{if(B.push(ur(c,p,a)),B.push(dr),null===s){var L=z-f-b+.016;B.push(pr(h,L,n))}else{var D=(z-f-b-w)/2+.016;B.push(pr(h,D,n)),B.push(dr),B.push(ur(s,p,a)),B.push(dr),B.push(pr(h,D,n))}B.push(dr),B.push(ur(o,p,a))}var V=n.havingBaseStyle(x.TEXT),P=Ke.makeVList({positionType:"bottom",positionData:T,children:B},V);return hr(Ke.makeSpan(["delimsizing","mult"],[P],V),x.TEXT,n,i)},yr=.08,br=function(e,t,r,n,a){var i=function(e,t,r){t*=1e3;var n="";switch(e){case"sqrtMain":n=function(e,t){return"M95,"+(622+e+t)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,M);break;case"sqrtSize1":n=function(e,t){return"M263,"+(601+e+t)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,M);break;case"sqrtSize2":n=function(e,t){return"M983 "+(10+e+t)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,M);break;case"sqrtSize3":n=function(e,t){return"M424,"+(2398+e+t)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" "+t+"\nh400000v"+(40+e)+"h-400000z"}(t,M);break;case"sqrtSize4":n=function(e,t){return"M473,"+(2713+e+t)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"}(t,M);break;case"sqrtTall":n=function(e,t,r){return"M702 "+(e+t)+"H400000"+(40+e)+"\nH742v"+(r-54-t-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+t+"H400000v"+(40+e)+"H742z"}(t,M,r)}return n}(e,n,r),o=new J(e,i),s=new K([o],{width:"400em",height:F(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return Ke.makeSvgSpan(["hide-tail"],[s],a)},xr=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230a","\u230b","\\lceil","\\rceil","\u2308","\u2309","\\surd"],wr=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27ee","\u27ef","\\lmoustache","\\rmoustache","\u23b0","\u23b1"],kr=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Sr=[0,1.2,1.8,2.4,3],Mr=[{type:"small",style:x.SCRIPTSCRIPT},{type:"small",style:x.SCRIPT},{type:"small",style:x.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],zr=[{type:"small",style:x.SCRIPTSCRIPT},{type:"small",style:x.SCRIPT},{type:"small",style:x.TEXT},{type:"stack"}],Ar=[{type:"small",style:x.SCRIPTSCRIPT},{type:"small",style:x.SCRIPT},{type:"small",style:x.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Tr=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},Br=function(e,t,r,n){for(var a=Math.min(2,3-n.style.size);a<r.length&&"stack"!==r[a].type;a++){var i=lr(e,Tr(r[a]),"math"),o=i.height+i.depth;if("small"===r[a].type&&(o*=n.havingBaseStyle(r[a].style).sizeMultiplier),o>t)return r[a]}return r[r.length-1]},Cr=function(e,t,r,n,a,i){var o;"<"===e||"\\lt"===e||"\u27e8"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"\u27e9"!==e||(e="\\rangle"),o=l.contains(kr,e)?Mr:l.contains(xr,e)?Ar:zr;var s=Br(e,t,o,n);return"small"===s.type?function(e,t,r,n,a,i){var o=Ke.makeSymbol(e,"Main-Regular",a,n),s=hr(o,t,n,i);return r&&cr(s,n,t),s}(e,s.style,r,n,a,i):"large"===s.type?mr(e,s.size,r,n,a,i):vr(e,t,r,n,a,i)},Nr={sqrtImage:function(e,t){var r,n,a=t.havingBaseSizing(),i=Br("\\surd",e*a.sizeMultiplier,Ar,a),o=a.sizeMultiplier,s=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l=0,h=0,c=0;return"small"===i.type?(e<1?o=1:e<1.4&&(o=.7),h=(1+s)/o,(r=br("sqrtMain",l=(1+s+yr)/o,c=1e3+1e3*s+80,s,t)).style.minWidth="0.853em",n=.833/o):"large"===i.type?(c=1080*Sr[i.size],h=(Sr[i.size]+s)/o,l=(Sr[i.size]+s+yr)/o,(r=br("sqrtSize"+i.size,l,c,s,t)).style.minWidth="1.02em",n=1/o):(l=e+s+yr,h=e+s,c=Math.floor(1e3*e+s)+80,(r=br("sqrtTall",l,c,s,t)).style.minWidth="0.742em",n=1.056),r.height=h,r.style.height=F(l),{span:r,advanceWidth:n,ruleWidth:(t.fontMetrics().sqrtRuleThickness+s)*o}},sizedDelim:function(e,t,r,a,i){if("<"===e||"\\lt"===e||"\u27e8"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"\u27e9"!==e||(e="\\rangle"),l.contains(xr,e)||l.contains(kr,e))return mr(e,t,!1,r,a,i);if(l.contains(wr,e))return vr(e,Sr[t],!1,r,a,i);throw new n("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:Sr,customSizedDelim:Cr,leftRightDelim:function(e,t,r,n,a,i){var o=n.fontMetrics().axisHeight*n.sizeMultiplier,s=5/n.fontMetrics().ptPerEm,l=Math.max(t-o,r+o),h=Math.max(l/500*901,2*l-s);return Cr(e,h,!0,n,a,i)}},qr={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Ir=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230a","\u230b","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27e8","\\rangle","\u27e9","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27ee","\u27ef","\\lmoustache","\\rmoustache","\u23b0","\u23b1","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Rr(e,t){var r=Xt(e);if(r&&l.contains(Ir,r.text))return r;throw new n(r?"Invalid delimiter '"+r.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function Hr(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ot({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:function(e,t){var r=Rr(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:qr[e.funcName].size,mclass:qr[e.funcName].mclass,delim:r.text}},htmlBuilder:function(e,t){return"."===e.delim?Ke.makeSpan([e.mclass]):Nr.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass])},mathmlBuilder:function(e){var t=[];"."!==e.delim&&t.push(Bt(e.delim,e.mode));var r=new Tt.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=F(Nr.sizeToMaxHeight[e.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}}),ot({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:function(e,t){var r=e.parser.gullet.macros.get("\\current@color");if(r&&"string"!=typeof r)throw new n("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Rr(t[0],e).text,color:r}}}),ot({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:function(e,t){var r=Rr(t[0],e),n=e.parser;++n.leftrightDepth;var a=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var i=Ut(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:a,left:r.text,right:i.delim,rightColor:i.color}},htmlBuilder:function(e,t){Hr(e);for(var r,n,a=ft(e.body,t,!0,["mopen","mclose"]),i=0,o=0,s=!1,l=0;l<a.length;l++)a[l].isMiddle?s=!0:(i=Math.max(a[l].height,i),o=Math.max(a[l].depth,o));if(i*=t.sizeMultiplier,o*=t.sizeMultiplier,r="."===e.left?xt(t,["mopen"]):Nr.leftRightDelim(e.left,i,o,t,e.mode,["mopen"]),a.unshift(r),s)for(var h=1;h<a.length;h++){var c=a[h].isMiddle;c&&(a[h]=Nr.leftRightDelim(c.delim,i,o,c.options,e.mode,[]))}if("."===e.right)n=xt(t,["mclose"]);else{var m=e.rightColor?t.withColor(e.rightColor):t;n=Nr.leftRightDelim(e.right,i,o,m,e.mode,["mclose"])}return a.push(n),Ke.makeSpan(["minner"],a,t)},mathmlBuilder:function(e,t){Hr(e);var r=qt(e.body,t);if("."!==e.left){var n=new Tt.MathNode("mo",[Bt(e.left,e.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if("."!==e.right){var a=new Tt.MathNode("mo",[Bt(e.right,e.mode)]);a.setAttribute("fence","true"),e.rightColor&&a.setAttribute("mathcolor",e.rightColor),r.push(a)}return Ct(r)}}),ot({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:function(e,t){var r=Rr(t[0],e);if(!e.parser.leftrightDepth)throw new n("\\middle without preceding \\left",r);return{type:"middle",mode:e.parser.mode,delim:r.text}},htmlBuilder:function(e,t){var r;if("."===e.delim)r=xt(t,[]);else{r=Nr.sizedDelim(e.delim,1,t,e.mode,[]);var n={delim:e.delim,options:t};r.isMiddle=n}return r},mathmlBuilder:function(e,t){var r="\\vert"===e.delim||"|"===e.delim?Bt("|","text"):Bt(e.delim,e.mode),n=new Tt.MathNode("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var Or=function(e,t){var r,n,a,i=Ke.wrapFragment(wt(e.body,t),t),o=e.label.slice(1),s=t.sizeMultiplier,h=0,c=l.isCharacterBox(e.body);if("sout"===o)(r=Ke.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/s,h=-.5*t.fontMetrics().xHeight;else if("phase"===o){var m=P({number:.6,unit:"pt"},t),u=P({number:.35,unit:"ex"},t);s/=t.havingBaseSizing().sizeMultiplier;var p=i.height+i.depth+m+u;i.style.paddingLeft=F(p/2+m);var d=Math.floor(1e3*p*s),f="M400000 "+(n=d)+" H0 L"+n/2+" 0 l65 45 L145 "+(n-80)+" H400000z",g=new K([new J("phase",f)],{width:"400em",height:F(d/1e3),viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});(r=Ke.makeSvgSpan(["hide-tail"],[g],t)).style.height=F(p),h=i.depth+m+u}else{/cancel/.test(o)?c||i.classes.push("cancel-pad"):"angl"===o?i.classes.push("anglpad"):i.classes.push("boxpad");var v=0,y=0,b=0;/box/.test(o)?(b=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),y=v=t.fontMetrics().fboxsep+("colorbox"===o?0:b)):"angl"===o?(v=4*(b=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness)),y=Math.max(0,.25-i.depth)):y=v=c?.2:0,r=Pt(i,o,v,y,t),/fbox|boxed|fcolorbox/.test(o)?(r.style.borderStyle="solid",r.style.borderWidth=F(b)):"angl"===o&&.049!==b&&(r.style.borderTopWidth=F(b),r.style.borderRightWidth=F(b)),h=i.depth+y,e.backgroundColor&&(r.style.backgroundColor=e.backgroundColor,e.borderColor&&(r.style.borderColor=e.borderColor))}if(e.backgroundColor)a=Ke.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:h},{type:"elem",elem:i,shift:0}]},t);else{var x=/cancel|phase/.test(o)?["svg-align"]:[];a=Ke.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:0},{type:"elem",elem:r,shift:h,wrapperClasses:x}]},t)}return/cancel/.test(o)&&(a.height=i.height,a.depth=i.depth),/cancel/.test(o)&&!c?Ke.makeSpan(["mord","cancel-lap"],[a],t):Ke.makeSpan(["mord"],[a],t)},Er=function(e,t){var r=0,n=new Tt.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Rt(e.body,t)]);switch(e.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),"\\fcolorbox"===e.label){var a=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);n.setAttribute("style","border: "+a+"em solid "+String(e.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&n.setAttribute("mathbackground",e.backgroundColor),n};ot({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler:function(e,t,r){var n=e.parser,a=e.funcName,i=Ut(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:n.mode,label:a,backgroundColor:i,body:o}},htmlBuilder:Or,mathmlBuilder:Er}),ot({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler:function(e,t,r){var n=e.parser,a=e.funcName,i=Ut(t[0],"color-token").color,o=Ut(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:n.mode,label:a,backgroundColor:o,borderColor:i,body:s}},htmlBuilder:Or,mathmlBuilder:Er}),ot({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler:function(e,t){return{type:"enclose",mode:e.parser.mode,label:"\\fbox",body:t[0]}}}),ot({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"enclose",mode:r.mode,label:n,body:a}},htmlBuilder:Or,mathmlBuilder:Er}),ot({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler:function(e,t){return{type:"enclose",mode:e.parser.mode,label:"\\angl",body:t[0]}}});var Lr={};function Dr(e){for(var t=e.type,r=e.names,n=e.props,a=e.handler,i=e.htmlBuilder,o=e.mathmlBuilder,s={type:t,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:a},l=0;l<r.length;++l)Lr[r[l]]=s;i&&(at[t]=i),o&&(it[t]=o)}var Vr={};function Pr(e,t){Vr[e]=t}var Fr=function(){function e(e,t,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=r}return e.range=function(t,r){return r?t&&t.loc&&r.loc&&t.loc.lexer===r.loc.lexer?new e(t.loc.lexer,t.loc.start,r.loc.end):null:t&&t.loc},e}(),Gr=function(){function e(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}return e.prototype.range=function(t,r){return new e(r,Fr.range(this,t))},e}();function Ur(e){var t=[];e.consumeSpaces();for(var r=e.fetch().text;"\\hline"===r||"\\hdashline"===r;)e.consume(),t.push("\\hdashline"===r),e.consumeSpaces(),r=e.fetch().text;return t}var Yr=function(e){if(!e.parser.settings.displayMode)throw new n("{"+e.envName+"} can be used only in display mode.")};function Xr(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function Wr(e,t,r){var a=t.hskipBeforeAndAfter,i=t.addJot,o=t.cols,s=t.arraystretch,l=t.colSeparationType,h=t.autoTag,c=t.singleRow,m=t.emptySingleRow,u=t.maxNumCols,p=t.leqno;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!s){var d=e.gullet.expandMacroAsText("\\arraystretch");if(null==d)s=1;else if(!(s=parseFloat(d))||s<0)throw new n("Invalid \\arraystretch: "+d)}e.gullet.beginGroup();var f=[],g=[f],v=[],y=[],b=null!=h?[]:void 0;function x(){h&&e.gullet.macros.set("\\@eqnsw","1",!0)}function w(){b&&(e.gullet.macros.get("\\df@tag")?(b.push(e.subparse([new Gr("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):b.push(Boolean(h)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(x(),y.push(Ur(e));;){var k=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),k={type:"ordgroup",mode:e.mode,body:k},r&&(k={type:"styling",mode:e.mode,style:r,body:[k]}),f.push(k);var S=e.fetch().text;if("&"===S){if(u&&f.length===u){if(c||l)throw new n("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===S){w(),1===f.length&&"styling"===k.type&&0===k.body[0].body.length&&(g.length>1||!m)&&g.pop(),y.length<g.length+1&&y.push([]);break}if("\\\\"!==S)throw new n("Expected & or \\\\ or \\cr or \\end",e.nextToken);e.consume();var M=void 0;" "!==e.gullet.future().text&&(M=e.parseSizeGroup(!0)),v.push(M?M.value:null),w(),y.push(Ur(e)),f=[],g.push(f),x()}}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:i,arraystretch:s,body:g,cols:o,rowGaps:v,hskipBeforeAndAfter:a,hLinesBeforeRow:y,colSeparationType:l,tags:b,leqno:p}}function _r(e){return"d"===e.slice(0,1)?"display":"text"}var jr=function(e,t){var r,a,i=e.body.length,o=e.hLinesBeforeRow,s=0,h=new Array(i),c=[],m=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),u=1/t.fontMetrics().ptPerEm,p=5*u;e.colSeparationType&&"small"===e.colSeparationType&&(p=t.havingStyle(x.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var d="CD"===e.colSeparationType?P({number:3,unit:"ex"},t):12*u,f=3*u,g=e.arraystretch*d,v=.7*g,y=.3*g,b=0;function w(e){for(var t=0;t<e.length;++t)t>0&&(b+=.25),c.push({pos:b,isDashed:e[t]})}for(w(o[0]),r=0;r<e.body.length;++r){var k=e.body[r],S=v,M=y;s<k.length&&(s=k.length);var z=new Array(k.length);for(a=0;a<k.length;++a){var A=wt(k[a],t);M<A.depth&&(M=A.depth),S<A.height&&(S=A.height),z[a]=A}var T=e.rowGaps[r],B=0;T&&(B=P(T,t))>0&&(M<(B+=y)&&(M=B),B=0),e.addJot&&(M+=f),z.height=S,z.depth=M,b+=S,z.pos=b,b+=M+B,h[r]=z,w(o[r+1])}var C,N,q=b/2+t.fontMetrics().axisHeight,I=e.cols||[],R=[],H=[];if(e.tags&&e.tags.some((function(e){return e})))for(r=0;r<i;++r){var O=h[r],E=O.pos-q,L=e.tags[r],D=void 0;(D=!0===L?Ke.makeSpan(["eqn-num"],[],t):!1===L?Ke.makeSpan([],[],t):Ke.makeSpan([],ft(L,t,!0),t)).depth=O.depth,D.height=O.height,H.push({type:"elem",elem:D,shift:E})}for(a=0,N=0;a<s||N<I.length;++a,++N){for(var V=I[N]||{},G=!0;"separator"===V.type;){if(G||((C=Ke.makeSpan(["arraycolsep"],[])).style.width=F(t.fontMetrics().doubleRuleSep),R.push(C)),"|"!==V.separator&&":"!==V.separator)throw new n("Invalid separator type: "+V.separator);var U="|"===V.separator?"solid":"dashed",Y=Ke.makeSpan(["vertical-separator"],[],t);Y.style.height=F(b),Y.style.borderRightWidth=F(m),Y.style.borderRightStyle=U,Y.style.margin="0 "+F(-m/2);var X=b-q;X&&(Y.style.verticalAlign=F(-X)),R.push(Y),V=I[++N]||{},G=!1}if(!(a>=s)){var W=void 0;(a>0||e.hskipBeforeAndAfter)&&0!==(W=l.deflt(V.pregap,p))&&((C=Ke.makeSpan(["arraycolsep"],[])).style.width=F(W),R.push(C));var _=[];for(r=0;r<i;++r){var j=h[r],$=j[a];if($){var Z=j.pos-q;$.depth=j.depth,$.height=j.height,_.push({type:"elem",elem:$,shift:Z})}}_=Ke.makeVList({positionType:"individualShift",children:_},t),_=Ke.makeSpan(["col-align-"+(V.align||"c")],[_]),R.push(_),(a<s-1||e.hskipBeforeAndAfter)&&0!==(W=l.deflt(V.postgap,p))&&((C=Ke.makeSpan(["arraycolsep"],[])).style.width=F(W),R.push(C))}}if(h=Ke.makeSpan(["mtable"],R),c.length>0){for(var K=Ke.makeLineSpan("hline",t,m),J=Ke.makeLineSpan("hdashline",t,m),Q=[{type:"elem",elem:h,shift:0}];c.length>0;){var ee=c.pop(),te=ee.pos-q;ee.isDashed?Q.push({type:"elem",elem:J,shift:te}):Q.push({type:"elem",elem:K,shift:te})}h=Ke.makeVList({positionType:"individualShift",children:Q},t)}if(0===H.length)return Ke.makeSpan(["mord"],[h],t);var re=Ke.makeVList({positionType:"individualShift",children:H},t);return re=Ke.makeSpan(["tag"],[re],t),Ke.makeFragment([h,re])},$r={c:"center ",l:"left ",r:"right "},Zr=function(e,t){for(var r=[],n=new Tt.MathNode("mtd",[],["mtr-glue"]),a=new Tt.MathNode("mtd",[],["mml-eqn-num"]),i=0;i<e.body.length;i++){for(var o=e.body[i],s=[],l=0;l<o.length;l++)s.push(new Tt.MathNode("mtd",[Rt(o[l],t)]));e.tags&&e.tags[i]&&(s.unshift(n),s.push(n),e.leqno?s.unshift(a):s.push(a)),r.push(new Tt.MathNode("mtr",s))}var h=new Tt.MathNode("mtable",r),c=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);h.setAttribute("rowspacing",F(c));var m="",u="";if(e.cols&&e.cols.length>0){var p=e.cols,d="",f=!1,g=0,v=p.length;"separator"===p[0].type&&(m+="top ",g=1),"separator"===p[p.length-1].type&&(m+="bottom ",v-=1);for(var y=g;y<v;y++)"align"===p[y].type?(u+=$r[p[y].align],f&&(d+="none "),f=!0):"separator"===p[y].type&&f&&(d+="|"===p[y].separator?"solid ":"dashed ",f=!1);h.setAttribute("columnalign",u.trim()),/[sd]/.test(d)&&h.setAttribute("columnlines",d.trim())}if("align"===e.colSeparationType){for(var b=e.cols||[],x="",w=1;w<b.length;w++)x+=w%2?"0em ":"1em ";h.setAttribute("columnspacing",x.trim())}else"alignat"===e.colSeparationType||"gather"===e.colSeparationType?h.setAttribute("columnspacing","0em"):"small"===e.colSeparationType?h.setAttribute("columnspacing","0.2778em"):"CD"===e.colSeparationType?h.setAttribute("columnspacing","0.5em"):h.setAttribute("columnspacing","1em");var k="",S=e.hLinesBeforeRow;m+=S[0].length>0?"left ":"",m+=S[S.length-1].length>0?"right ":"";for(var M=1;M<S.length-1;M++)k+=0===S[M].length?"none ":S[M][0]?"dashed ":"solid ";return/[sd]/.test(k)&&h.setAttribute("rowlines",k.trim()),""!==m&&(h=new Tt.MathNode("menclose",[h])).setAttribute("notation",m.trim()),e.arraystretch&&e.arraystretch<1&&(h=new Tt.MathNode("mstyle",[h])).setAttribute("scriptlevel","1"),h},Kr=function(e,t){-1===e.envName.indexOf("ed")&&Yr(e);var r,a=[],i=e.envName.indexOf("at")>-1?"alignat":"align",o="split"===e.envName,s=Wr(e.parser,{cols:a,addJot:!0,autoTag:o?void 0:Xr(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:o?2:void 0,leqno:e.parser.settings.leqno},"display"),l=0,h={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var c="",m=0;m<t[0].body.length;m++){c+=Ut(t[0].body[m],"textord").text}r=Number(c),l=2*r}var u=!l;s.body.forEach((function(e){for(var t=1;t<e.length;t+=2){var a=Ut(e[t],"styling");Ut(a.body[0],"ordgroup").body.unshift(h)}if(u)l<e.length&&(l=e.length);else{var i=e.length/2;if(r<i)throw new n("Too many math in a row: expected "+r+", but got "+i,e[0])}}));for(var p=0;p<l;++p){var d="r",f=0;p%2==1?d="l":p>0&&u&&(f=1),a[p]={type:"align",align:d,pregap:f,postgap:0}}return s.colSeparationType=u?"align":"alignat",s};Dr({type:"array",names:["array","darray"],props:{numArgs:1},handler:function(e,t){var r=(Xt(t[0])?[t[0]]:Ut(t[0],"ordgroup").body).map((function(e){var t=Yt(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new n("Unknown column alignment: "+t,e)})),a={cols:r,hskipBeforeAndAfter:!0,maxNumCols:r.length};return Wr(e.parser,a,_r(e.envName))},htmlBuilder:jr,mathmlBuilder:Zr}),Dr({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler:function(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],r="c",a={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if("*"===e.envName.charAt(e.envName.length-1)){var i=e.parser;if(i.consumeSpaces(),"["===i.fetch().text){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,-1==="lcr".indexOf(r))throw new n("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),a.cols=[{type:"align",align:r}]}}var o=Wr(e.parser,a,_r(e.envName)),s=Math.max.apply(Math,[0].concat(o.body.map((function(e){return e.length}))));return o.cols=new Array(s).fill({type:"align",align:r}),t?{type:"leftright",mode:e.mode,body:[o],left:t[0],right:t[1],rightColor:void 0}:o},htmlBuilder:jr,mathmlBuilder:Zr}),Dr({type:"array",names:["smallmatrix"],props:{numArgs:0},handler:function(e){var t=Wr(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:jr,mathmlBuilder:Zr}),Dr({type:"array",names:["subarray"],props:{numArgs:1},handler:function(e,t){var r=(Xt(t[0])?[t[0]]:Ut(t[0],"ordgroup").body).map((function(e){var t=Yt(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new n("Unknown column alignment: "+t,e)}));if(r.length>1)throw new n("{subarray} can contain only one column");var a={cols:r,hskipBeforeAndAfter:!1,arraystretch:.5};if((a=Wr(e.parser,a,"script")).body.length>0&&a.body[0].length>1)throw new n("{subarray} can contain only one column");return a},htmlBuilder:jr,mathmlBuilder:Zr}),Dr({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler:function(e){var t=Wr(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},_r(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:jr,mathmlBuilder:Zr}),Dr({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Kr,htmlBuilder:jr,mathmlBuilder:Zr}),Dr({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler:function(e){l.contains(["gather","gather*"],e.envName)&&Yr(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Xr(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Wr(e.parser,t,"display")},htmlBuilder:jr,mathmlBuilder:Zr}),Dr({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Kr,htmlBuilder:jr,mathmlBuilder:Zr}),Dr({type:"array",names:["equation","equation*"],props:{numArgs:0},handler:function(e){Yr(e);var t={autoTag:Xr(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Wr(e.parser,t,"display")},htmlBuilder:jr,mathmlBuilder:Zr}),Dr({type:"array",names:["CD"],props:{numArgs:0},handler:function(e){return Yr(e),function(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var r=e.fetch().text;if("&"!==r&&"\\\\"!==r){if("\\end"===r){0===t[t.length-1].length&&t.pop();break}throw new n("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var a,i,o=[],s=[o],l=0;l<t.length;l++){for(var h=t[l],c={type:"styling",body:[],mode:"math",style:"display"},m=0;m<h.length;m++)if(tr(h[m])){o.push(c);var u=Yt(h[m+=1]).text,p=new Array(2);if(p[0]={type:"ordgroup",mode:"math",body:[]},p[1]={type:"ordgroup",mode:"math",body:[]},"=|.".indexOf(u)>-1);else{if(!("<>AV".indexOf(u)>-1))throw new n('Expected one of "<>AV=|." after @',h[m]);for(var d=0;d<2;d++){for(var f=!0,g=m+1;g<h.length;g++){if(i=u,("mathord"===(a=h[g]).type||"atom"===a.type)&&a.text===i){f=!1,m=g;break}if(tr(h[g]))throw new n("Missing a "+u+" character to complete a CD arrow.",h[g]);p[d].body.push(h[g])}if(f)throw new n("Missing a "+u+" character to complete a CD arrow.",h[m])}}var v={type:"styling",body:[rr(u,p,e)],mode:"math",style:"display"};o.push(v),c={type:"styling",body:[],mode:"math",style:"display"}}else c.body.push(h[m]);l%2==0?o.push(c):o.shift(),o=[],s.push(o)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}(e.parser)},htmlBuilder:jr,mathmlBuilder:Zr}),Pr("\\nonumber","\\gdef\\@eqnsw{0}"),Pr("\\notag","\\nonumber"),ot({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler:function(e,t){throw new n(e.funcName+" valid only within array environment")}});var Jr=Lr;ot({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler:function(e,t){var r=e.parser,a=e.funcName,i=t[0];if("ordgroup"!==i.type)throw new n("Invalid environment name",i);for(var o="",s=0;s<i.body.length;++s)o+=Ut(i.body[s],"textord").text;if("\\begin"===a){if(!Jr.hasOwnProperty(o))throw new n("No such environment: "+o,i);var l=Jr[o],h=r.parseArguments("\\begin{"+o+"}",l),c=h.args,m=h.optArgs,u={mode:r.mode,envName:o,parser:r},p=l.handler(u,c,m);r.expect("\\end",!1);var d=r.nextToken,f=Ut(r.parseFunction(),"environment");if(f.name!==o)throw new n("Mismatch: \\begin{"+o+"} matched by \\end{"+f.name+"}",d);return p}return{type:"environment",mode:r.mode,name:o,nameGroup:i}}});var Qr=function(e,t){var r=e.font,n=t.withFont(r);return wt(e.body,n)},en=function(e,t){var r=e.font,n=t.withFont(r);return Rt(e.body,n)},tn={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};ot({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:function(e,t){var r=e.parser,n=e.funcName,a=lt(t[0]),i=n;return i in tn&&(i=tn[i]),{type:"font",mode:r.mode,font:i.slice(1),body:a}},htmlBuilder:Qr,mathmlBuilder:en}),ot({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=t[0],a=l.isCharacterBox(n);return{type:"mclass",mode:r.mode,mclass:Qt(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:a}}}),ot({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:function(e,t){var r=e.parser,n=e.funcName,a=e.breakOnTokenText,i=r.mode,o=r.parseExpression(!0,a);return{type:"font",mode:i,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:o}}},htmlBuilder:Qr,mathmlBuilder:en});var rn=function(e,t){var r=t;return"display"===e?r=r.id>=x.SCRIPT.id?r.text():x.DISPLAY:"text"===e&&r.size===x.DISPLAY.size?r=x.TEXT:"script"===e?r=x.SCRIPT:"scriptscript"===e&&(r=x.SCRIPTSCRIPT),r},nn=function(e,t){var r,n=rn(e.size,t.style),a=n.fracNum(),i=n.fracDen();r=t.havingStyle(a);var o=wt(e.numer,r,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;o.height=o.height<s?s:o.height,o.depth=o.depth<l?l:o.depth}r=t.havingStyle(i);var h,c,m,u,p,d,f,g,v,y,b=wt(e.denom,r,t);if(e.hasBarLine?(e.barSize?(c=P(e.barSize,t),h=Ke.makeLineSpan("frac-line",t,c)):h=Ke.makeLineSpan("frac-line",t),c=h.height,m=h.height):(h=null,c=0,m=t.fontMetrics().defaultRuleThickness),n.size===x.DISPLAY.size||"display"===e.size?(u=t.fontMetrics().num1,p=c>0?3*m:7*m,d=t.fontMetrics().denom1):(c>0?(u=t.fontMetrics().num2,p=m):(u=t.fontMetrics().num3,p=3*m),d=t.fontMetrics().denom2),h){var w=t.fontMetrics().axisHeight;u-o.depth-(w+.5*c)<p&&(u+=p-(u-o.depth-(w+.5*c))),w-.5*c-(b.height-d)<p&&(d+=p-(w-.5*c-(b.height-d)));var k=-(w-.5*c);f=Ke.makeVList({positionType:"individualShift",children:[{type:"elem",elem:b,shift:d},{type:"elem",elem:h,shift:k},{type:"elem",elem:o,shift:-u}]},t)}else{var S=u-o.depth-(b.height-d);S<p&&(u+=.5*(p-S),d+=.5*(p-S)),f=Ke.makeVList({positionType:"individualShift",children:[{type:"elem",elem:b,shift:d},{type:"elem",elem:o,shift:-u}]},t)}return r=t.havingStyle(n),f.height*=r.sizeMultiplier/t.sizeMultiplier,f.depth*=r.sizeMultiplier/t.sizeMultiplier,g=n.size===x.DISPLAY.size?t.fontMetrics().delim1:n.size===x.SCRIPTSCRIPT.size?t.havingStyle(x.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,v=null==e.leftDelim?xt(t,["mopen"]):Nr.customSizedDelim(e.leftDelim,g,!0,t.havingStyle(n),e.mode,["mopen"]),y=e.continued?Ke.makeSpan([]):null==e.rightDelim?xt(t,["mclose"]):Nr.customSizedDelim(e.rightDelim,g,!0,t.havingStyle(n),e.mode,["mclose"]),Ke.makeSpan(["mord"].concat(r.sizingClasses(t)),[v,Ke.makeSpan(["mfrac"],[f]),y],t)},an=function(e,t){var r=new Tt.MathNode("mfrac",[Rt(e.numer,t),Rt(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var n=P(e.barSize,t);r.setAttribute("linethickness",F(n))}}else r.setAttribute("linethickness","0px");var a=rn(e.size,t.style);if(a.size!==t.style.size){r=new Tt.MathNode("mstyle",[r]);var i=a.size===x.DISPLAY.size?"true":"false";r.setAttribute("displaystyle",i),r.setAttribute("scriptlevel","0")}if(null!=e.leftDelim||null!=e.rightDelim){var o=[];if(null!=e.leftDelim){var s=new Tt.MathNode("mo",[new Tt.TextNode(e.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),o.push(s)}if(o.push(r),null!=e.rightDelim){var l=new Tt.MathNode("mo",[new Tt.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}return Ct(o)}return r};ot({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:function(e,t){var r,n=e.parser,a=e.funcName,i=t[0],o=t[1],s=null,l=null,h="auto";switch(a){case"\\dfrac":case"\\frac":case"\\tfrac":r=!0;break;case"\\\\atopfrac":r=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":r=!1,s="(",l=")";break;case"\\\\bracefrac":r=!1,s="\\{",l="\\}";break;case"\\\\brackfrac":r=!1,s="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(a){case"\\dfrac":case"\\dbinom":h="display";break;case"\\tfrac":case"\\tbinom":h="text"}return{type:"genfrac",mode:n.mode,continued:!1,numer:i,denom:o,hasBarLine:r,leftDelim:s,rightDelim:l,size:h,barSize:null}},htmlBuilder:nn,mathmlBuilder:an}),ot({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:function(e,t){var r=e.parser,n=(e.funcName,t[0]),a=t[1];return{type:"genfrac",mode:r.mode,continued:!0,numer:n,denom:a,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),ot({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler:function(e){var t,r=e.parser,n=e.funcName,a=e.token;switch(n){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:r.mode,replaceWith:t,token:a}}});var on=["display","text","script","scriptscript"],sn=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};ot({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler:function(e,t){var r,n=e.parser,a=t[4],i=t[5],o=lt(t[0]),s="atom"===o.type&&"open"===o.family?sn(o.text):null,l=lt(t[1]),h="atom"===l.type&&"close"===l.family?sn(l.text):null,c=Ut(t[2],"size"),m=null;r=!!c.isBlank||(m=c.value).number>0;var u="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var d=Ut(p.body[0],"textord");u=on[Number(d.text)]}}else p=Ut(p,"textord"),u=on[Number(p.text)];return{type:"genfrac",mode:n.mode,numer:a,denom:i,continued:!1,hasBarLine:r,barSize:m,leftDelim:s,rightDelim:h,size:u}},htmlBuilder:nn,mathmlBuilder:an}),ot({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler:function(e,t){var r=e.parser,n=(e.funcName,e.token);return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:Ut(t[0],"size").value,token:n}}}),ot({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:function(e,t){var r=e.parser,n=(e.funcName,t[0]),a=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(Ut(t[1],"infix").size),i=t[2],o=a.number>0;return{type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:nn,mathmlBuilder:an});var ln=function(e,t){var r,n,a=t.style;"supsub"===e.type?(r=e.sup?wt(e.sup,t.havingStyle(a.sup()),t):wt(e.sub,t.havingStyle(a.sub()),t),n=Ut(e.base,"horizBrace")):n=Ut(e,"horizBrace");var i,o=wt(n.base,t.havingBaseStyle(x.DISPLAY)),s=Gt(n,t);if(n.isOver?(i=Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},t)).children[0].children[0].children[1].classes.push("svg-align"):(i=Ke.makeVList({positionType:"bottom",positionData:o.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},t)).children[0].children[0].children[0].classes.push("svg-align"),r){var l=Ke.makeSpan(["mord",n.isOver?"mover":"munder"],[i],t);i=n.isOver?Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]},t):Ke.makeVList({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return Ke.makeSpan(["mord",n.isOver?"mover":"munder"],[i],t)};ot({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=e.funcName;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:t[0]}},htmlBuilder:ln,mathmlBuilder:function(e,t){var r=Ft(e.label);return new Tt.MathNode(e.isOver?"mover":"munder",[Rt(e.base,t),r])}}),ot({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:function(e,t){var r=e.parser,n=t[1],a=Ut(t[0],"url").url;return r.settings.isTrusted({command:"\\href",url:a})?{type:"href",mode:r.mode,href:a,body:ht(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:function(e,t){var r=ft(e.body,t,!1);return Ke.makeAnchor(e.href,[],r,t)},mathmlBuilder:function(e,t){var r=It(e.body,t);return r instanceof zt||(r=new zt("mrow",[r])),r.setAttribute("href",e.href),r}}),ot({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:function(e,t){var r=e.parser,n=Ut(t[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var a=[],i=0;i<n.length;i++){var o=n[i];"~"===o&&(o="\\textasciitilde"),a.push({type:"textord",mode:"text",text:o})}var s={type:"text",mode:r.mode,font:"\\texttt",body:a};return{type:"href",mode:r.mode,href:n,body:ht(s)}}}),ot({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler:function(e,t){return{type:"hbox",mode:e.parser.mode,body:ht(t[0])}},htmlBuilder:function(e,t){var r=ft(e.body,t,!1);return Ke.makeFragment(r)},mathmlBuilder:function(e,t){return new Tt.MathNode("mrow",qt(e.body,t))}}),ot({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:function(e,t){var r,a=e.parser,i=e.funcName,o=(e.token,Ut(t[0],"raw").string),s=t[1];a.settings.strict&&a.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(i){case"\\htmlClass":l.class=o,r={command:"\\htmlClass",class:o};break;case"\\htmlId":l.id=o,r={command:"\\htmlId",id:o};break;case"\\htmlStyle":l.style=o,r={command:"\\htmlStyle",style:o};break;case"\\htmlData":for(var h=o.split(","),c=0;c<h.length;c++){var m=h[c].split("=");if(2!==m.length)throw new n("Error parsing key-value for \\htmlData");l["data-"+m[0].trim()]=m[1].trim()}r={command:"\\htmlData",attributes:l};break;default:throw new Error("Unrecognized html command")}return a.settings.isTrusted(r)?{type:"html",mode:a.mode,attributes:l,body:ht(s)}:a.formatUnsupportedCmd(i)},htmlBuilder:function(e,t){var r=ft(e.body,t,!1),n=["enclosing"];e.attributes.class&&n.push.apply(n,e.attributes.class.trim().split(/\s+/));var a=Ke.makeSpan(n,r,t);for(var i in e.attributes)"class"!==i&&e.attributes.hasOwnProperty(i)&&a.setAttribute(i,e.attributes[i]);return a},mathmlBuilder:function(e,t){return It(e.body,t)}}),ot({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:function(e,t){return{type:"htmlmathml",mode:e.parser.mode,html:ht(t[0]),mathml:ht(t[1])}},htmlBuilder:function(e,t){var r=ft(e.html,t,!1);return Ke.makeFragment(r)},mathmlBuilder:function(e,t){return It(e.mathml,t)}});var hn=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new n("Invalid size: '"+e+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!V(r))throw new n("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};ot({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:function(e,t,r){var a=e.parser,i={number:0,unit:"em"},o={number:.9,unit:"em"},s={number:0,unit:"em"},l="";if(r[0])for(var h=Ut(r[0],"raw").string.split(","),c=0;c<h.length;c++){var m=h[c].split("=");if(2===m.length){var u=m[1].trim();switch(m[0].trim()){case"alt":l=u;break;case"width":i=hn(u);break;case"height":o=hn(u);break;case"totalheight":s=hn(u);break;default:throw new n("Invalid key: '"+m[0]+"' in \\includegraphics.")}}}var p=Ut(t[0],"url").url;return""===l&&(l=(l=(l=p).replace(/^.*[\\/]/,"")).substring(0,l.lastIndexOf("."))),a.settings.isTrusted({command:"\\includegraphics",url:p})?{type:"includegraphics",mode:a.mode,alt:l,width:i,height:o,totalheight:s,src:p}:a.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:function(e,t){var r=P(e.height,t),n=0;e.totalheight.number>0&&(n=P(e.totalheight,t)-r);var a=0;e.width.number>0&&(a=P(e.width,t));var i={height:F(r+n)};a>0&&(i.width=F(a)),n>0&&(i.verticalAlign=F(-n));var o=new j(e.src,e.alt,i);return o.height=r,o.depth=n,o},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mglyph",[]);r.setAttribute("alt",e.alt);var n=P(e.height,t),a=0;if(e.totalheight.number>0&&(a=P(e.totalheight,t)-n,r.setAttribute("valign",F(-a))),r.setAttribute("height",F(n+a)),e.width.number>0){var i=P(e.width,t);r.setAttribute("width",F(i))}return r.setAttribute("src",e.src),r}}),ot({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler:function(e,t){var r=e.parser,n=e.funcName,a=Ut(t[0],"size");if(r.settings.strict){var i="m"===n[1],o="mu"===a.value.unit;i?(o||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, not "+a.value.unit+" units"),"math"!==r.mode&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):o&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:a.value}},htmlBuilder:function(e,t){return Ke.makeGlue(e.dimension,t)},mathmlBuilder:function(e,t){var r=P(e.dimension,t);return new Tt.SpaceNode(r)}}),ot({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:a}},htmlBuilder:function(e,t){var r;"clap"===e.alignment?(r=Ke.makeSpan([],[wt(e.body,t)]),r=Ke.makeSpan(["inner"],[r],t)):r=Ke.makeSpan(["inner"],[wt(e.body,t)]);var n=Ke.makeSpan(["fix"],[]),a=Ke.makeSpan([e.alignment],[r,n],t),i=Ke.makeSpan(["strut"]);return i.style.height=F(a.height+a.depth),a.depth&&(i.style.verticalAlign=F(-a.depth)),a.children.unshift(i),a=Ke.makeSpan(["thinbox"],[a],t),Ke.makeSpan(["mord","vbox"],[a],t)},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mpadded",[Rt(e.body,t)]);if("rlap"!==e.alignment){var n="llap"===e.alignment?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}}),ot({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(e,t){var r=e.funcName,n=e.parser,a=n.mode;n.switchMode("math");var i="\\("===r?"\\)":"$",o=n.parseExpression(!1,i);return n.expect(i),n.switchMode(a),{type:"styling",mode:n.mode,style:"text",body:o}}}),ot({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(e,t){throw new n("Mismatched "+e.funcName)}});var cn=function(e,t){switch(t.style.size){case x.DISPLAY.size:return e.display;case x.TEXT.size:return e.text;case x.SCRIPT.size:return e.script;case x.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ot({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:function(e,t){return{type:"mathchoice",mode:e.parser.mode,display:ht(t[0]),text:ht(t[1]),script:ht(t[2]),scriptscript:ht(t[3])}},htmlBuilder:function(e,t){var r=cn(e,t),n=ft(r,t,!1);return Ke.makeFragment(n)},mathmlBuilder:function(e,t){var r=cn(e,t);return It(r,t)}});var mn=function(e,t,r,n,a,i,o){e=Ke.makeSpan([],[e]);var s,h,c,m=r&&l.isCharacterBox(r);if(t){var u=wt(t,n.havingStyle(a.sup()),n);h={elem:u,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-u.depth)}}if(r){var p=wt(r,n.havingStyle(a.sub()),n);s={elem:p,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-p.height)}}if(h&&s){var d=n.fontMetrics().bigOpSpacing5+s.elem.height+s.elem.depth+s.kern+e.depth+o;c=Ke.makeVList({positionType:"bottom",positionData:d,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:F(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:F(i)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(s){var f=e.height-o;c=Ke.makeVList({positionType:"top",positionData:f,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:F(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e}]},n)}else{if(!h)return e;var g=e.depth+o;c=Ke.makeVList({positionType:"bottom",positionData:g,children:[{type:"elem",elem:e},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:F(i)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}var v=[c];if(s&&0!==i&&!m){var y=Ke.makeSpan(["mspace"],[],n);y.style.marginRight=F(i),v.unshift(y)}return Ke.makeSpan(["mop","op-limits"],v,n)},un=["\\smallint"],pn=function(e,t){var r,n,a,i=!1;"supsub"===e.type?(r=e.sup,n=e.sub,a=Ut(e.base,"op"),i=!0):a=Ut(e,"op");var o,s=t.style,h=!1;if(s.size===x.DISPLAY.size&&a.symbol&&!l.contains(un,a.name)&&(h=!0),a.symbol){var c=h?"Size2-Regular":"Size1-Regular",m="";if("\\oiint"!==a.name&&"\\oiiint"!==a.name||(m=a.name.slice(1),a.name="oiint"===m?"\\iint":"\\iiint"),o=Ke.makeSymbol(a.name,c,"math",t,["mop","op-symbol",h?"large-op":"small-op"]),m.length>0){var u=o.italic,p=Ke.staticSvg(m+"Size"+(h?"2":"1"),t);o=Ke.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:p,shift:h?.08:0}]},t),a.name="\\"+m,o.classes.unshift("mop"),o.italic=u}}else if(a.body){var d=ft(a.body,t,!0);1===d.length&&d[0]instanceof Z?(o=d[0]).classes[0]="mop":o=Ke.makeSpan(["mop"],d,t)}else{for(var f=[],g=1;g<a.name.length;g++)f.push(Ke.mathsym(a.name[g],a.mode,t));o=Ke.makeSpan(["mop"],f,t)}var v=0,y=0;return(o instanceof Z||"\\oiint"===a.name||"\\oiiint"===a.name)&&!a.suppressBaseShift&&(v=(o.height-o.depth)/2-t.fontMetrics().axisHeight,y=o.italic),i?mn(o,r,n,t,s,y,v):(v&&(o.style.position="relative",o.style.top=F(v)),o)},dn=function(e,t){var r;if(e.symbol)r=new zt("mo",[Bt(e.name,e.mode)]),l.contains(un,e.name)&&r.setAttribute("largeop","false");else if(e.body)r=new zt("mo",qt(e.body,t));else{r=new zt("mi",[new At(e.name.slice(1))]);var n=new zt("mo",[Bt("\u2061","text")]);r=e.parentIsSupSub?new zt("mrow",[r,n]):Mt([r,n])}return r},fn={"\u220f":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22c0":"\\bigwedge","\u22c1":"\\bigvee","\u22c2":"\\bigcap","\u22c3":"\\bigcup","\u2a00":"\\bigodot","\u2a01":"\\bigoplus","\u2a02":"\\bigotimes","\u2a04":"\\biguplus","\u2a06":"\\bigsqcup"};ot({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\u220f","\u2210","\u2211","\u22c0","\u22c1","\u22c2","\u22c3","\u2a00","\u2a01","\u2a02","\u2a04","\u2a06"],props:{numArgs:0},handler:function(e,t){var r=e.parser,n=e.funcName;return 1===n.length&&(n=fn[n]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:pn,mathmlBuilder:dn}),ot({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:function(e,t){var r=e.parser,n=t[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ht(n)}},htmlBuilder:pn,mathmlBuilder:dn});var gn={"\u222b":"\\int","\u222c":"\\iint","\u222d":"\\iiint","\u222e":"\\oint","\u222f":"\\oiint","\u2230":"\\oiiint"};ot({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler:function(e){var t=e.parser,r=e.funcName;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:pn,mathmlBuilder:dn}),ot({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler:function(e){var t=e.parser,r=e.funcName;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:pn,mathmlBuilder:dn}),ot({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222b","\u222c","\u222d","\u222e","\u222f","\u2230"],props:{numArgs:0},handler:function(e){var t=e.parser,r=e.funcName;return 1===r.length&&(r=gn[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:pn,mathmlBuilder:dn});var vn=function(e,t){var r,n,a,i,o=!1;if("supsub"===e.type?(r=e.sup,n=e.sub,a=Ut(e.base,"operatorname"),o=!0):a=Ut(e,"operatorname"),a.body.length>0){for(var s=a.body.map((function(e){var t=e.text;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e})),l=ft(s,t.withFont("mathrm"),!0),h=0;h<l.length;h++){var c=l[h];c instanceof Z&&(c.text=c.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}i=Ke.makeSpan(["mop"],l,t)}else i=Ke.makeSpan(["mop"],[],t);return o?mn(i,r,n,t,t.style,0,0):i};function yn(e,t,r){for(var n=ft(e,t,!1),a=t.sizeMultiplier/r.sizeMultiplier,i=0;i<n.length;i++){var o=n[i].classes.indexOf("sizing");o<0?Array.prototype.push.apply(n[i].classes,t.sizingClasses(r)):n[i].classes[o+1]==="reset-size"+t.size&&(n[i].classes[o+1]="reset-size"+r.size),n[i].height*=a,n[i].depth*=a}return Ke.makeFragment(n)}ot({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"operatorname",mode:r.mode,body:ht(a),alwaysHandleSupSub:"\\operatornamewithlimits"===n,limits:!1,parentIsSupSub:!1}},htmlBuilder:vn,mathmlBuilder:function(e,t){for(var r=qt(e.body,t.withFont("mathrm")),n=!0,a=0;a<r.length;a++){var i=r[a];if(i instanceof Tt.SpaceNode);else if(i instanceof Tt.MathNode)switch(i.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":var o=i.children[0];1===i.children.length&&o instanceof Tt.TextNode?o.text=o.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):n=!1;break;default:n=!1}else n=!1}if(n){var s=r.map((function(e){return e.toText()})).join("");r=[new Tt.TextNode(s)]}var l=new Tt.MathNode("mi",r);l.setAttribute("mathvariant","normal");var h=new Tt.MathNode("mo",[Bt("\u2061","text")]);return e.parentIsSupSub?new Tt.MathNode("mrow",[l,h]):Tt.newDocumentFragment([l,h])}}),Pr("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),st({type:"ordgroup",htmlBuilder:function(e,t){return e.semisimple?Ke.makeFragment(ft(e.body,t,!1)):Ke.makeSpan(["mord"],ft(e.body,t,!0),t)},mathmlBuilder:function(e,t){return It(e.body,t,!0)}}),ot({type:"overline",names:["\\overline"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=t[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder:function(e,t){var r=wt(e.body,t.havingCrampedStyle()),n=Ke.makeLineSpan("overline-line",t),a=t.fontMetrics().defaultRuleThickness,i=Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*a},{type:"elem",elem:n},{type:"kern",size:a}]},t);return Ke.makeSpan(["mord","overline"],[i],t)},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mo",[new Tt.TextNode("\u203e")]);r.setAttribute("stretchy","true");var n=new Tt.MathNode("mover",[Rt(e.body,t),r]);return n.setAttribute("accent","true"),n}}),ot({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){var r=e.parser,n=t[0];return{type:"phantom",mode:r.mode,body:ht(n)}},htmlBuilder:function(e,t){var r=ft(e.body,t.withPhantom(),!1);return Ke.makeFragment(r)},mathmlBuilder:function(e,t){var r=qt(e.body,t);return new Tt.MathNode("mphantom",r)}}),ot({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){var r=e.parser,n=t[0];return{type:"hphantom",mode:r.mode,body:n}},htmlBuilder:function(e,t){var r=Ke.makeSpan([],[wt(e.body,t.withPhantom())]);if(r.height=0,r.depth=0,r.children)for(var n=0;n<r.children.length;n++)r.children[n].height=0,r.children[n].depth=0;return r=Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r}]},t),Ke.makeSpan(["mord"],[r],t)},mathmlBuilder:function(e,t){var r=qt(ht(e.body),t),n=new Tt.MathNode("mphantom",r),a=new Tt.MathNode("mpadded",[n]);return a.setAttribute("height","0px"),a.setAttribute("depth","0px"),a}}),ot({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){var r=e.parser,n=t[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:function(e,t){var r=Ke.makeSpan(["inner"],[wt(e.body,t.withPhantom())]),n=Ke.makeSpan(["fix"],[]);return Ke.makeSpan(["mord","rlap"],[r,n],t)},mathmlBuilder:function(e,t){var r=qt(ht(e.body),t),n=new Tt.MathNode("mphantom",r),a=new Tt.MathNode("mpadded",[n]);return a.setAttribute("width","0px"),a}}),ot({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler:function(e,t){var r=e.parser,n=Ut(t[0],"size").value,a=t[1];return{type:"raisebox",mode:r.mode,dy:n,body:a}},htmlBuilder:function(e,t){var r=wt(e.body,t),n=P(e.dy,t);return Ke.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]},t)},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mpadded",[Rt(e.body,t)]),n=e.dy.number+e.dy.unit;return r.setAttribute("voffset",n),r}}),ot({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler:function(e){return{type:"internal",mode:e.parser.mode}}}),ot({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler:function(e,t,r){var n=e.parser,a=r[0],i=Ut(t[0],"size"),o=Ut(t[1],"size");return{type:"rule",mode:n.mode,shift:a&&Ut(a,"size").value,width:i.value,height:o.value}},htmlBuilder:function(e,t){var r=Ke.makeSpan(["mord","rule"],[],t),n=P(e.width,t),a=P(e.height,t),i=e.shift?P(e.shift,t):0;return r.style.borderRightWidth=F(n),r.style.borderTopWidth=F(a),r.style.bottom=F(i),r.width=n,r.height=a+i,r.depth=-i,r.maxFontSize=1.125*a*t.sizeMultiplier,r},mathmlBuilder:function(e,t){var r=P(e.width,t),n=P(e.height,t),a=e.shift?P(e.shift,t):0,i=t.color&&t.getColor()||"black",o=new Tt.MathNode("mspace");o.setAttribute("mathbackground",i),o.setAttribute("width",F(r)),o.setAttribute("height",F(n));var s=new Tt.MathNode("mpadded",[o]);return a>=0?s.setAttribute("height",F(a)):(s.setAttribute("height",F(a)),s.setAttribute("depth",F(-a))),s.setAttribute("voffset",F(a)),s}});var bn=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];ot({type:"sizing",names:bn,props:{numArgs:0,allowedInText:!0},handler:function(e,t){var r=e.breakOnTokenText,n=e.funcName,a=e.parser,i=a.parseExpression(!1,r);return{type:"sizing",mode:a.mode,size:bn.indexOf(n)+1,body:i}},htmlBuilder:function(e,t){var r=t.havingSize(e.size);return yn(e.body,r,t)},mathmlBuilder:function(e,t){var r=t.havingSize(e.size),n=qt(e.body,r),a=new Tt.MathNode("mstyle",n);return a.setAttribute("mathsize",F(r.sizeMultiplier)),a}}),ot({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:function(e,t,r){var n=e.parser,a=!1,i=!1,o=r[0]&&Ut(r[0],"ordgroup");if(o)for(var s="",l=0;l<o.body.length;++l){if("t"===(s=o.body[l].text))a=!0;else{if("b"!==s){a=!1,i=!1;break}i=!0}}else a=!0,i=!0;var h=t[0];return{type:"smash",mode:n.mode,body:h,smashHeight:a,smashDepth:i}},htmlBuilder:function(e,t){var r=Ke.makeSpan([],[wt(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return r;if(e.smashHeight&&(r.height=0,r.children))for(var n=0;n<r.children.length;n++)r.children[n].height=0;if(e.smashDepth&&(r.depth=0,r.children))for(var a=0;a<r.children.length;a++)r.children[a].depth=0;var i=Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r}]},t);return Ke.makeSpan(["mord"],[i],t)},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mpadded",[Rt(e.body,t)]);return e.smashHeight&&r.setAttribute("height","0px"),e.smashDepth&&r.setAttribute("depth","0px"),r}}),ot({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler:function(e,t,r){var n=e.parser,a=r[0],i=t[0];return{type:"sqrt",mode:n.mode,body:i,index:a}},htmlBuilder:function(e,t){var r=wt(e.body,t.havingCrampedStyle());0===r.height&&(r.height=t.fontMetrics().xHeight),r=Ke.wrapFragment(r,t);var n=t.fontMetrics().defaultRuleThickness,a=n;t.style.id<x.TEXT.id&&(a=t.fontMetrics().xHeight);var i=n+a/4,o=r.height+r.depth+i+n,s=Nr.sqrtImage(o,t),l=s.span,h=s.ruleWidth,c=s.advanceWidth,m=l.height-h;m>r.height+r.depth+i&&(i=(i+m-r.height-r.depth)/2);var u=l.height-r.height-i-h;r.style.paddingLeft=F(c);var p=Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+u)},{type:"elem",elem:l},{type:"kern",size:h}]},t);if(e.index){var d=t.havingStyle(x.SCRIPTSCRIPT),f=wt(e.index,d,t),g=.6*(p.height-p.depth),v=Ke.makeVList({positionType:"shift",positionData:-g,children:[{type:"elem",elem:f}]},t),y=Ke.makeSpan(["root"],[v]);return Ke.makeSpan(["mord","sqrt"],[y,p],t)}return Ke.makeSpan(["mord","sqrt"],[p],t)},mathmlBuilder:function(e,t){var r=e.body,n=e.index;return n?new Tt.MathNode("mroot",[Rt(r,t),Rt(n,t)]):new Tt.MathNode("msqrt",[Rt(r,t)])}});var xn={display:x.DISPLAY,text:x.TEXT,script:x.SCRIPT,scriptscript:x.SCRIPTSCRIPT};ot({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler:function(e,t){var r=e.breakOnTokenText,n=e.funcName,a=e.parser,i=a.parseExpression(!0,r),o=n.slice(1,n.length-5);return{type:"styling",mode:a.mode,style:o,body:i}},htmlBuilder:function(e,t){var r=xn[e.style],n=t.havingStyle(r).withFont("");return yn(e.body,n,t)},mathmlBuilder:function(e,t){var r=xn[e.style],n=t.havingStyle(r),a=qt(e.body,n),i=new Tt.MathNode("mstyle",a),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var wn=function(e,t){var r=e.base;return r?"op"===r.type?r.limits&&(t.style.size===x.DISPLAY.size||r.alwaysHandleSupSub)?pn:null:"operatorname"===r.type?r.alwaysHandleSupSub&&(t.style.size===x.DISPLAY.size||r.limits)?vn:null:"accent"===r.type?l.isCharacterBox(r.base)?Wt:null:"horizBrace"===r.type&&!e.sub===r.isOver?ln:null:null};st({type:"supsub",htmlBuilder:function(e,t){var r=wn(e,t);if(r)return r(e,t);var n,a,i,o=e.base,s=e.sup,h=e.sub,c=wt(o,t),m=t.fontMetrics(),u=0,p=0,d=o&&l.isCharacterBox(o);if(s){var f=t.havingStyle(t.style.sup());n=wt(s,f,t),d||(u=c.height-f.fontMetrics().supDrop*f.sizeMultiplier/t.sizeMultiplier)}if(h){var g=t.havingStyle(t.style.sub());a=wt(h,g,t),d||(p=c.depth+g.fontMetrics().subDrop*g.sizeMultiplier/t.sizeMultiplier)}i=t.style===x.DISPLAY?m.sup1:t.style.cramped?m.sup3:m.sup2;var v,y=t.sizeMultiplier,b=F(.5/m.ptPerEm/y),w=null;if(a){var k=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof Z||k)&&(w=F(-c.italic))}if(n&&a){u=Math.max(u,i,n.depth+.25*m.xHeight),p=Math.max(p,m.sub2);var S=4*m.defaultRuleThickness;if(u-n.depth-(a.height-p)<S){p=S-(u-n.depth)+a.height;var M=.8*m.xHeight-(u-n.depth);M>0&&(u+=M,p-=M)}var z=[{type:"elem",elem:a,shift:p,marginRight:b,marginLeft:w},{type:"elem",elem:n,shift:-u,marginRight:b}];v=Ke.makeVList({positionType:"individualShift",children:z},t)}else if(a){p=Math.max(p,m.sub1,a.height-.8*m.xHeight);var A=[{type:"elem",elem:a,marginLeft:w,marginRight:b}];v=Ke.makeVList({positionType:"shift",positionData:p,children:A},t)}else{if(!n)throw new Error("supsub must have either sup or sub.");u=Math.max(u,i,n.depth+.25*m.xHeight),v=Ke.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:n,marginRight:b}]},t)}var T=bt(c,"right")||"mord";return Ke.makeSpan([T],[c,Ke.makeSpan(["msupsub"],[v])],t)},mathmlBuilder:function(e,t){var r,n=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(n=!0,r=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var a,i=[Rt(e.base,t)];if(e.sub&&i.push(Rt(e.sub,t)),e.sup&&i.push(Rt(e.sup,t)),n)a=r?"mover":"munder";else if(e.sub)if(e.sup){var o=e.base;a=o&&"op"===o.type&&o.limits&&t.style===x.DISPLAY||o&&"operatorname"===o.type&&o.alwaysHandleSupSub&&(t.style===x.DISPLAY||o.limits)?"munderover":"msubsup"}else{var s=e.base;a=s&&"op"===s.type&&s.limits&&(t.style===x.DISPLAY||s.alwaysHandleSupSub)||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(s.limits||t.style===x.DISPLAY)?"munder":"msub"}else{var l=e.base;a=l&&"op"===l.type&&l.limits&&(t.style===x.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===x.DISPLAY)?"mover":"msup"}return new Tt.MathNode(a,i)}}),st({type:"atom",htmlBuilder:function(e,t){return Ke.mathsym(e.text,e.mode,t,["m"+e.family])},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mo",[Bt(e.text,e.mode)]);if("bin"===e.family){var n=Nt(e,t);"bold-italic"===n&&r.setAttribute("mathvariant",n)}else"punct"===e.family?r.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||r.setAttribute("stretchy","false");return r}});var kn={mi:"italic",mn:"normal",mtext:"normal"};st({type:"mathord",htmlBuilder:function(e,t){return Ke.makeOrd(e,t,"mathord")},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mi",[Bt(e.text,e.mode,t)]),n=Nt(e,t)||"italic";return n!==kn[r.type]&&r.setAttribute("mathvariant",n),r}}),st({type:"textord",htmlBuilder:function(e,t){return Ke.makeOrd(e,t,"textord")},mathmlBuilder:function(e,t){var r,n=Bt(e.text,e.mode,t),a=Nt(e,t)||"normal";return r="text"===e.mode?new Tt.MathNode("mtext",[n]):/[0-9]/.test(e.text)?new Tt.MathNode("mn",[n]):"\\prime"===e.text?new Tt.MathNode("mo",[n]):new Tt.MathNode("mi",[n]),a!==kn[r.type]&&r.setAttribute("mathvariant",a),r}});var Sn={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Mn={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};st({type:"spacing",htmlBuilder:function(e,t){if(Mn.hasOwnProperty(e.text)){var r=Mn[e.text].className||"";if("text"===e.mode){var a=Ke.makeOrd(e,t,"textord");return a.classes.push(r),a}return Ke.makeSpan(["mspace",r],[Ke.mathsym(e.text,e.mode,t)],t)}if(Sn.hasOwnProperty(e.text))return Ke.makeSpan(["mspace",Sn[e.text]],[],t);throw new n('Unknown type of space "'+e.text+'"')},mathmlBuilder:function(e,t){if(!Mn.hasOwnProperty(e.text)){if(Sn.hasOwnProperty(e.text))return new Tt.MathNode("mspace");throw new n('Unknown type of space "'+e.text+'"')}return new Tt.MathNode("mtext",[new Tt.TextNode("\xa0")])}});var zn=function(){var e=new Tt.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};st({type:"tag",mathmlBuilder:function(e,t){var r=new Tt.MathNode("mtable",[new Tt.MathNode("mtr",[zn(),new Tt.MathNode("mtd",[It(e.body,t)]),zn(),new Tt.MathNode("mtd",[It(e.tag,t)])])]);return r.setAttribute("width","100%"),r}});var An={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Tn={"\\textbf":"textbf","\\textmd":"textmd"},Bn={"\\textit":"textit","\\textup":"textup"},Cn=function(e,t){var r=e.font;return r?An[r]?t.withTextFontFamily(An[r]):Tn[r]?t.withTextFontWeight(Tn[r]):t.withTextFontShape(Bn[r]):t};ot({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"text",mode:r.mode,body:ht(a),font:n}},htmlBuilder:function(e,t){var r=Cn(e,t),n=ft(e.body,r,!0);return Ke.makeSpan(["mord","text"],n,r)},mathmlBuilder:function(e,t){var r=Cn(e,t);return It(e.body,r)}}),ot({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){return{type:"underline",mode:e.parser.mode,body:t[0]}},htmlBuilder:function(e,t){var r=wt(e.body,t),n=Ke.makeLineSpan("underline-line",t),a=t.fontMetrics().defaultRuleThickness,i=Ke.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:a},{type:"elem",elem:n},{type:"kern",size:3*a},{type:"elem",elem:r}]},t);return Ke.makeSpan(["mord","underline"],[i],t)},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mo",[new Tt.TextNode("\u203e")]);r.setAttribute("stretchy","true");var n=new Tt.MathNode("munder",[Rt(e.body,t),r]);return n.setAttribute("accentunder","true"),n}}),ot({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler:function(e,t){return{type:"vcenter",mode:e.parser.mode,body:t[0]}},htmlBuilder:function(e,t){var r=wt(e.body,t),n=t.fontMetrics().axisHeight,a=.5*(r.height-n-(r.depth+n));return Ke.makeVList({positionType:"shift",positionData:a,children:[{type:"elem",elem:r}]},t)},mathmlBuilder:function(e,t){return new Tt.MathNode("mpadded",[Rt(e.body,t)],["vcenter"])}}),ot({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler:function(e,t,r){throw new n("\\verb ended by end of line instead of matching delimiter")},htmlBuilder:function(e,t){for(var r=Nn(e),n=[],a=t.havingStyle(t.style.text()),i=0;i<r.length;i++){var o=r[i];"~"===o&&(o="\\textasciitilde"),n.push(Ke.makeSymbol(o,"Typewriter-Regular",e.mode,a,["mord","texttt"]))}return Ke.makeSpan(["mord","text"].concat(a.sizingClasses(t)),Ke.tryCombineChars(n),a)},mathmlBuilder:function(e,t){var r=new Tt.TextNode(Nn(e)),n=new Tt.MathNode("mtext",[r]);return n.setAttribute("mathvariant","monospace"),n}});var Nn=function(e){return e.body.replace(/ /g,e.star?"\u2423":"\xa0")},qn=nt,In=new RegExp("[\u0300-\u036f]+$"),Rn=function(){function e(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp("([ \r\n\t]+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-\u2027\u202a-\ud7ff\uf900-\uffff][\u0300-\u036f]*|[\ud800-\udbff][\udc00-\udfff][\u0300-\u036f]*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|(\\\\[a-zA-Z@]+)[ \r\n\t]*|\\\\[^\ud800-\udfff])","g"),this.catcodes={"%":14,"~":13}}var t=e.prototype;return t.setCatcode=function(e,t){this.catcodes[e]=t},t.lex=function(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Gr("EOF",new Fr(this,t,t));var r=this.tokenRegex.exec(e);if(null===r||r.index!==t)throw new n("Unexpected character: '"+e[t]+"'",new Gr(e[t],new Fr(this,t,t+1)));var a=r[6]||r[3]||(r[2]?"\\ ":" ");if(14===this.catcodes[a]){var i=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===i?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new Gr(a,new Fr(this,t,this.tokenRegex.lastIndex))},e}(),Hn=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}var t=e.prototype;return t.beginGroup=function(){this.undefStack.push({})},t.endGroup=function(){if(0===this.undefStack.length)throw new n("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])},t.endGroups=function(){for(;this.undefStack.length>0;)this.endGroup()},t.has=function(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)},t.get=function(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]},t.set=function(e,t,r){if(void 0===r&&(r=!1),r){for(var n=0;n<this.undefStack.length;n++)delete this.undefStack[n][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t},e}(),On=Vr;Pr("\\noexpand",(function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}})),Pr("\\expandafter",(function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}})),Pr("\\@firstoftwo",(function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}})),Pr("\\@secondoftwo",(function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}})),Pr("\\@ifnextchar",(function(e){var t=e.consumeArgs(3);e.consumeSpaces();var r=e.future();return 1===t[0].length&&t[0][0].text===r.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}})),Pr("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Pr("\\TextOrMath",(function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}}));var En={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Pr("\\char",(function(e){var t,r=e.popToken(),a="";if("'"===r.text)t=8,r=e.popToken();else if('"'===r.text)t=16,r=e.popToken();else if("`"===r.text)if("\\"===(r=e.popToken()).text[0])a=r.text.charCodeAt(1);else{if("EOF"===r.text)throw new n("\\char` missing argument");a=r.text.charCodeAt(0)}else t=10;if(t){if(null==(a=En[r.text])||a>=t)throw new n("Invalid base-"+t+" digit "+r.text);for(var i;null!=(i=En[e.future().text])&&i<t;)a*=t,a+=i,e.popToken()}return"\\@char{"+a+"}"}));var Ln=function(e,t,r){var a=e.consumeArg().tokens;if(1!==a.length)throw new n("\\newcommand's first argument must be a macro name");var i=a[0].text,o=e.isDefined(i);if(o&&!t)throw new n("\\newcommand{"+i+"} attempting to redefine "+i+"; use \\renewcommand");if(!o&&!r)throw new n("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var s=0;if(1===(a=e.consumeArg().tokens).length&&"["===a[0].text){for(var l="",h=e.expandNextToken();"]"!==h.text&&"EOF"!==h.text;)l+=h.text,h=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new n("Invalid number of arguments: "+l);s=parseInt(l),a=e.consumeArg().tokens}return e.macros.set(i,{tokens:a,numArgs:s}),""};Pr("\\newcommand",(function(e){return Ln(e,!1,!0)})),Pr("\\renewcommand",(function(e){return Ln(e,!0,!1)})),Pr("\\providecommand",(function(e){return Ln(e,!0,!0)})),Pr("\\message",(function(e){var t=e.consumeArgs(1)[0];return console.log(t.reverse().map((function(e){return e.text})).join("")),""})),Pr("\\errmessage",(function(e){var t=e.consumeArgs(1)[0];return console.error(t.reverse().map((function(e){return e.text})).join("")),""})),Pr("\\show",(function(e){var t=e.popToken(),r=t.text;return console.log(t,e.macros.get(r),qn[r],ae.math[r],ae.text[r]),""})),Pr("\\bgroup","{"),Pr("\\egroup","}"),Pr("~","\\nobreakspace"),Pr("\\lq","`"),Pr("\\rq","'"),Pr("\\aa","\\r a"),Pr("\\AA","\\r A"),Pr("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xa9}"),Pr("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),Pr("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xae}"),Pr("\u212c","\\mathscr{B}"),Pr("\u2130","\\mathscr{E}"),Pr("\u2131","\\mathscr{F}"),Pr("\u210b","\\mathscr{H}"),Pr("\u2110","\\mathscr{I}"),Pr("\u2112","\\mathscr{L}"),Pr("\u2133","\\mathscr{M}"),Pr("\u211b","\\mathscr{R}"),Pr("\u212d","\\mathfrak{C}"),Pr("\u210c","\\mathfrak{H}"),Pr("\u2128","\\mathfrak{Z}"),Pr("\\Bbbk","\\Bbb{k}"),Pr("\xb7","\\cdotp"),Pr("\\llap","\\mathllap{\\textrm{#1}}"),Pr("\\rlap","\\mathrlap{\\textrm{#1}}"),Pr("\\clap","\\mathclap{\\textrm{#1}}"),Pr("\\mathstrut","\\vphantom{(}"),Pr("\\underbar","\\underline{\\text{#1}}"),Pr("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),Pr("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}"),Pr("\\ne","\\neq"),Pr("\u2260","\\neq"),Pr("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}"),Pr("\u2209","\\notin"),Pr("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}"),Pr("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}"),Pr("\u225a","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225a}}"),Pr("\u225b","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225b}}"),Pr("\u225d","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225d}}"),Pr("\u225e","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225e}}"),Pr("\u225f","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225f}}"),Pr("\u27c2","\\perp"),Pr("\u203c","\\mathclose{!\\mkern-0.8mu!}"),Pr("\u220c","\\notni"),Pr("\u231c","\\ulcorner"),Pr("\u231d","\\urcorner"),Pr("\u231e","\\llcorner"),Pr("\u231f","\\lrcorner"),Pr("\xa9","\\copyright"),Pr("\xae","\\textregistered"),Pr("\ufe0f","\\textregistered"),Pr("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),Pr("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),Pr("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),Pr("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),Pr("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),Pr("\u22ee","\\vdots"),Pr("\\varGamma","\\mathit{\\Gamma}"),Pr("\\varDelta","\\mathit{\\Delta}"),Pr("\\varTheta","\\mathit{\\Theta}"),Pr("\\varLambda","\\mathit{\\Lambda}"),Pr("\\varXi","\\mathit{\\Xi}"),Pr("\\varPi","\\mathit{\\Pi}"),Pr("\\varSigma","\\mathit{\\Sigma}"),Pr("\\varUpsilon","\\mathit{\\Upsilon}"),Pr("\\varPhi","\\mathit{\\Phi}"),Pr("\\varPsi","\\mathit{\\Psi}"),Pr("\\varOmega","\\mathit{\\Omega}"),Pr("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),Pr("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),Pr("\\boxed","\\fbox{$\\displaystyle{#1}$}"),Pr("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),Pr("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),Pr("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var Dn={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};Pr("\\dots",(function(e){var t="\\dotso",r=e.expandAfterFuture().text;return r in Dn?t=Dn[r]:("\\not"===r.slice(0,4)||r in ae.math&&l.contains(["bin","rel"],ae.math[r].group))&&(t="\\dotsb"),t}));var Vn={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Pr("\\dotso",(function(e){return e.future().text in Vn?"\\ldots\\,":"\\ldots"})),Pr("\\dotsc",(function(e){var t=e.future().text;return t in Vn&&","!==t?"\\ldots\\,":"\\ldots"})),Pr("\\cdots",(function(e){return e.future().text in Vn?"\\@cdots\\,":"\\@cdots"})),Pr("\\dotsb","\\cdots"),Pr("\\dotsm","\\cdots"),Pr("\\dotsi","\\!\\cdots"),Pr("\\dotsx","\\ldots\\,"),Pr("\\DOTSI","\\relax"),Pr("\\DOTSB","\\relax"),Pr("\\DOTSX","\\relax"),Pr("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Pr("\\,","\\tmspace+{3mu}{.1667em}"),Pr("\\thinspace","\\,"),Pr("\\>","\\mskip{4mu}"),Pr("\\:","\\tmspace+{4mu}{.2222em}"),Pr("\\medspace","\\:"),Pr("\\;","\\tmspace+{5mu}{.2777em}"),Pr("\\thickspace","\\;"),Pr("\\!","\\tmspace-{3mu}{.1667em}"),Pr("\\negthinspace","\\!"),Pr("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Pr("\\negthickspace","\\tmspace-{5mu}{.277em}"),Pr("\\enspace","\\kern.5em "),Pr("\\enskip","\\hskip.5em\\relax"),Pr("\\quad","\\hskip1em\\relax"),Pr("\\qquad","\\hskip2em\\relax"),Pr("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Pr("\\tag@paren","\\tag@literal{({#1})}"),Pr("\\tag@literal",(function(e){if(e.macros.get("\\df@tag"))throw new n("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),Pr("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Pr("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Pr("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Pr("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Pr("\\newline","\\\\\\relax"),Pr("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Pn=F(T["Main-Regular"]["T".charCodeAt(0)][1]-.7*T["Main-Regular"]["A".charCodeAt(0)][1]);Pr("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+Pn+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),Pr("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+Pn+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),Pr("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Pr("\\@hspace","\\hskip #1\\relax"),Pr("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Pr("\\ordinarycolon",":"),Pr("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Pr("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Pr("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Pr("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Pr("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Pr("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Pr("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Pr("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Pr("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Pr("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Pr("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Pr("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Pr("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Pr("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Pr("\u2237","\\dblcolon"),Pr("\u2239","\\eqcolon"),Pr("\u2254","\\coloneqq"),Pr("\u2255","\\eqqcolon"),Pr("\u2a74","\\Coloneqq"),Pr("\\ratio","\\vcentcolon"),Pr("\\coloncolon","\\dblcolon"),Pr("\\colonequals","\\coloneqq"),Pr("\\coloncolonequals","\\Coloneqq"),Pr("\\equalscolon","\\eqqcolon"),Pr("\\equalscoloncolon","\\Eqqcolon"),Pr("\\colonminus","\\coloneq"),Pr("\\coloncolonminus","\\Coloneq"),Pr("\\minuscolon","\\eqcolon"),Pr("\\minuscoloncolon","\\Eqcolon"),Pr("\\coloncolonapprox","\\Colonapprox"),Pr("\\coloncolonsim","\\Colonsim"),Pr("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Pr("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Pr("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Pr("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Pr("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220c}}"),Pr("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Pr("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Pr("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),Pr("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),Pr("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),Pr("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),Pr("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),Pr("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),Pr("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}"),Pr("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}"),Pr("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}"),Pr("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}"),Pr("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}"),Pr("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}"),Pr("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}"),Pr("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}"),Pr("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}"),Pr("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}"),Pr("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228a}"),Pr("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2acb}"),Pr("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228b}"),Pr("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2acc}"),Pr("\\imath","\\html@mathml{\\@imath}{\u0131}"),Pr("\\jmath","\\html@mathml{\\@jmath}{\u0237}"),Pr("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27e6}}"),Pr("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27e7}}"),Pr("\u27e6","\\llbracket"),Pr("\u27e7","\\rrbracket"),Pr("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}"),Pr("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}"),Pr("\u2983","\\lBrace"),Pr("\u2984","\\rBrace"),Pr("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`\u29b5}}"),Pr("\u29b5","\\minuso"),Pr("\\darr","\\downarrow"),Pr("\\dArr","\\Downarrow"),Pr("\\Darr","\\Downarrow"),Pr("\\lang","\\langle"),Pr("\\rang","\\rangle"),Pr("\\uarr","\\uparrow"),Pr("\\uArr","\\Uparrow"),Pr("\\Uarr","\\Uparrow"),Pr("\\N","\\mathbb{N}"),Pr("\\R","\\mathbb{R}"),Pr("\\Z","\\mathbb{Z}"),Pr("\\alef","\\aleph"),Pr("\\alefsym","\\aleph"),Pr("\\Alpha","\\mathrm{A}"),Pr("\\Beta","\\mathrm{B}"),Pr("\\bull","\\bullet"),Pr("\\Chi","\\mathrm{X}"),Pr("\\clubs","\\clubsuit"),Pr("\\cnums","\\mathbb{C}"),Pr("\\Complex","\\mathbb{C}"),Pr("\\Dagger","\\ddagger"),Pr("\\diamonds","\\diamondsuit"),Pr("\\empty","\\emptyset"),Pr("\\Epsilon","\\mathrm{E}"),Pr("\\Eta","\\mathrm{H}"),Pr("\\exist","\\exists"),Pr("\\harr","\\leftrightarrow"),Pr("\\hArr","\\Leftrightarrow"),Pr("\\Harr","\\Leftrightarrow"),Pr("\\hearts","\\heartsuit"),Pr("\\image","\\Im"),Pr("\\infin","\\infty"),Pr("\\Iota","\\mathrm{I}"),Pr("\\isin","\\in"),Pr("\\Kappa","\\mathrm{K}"),Pr("\\larr","\\leftarrow"),Pr("\\lArr","\\Leftarrow"),Pr("\\Larr","\\Leftarrow"),Pr("\\lrarr","\\leftrightarrow"),Pr("\\lrArr","\\Leftrightarrow"),Pr("\\Lrarr","\\Leftrightarrow"),Pr("\\Mu","\\mathrm{M}"),Pr("\\natnums","\\mathbb{N}"),Pr("\\Nu","\\mathrm{N}"),Pr("\\Omicron","\\mathrm{O}"),Pr("\\plusmn","\\pm"),Pr("\\rarr","\\rightarrow"),Pr("\\rArr","\\Rightarrow"),Pr("\\Rarr","\\Rightarrow"),Pr("\\real","\\Re"),Pr("\\reals","\\mathbb{R}"),Pr("\\Reals","\\mathbb{R}"),Pr("\\Rho","\\mathrm{P}"),Pr("\\sdot","\\cdot"),Pr("\\sect","\\S"),Pr("\\spades","\\spadesuit"),Pr("\\sub","\\subset"),Pr("\\sube","\\subseteq"),Pr("\\supe","\\supseteq"),Pr("\\Tau","\\mathrm{T}"),Pr("\\thetasym","\\vartheta"),Pr("\\weierp","\\wp"),Pr("\\Zeta","\\mathrm{Z}"),Pr("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Pr("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Pr("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Pr("\\bra","\\mathinner{\\langle{#1}|}"),Pr("\\ket","\\mathinner{|{#1}\\rangle}"),Pr("\\braket","\\mathinner{\\langle{#1}\\rangle}"),Pr("\\Bra","\\left\\langle#1\\right|"),Pr("\\Ket","\\left|#1\\right\\rangle");var Fn=function(e){return function(t){var r=t.consumeArg().tokens,n=t.consumeArg().tokens,a=t.consumeArg().tokens,i=t.consumeArg().tokens,o=t.macros.get("|"),s=t.macros.get("\\|");t.macros.beginGroup();var l=function(t){return function(r){e&&(r.macros.set("|",o),a.length&&r.macros.set("\\|",s));var i=t;!t&&a.length&&("|"===r.future().text&&(r.popToken(),i=!0));return{tokens:i?a:n,numArgs:0}}};t.macros.set("|",l(!1)),a.length&&t.macros.set("\\|",l(!0));var h=t.consumeArg().tokens,c=t.expandTokens([].concat(i,h,r));return t.macros.endGroup(),{tokens:c.reverse(),numArgs:0}}};Pr("\\bra@ket",Fn(!1)),Pr("\\bra@set",Fn(!0)),Pr("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),Pr("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),Pr("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),Pr("\\angln","{\\angl n}"),Pr("\\blue","\\textcolor{##6495ed}{#1}"),Pr("\\orange","\\textcolor{##ffa500}{#1}"),Pr("\\pink","\\textcolor{##ff00af}{#1}"),Pr("\\red","\\textcolor{##df0030}{#1}"),Pr("\\green","\\textcolor{##28ae7b}{#1}"),Pr("\\gray","\\textcolor{gray}{#1}"),Pr("\\purple","\\textcolor{##9d38bd}{#1}"),Pr("\\blueA","\\textcolor{##ccfaff}{#1}"),Pr("\\blueB","\\textcolor{##80f6ff}{#1}"),Pr("\\blueC","\\textcolor{##63d9ea}{#1}"),Pr("\\blueD","\\textcolor{##11accd}{#1}"),Pr("\\blueE","\\textcolor{##0c7f99}{#1}"),Pr("\\tealA","\\textcolor{##94fff5}{#1}"),Pr("\\tealB","\\textcolor{##26edd5}{#1}"),Pr("\\tealC","\\textcolor{##01d1c1}{#1}"),Pr("\\tealD","\\textcolor{##01a995}{#1}"),Pr("\\tealE","\\textcolor{##208170}{#1}"),Pr("\\greenA","\\textcolor{##b6ffb0}{#1}"),Pr("\\greenB","\\textcolor{##8af281}{#1}"),Pr("\\greenC","\\textcolor{##74cf70}{#1}"),Pr("\\greenD","\\textcolor{##1fab54}{#1}"),Pr("\\greenE","\\textcolor{##0d923f}{#1}"),Pr("\\goldA","\\textcolor{##ffd0a9}{#1}"),Pr("\\goldB","\\textcolor{##ffbb71}{#1}"),Pr("\\goldC","\\textcolor{##ff9c39}{#1}"),Pr("\\goldD","\\textcolor{##e07d10}{#1}"),Pr("\\goldE","\\textcolor{##a75a05}{#1}"),Pr("\\redA","\\textcolor{##fca9a9}{#1}"),Pr("\\redB","\\textcolor{##ff8482}{#1}"),Pr("\\redC","\\textcolor{##f9685d}{#1}"),Pr("\\redD","\\textcolor{##e84d39}{#1}"),Pr("\\redE","\\textcolor{##bc2612}{#1}"),Pr("\\maroonA","\\textcolor{##ffbde0}{#1}"),Pr("\\maroonB","\\textcolor{##ff92c6}{#1}"),Pr("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Pr("\\maroonD","\\textcolor{##ca337c}{#1}"),Pr("\\maroonE","\\textcolor{##9e034e}{#1}"),Pr("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Pr("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Pr("\\purpleC","\\textcolor{##aa87ff}{#1}"),Pr("\\purpleD","\\textcolor{##7854ab}{#1}"),Pr("\\purpleE","\\textcolor{##543b78}{#1}"),Pr("\\mintA","\\textcolor{##f5f9e8}{#1}"),Pr("\\mintB","\\textcolor{##edf2df}{#1}"),Pr("\\mintC","\\textcolor{##e0e5cc}{#1}"),Pr("\\grayA","\\textcolor{##f6f7f7}{#1}"),Pr("\\grayB","\\textcolor{##f0f1f2}{#1}"),Pr("\\grayC","\\textcolor{##e3e5e6}{#1}"),Pr("\\grayD","\\textcolor{##d6d8da}{#1}"),Pr("\\grayE","\\textcolor{##babec2}{#1}"),Pr("\\grayF","\\textcolor{##888d93}{#1}"),Pr("\\grayG","\\textcolor{##626569}{#1}"),Pr("\\grayH","\\textcolor{##3b3e40}{#1}"),Pr("\\grayI","\\textcolor{##21242c}{#1}"),Pr("\\kaBlue","\\textcolor{##314453}{#1}"),Pr("\\kaGreen","\\textcolor{##71B307}{#1}");var Gn={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},Un=function(){function e(e,t,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new Hn(On,t.macros),this.mode=r,this.stack=[]}var t=e.prototype;return t.feed=function(e){this.lexer=new Rn(e,this.settings)},t.switchMode=function(e){this.mode=e},t.beginGroup=function(){this.macros.beginGroup()},t.endGroup=function(){this.macros.endGroup()},t.endGroups=function(){this.macros.endGroups()},t.future=function(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]},t.popToken=function(){return this.future(),this.stack.pop()},t.pushToken=function(e){this.stack.push(e)},t.pushTokens=function(e){var t;(t=this.stack).push.apply(t,e)},t.scanArgument=function(e){var t,r,n;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken();var a=this.consumeArg(["]"]);n=a.tokens,r=a.end}else{var i=this.consumeArg();n=i.tokens,t=i.start,r=i.end}return this.pushToken(new Gr("EOF",r.loc)),this.pushTokens(n),t.range(r,"")},t.consumeSpaces=function(){for(;;){if(" "!==this.future().text)break;this.stack.pop()}},t.consumeArg=function(e){var t=[],r=e&&e.length>0;r||this.consumeSpaces();var a,i=this.future(),o=0,s=0;do{if(a=this.popToken(),t.push(a),"{"===a.text)++o;else if("}"===a.text){if(-1===--o)throw new n("Extra }",a)}else if("EOF"===a.text)throw new n("Unexpected end of input in a macro argument, expected '"+(e&&r?e[s]:"}")+"'",a);if(e&&r)if((0===o||1===o&&"{"===e[s])&&a.text===e[s]){if(++s===e.length){t.splice(-s,s);break}}else s=0}while(0!==o||r);return"{"===i.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:i,end:a}},t.consumeArgs=function(e,t){if(t){if(t.length!==e+1)throw new n("The length of delimiters doesn't match the number of args!");for(var r=t[0],a=0;a<r.length;a++){var i=this.popToken();if(r[a]!==i.text)throw new n("Use of the macro doesn't match its definition",i)}}for(var o=[],s=0;s<e;s++)o.push(this.consumeArg(t&&t[s+1]).tokens);return o},t.expandOnce=function(e){var t=this.popToken(),r=t.text,a=t.noexpand?null:this._getExpansion(r);if(null==a||e&&a.unexpandable){if(e&&null==a&&"\\"===r[0]&&!this.isDefined(r))throw new n("Undefined control sequence: "+r);return this.pushToken(t),t}if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new n("Too many expansions: infinite loop or need to increase maxExpand setting");var i=a.tokens,o=this.consumeArgs(a.numArgs,a.delimiters);if(a.numArgs)for(var s=(i=i.slice()).length-1;s>=0;--s){var l=i[s];if("#"===l.text){if(0===s)throw new n("Incomplete placeholder at end of macro body",l);if("#"===(l=i[--s]).text)i.splice(s+1,1);else{if(!/^[1-9]$/.test(l.text))throw new n("Not a valid argument number",l);var h;(h=i).splice.apply(h,[s,2].concat(o[+l.text-1]))}}}return this.pushTokens(i),i},t.expandAfterFuture=function(){return this.expandOnce(),this.future()},t.expandNextToken=function(){for(;;){var e=this.expandOnce();if(e instanceof Gr)return e.treatAsRelax&&(e.text="\\relax"),this.stack.pop()}throw new Error},t.expandMacro=function(e){return this.macros.has(e)?this.expandTokens([new Gr(e)]):void 0},t.expandTokens=function(e){var t=[],r=this.stack.length;for(this.pushTokens(e);this.stack.length>r;){var n=this.expandOnce(!0);n instanceof Gr&&(n.treatAsRelax&&(n.noexpand=!1,n.treatAsRelax=!1),t.push(this.stack.pop()))}return t},t.expandMacroAsText=function(e){var t=this.expandMacro(e);return t?t.map((function(e){return e.text})).join(""):t},t._getExpansion=function(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var r=this.lexer.catcodes[e];if(null!=r&&13!==r)return}var n="function"==typeof t?t(this):t;if("string"==typeof n){var a=0;if(-1!==n.indexOf("#"))for(var i=n.replace(/##/g,"");-1!==i.indexOf("#"+(a+1));)++a;for(var o=new Rn(n,this.settings),s=[],l=o.lex();"EOF"!==l.text;)s.push(l),l=o.lex();return s.reverse(),{tokens:s,numArgs:a}}return n},t.isDefined=function(e){return this.macros.has(e)||qn.hasOwnProperty(e)||ae.math.hasOwnProperty(e)||ae.text.hasOwnProperty(e)||Gn.hasOwnProperty(e)},t.isExpandable=function(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:qn.hasOwnProperty(e)&&!qn[e].primitive},e}(),Yn=/^[\u208a\u208b\u208c\u208d\u208e\u2080\u2081\u2082\u2083\u2084\u2085\u2086\u2087\u2088\u2089\u2090\u2091\u2095\u1d62\u2c7c\u2096\u2097\u2098\u2099\u2092\u209a\u1d63\u209b\u209c\u1d64\u1d65\u2093\u1d66\u1d67\u1d68\u1d69\u1d6a]/,Xn=Object.freeze({"\u208a":"+","\u208b":"-","\u208c":"=","\u208d":"(","\u208e":")","\u2080":"0","\u2081":"1","\u2082":"2","\u2083":"3","\u2084":"4","\u2085":"5","\u2086":"6","\u2087":"7","\u2088":"8","\u2089":"9","\u2090":"a","\u2091":"e","\u2095":"h","\u1d62":"i","\u2c7c":"j","\u2096":"k","\u2097":"l","\u2098":"m","\u2099":"n","\u2092":"o","\u209a":"p","\u1d63":"r","\u209b":"s","\u209c":"t","\u1d64":"u","\u1d65":"v","\u2093":"x","\u1d66":"\u03b2","\u1d67":"\u03b3","\u1d68":"\u03c1","\u1d69":"\u03d5","\u1d6a":"\u03c7","\u207a":"+","\u207b":"-","\u207c":"=","\u207d":"(","\u207e":")","\u2070":"0","\xb9":"1","\xb2":"2","\xb3":"3","\u2074":"4","\u2075":"5","\u2076":"6","\u2077":"7","\u2078":"8","\u2079":"9","\u1d2c":"A","\u1d2e":"B","\u1d30":"D","\u1d31":"E","\u1d33":"G","\u1d34":"H","\u1d35":"I","\u1d36":"J","\u1d37":"K","\u1d38":"L","\u1d39":"M","\u1d3a":"N","\u1d3c":"O","\u1d3e":"P","\u1d3f":"R","\u1d40":"T","\u1d41":"U","\u2c7d":"V","\u1d42":"W","\u1d43":"a","\u1d47":"b","\u1d9c":"c","\u1d48":"d","\u1d49":"e","\u1da0":"f","\u1d4d":"g","\u02b0":"h","\u2071":"i","\u02b2":"j","\u1d4f":"k","\u02e1":"l","\u1d50":"m","\u207f":"n","\u1d52":"o","\u1d56":"p","\u02b3":"r","\u02e2":"s","\u1d57":"t","\u1d58":"u","\u1d5b":"v","\u02b7":"w","\u02e3":"x","\u02b8":"y","\u1dbb":"z","\u1d5d":"\u03b2","\u1d5e":"\u03b3","\u1d5f":"\u03b4","\u1d60":"\u03d5","\u1d61":"\u03c7","\u1dbf":"\u03b8"}),Wn={"\u0301":{text:"\\'",math:"\\acute"},"\u0300":{text:"\\`",math:"\\grave"},"\u0308":{text:'\\"',math:"\\ddot"},"\u0303":{text:"\\~",math:"\\tilde"},"\u0304":{text:"\\=",math:"\\bar"},"\u0306":{text:"\\u",math:"\\breve"},"\u030c":{text:"\\v",math:"\\check"},"\u0302":{text:"\\^",math:"\\hat"},"\u0307":{text:"\\.",math:"\\dot"},"\u030a":{text:"\\r",math:"\\mathring"},"\u030b":{text:"\\H"},"\u0327":{text:"\\c"}},_n={"\xe1":"a\u0301","\xe0":"a\u0300","\xe4":"a\u0308","\u01df":"a\u0308\u0304","\xe3":"a\u0303","\u0101":"a\u0304","\u0103":"a\u0306","\u1eaf":"a\u0306\u0301","\u1eb1":"a\u0306\u0300","\u1eb5":"a\u0306\u0303","\u01ce":"a\u030c","\xe2":"a\u0302","\u1ea5":"a\u0302\u0301","\u1ea7":"a\u0302\u0300","\u1eab":"a\u0302\u0303","\u0227":"a\u0307","\u01e1":"a\u0307\u0304","\xe5":"a\u030a","\u01fb":"a\u030a\u0301","\u1e03":"b\u0307","\u0107":"c\u0301","\u1e09":"c\u0327\u0301","\u010d":"c\u030c","\u0109":"c\u0302","\u010b":"c\u0307","\xe7":"c\u0327","\u010f":"d\u030c","\u1e0b":"d\u0307","\u1e11":"d\u0327","\xe9":"e\u0301","\xe8":"e\u0300","\xeb":"e\u0308","\u1ebd":"e\u0303","\u0113":"e\u0304","\u1e17":"e\u0304\u0301","\u1e15":"e\u0304\u0300","\u0115":"e\u0306","\u1e1d":"e\u0327\u0306","\u011b":"e\u030c","\xea":"e\u0302","\u1ebf":"e\u0302\u0301","\u1ec1":"e\u0302\u0300","\u1ec5":"e\u0302\u0303","\u0117":"e\u0307","\u0229":"e\u0327","\u1e1f":"f\u0307","\u01f5":"g\u0301","\u1e21":"g\u0304","\u011f":"g\u0306","\u01e7":"g\u030c","\u011d":"g\u0302","\u0121":"g\u0307","\u0123":"g\u0327","\u1e27":"h\u0308","\u021f":"h\u030c","\u0125":"h\u0302","\u1e23":"h\u0307","\u1e29":"h\u0327","\xed":"i\u0301","\xec":"i\u0300","\xef":"i\u0308","\u1e2f":"i\u0308\u0301","\u0129":"i\u0303","\u012b":"i\u0304","\u012d":"i\u0306","\u01d0":"i\u030c","\xee":"i\u0302","\u01f0":"j\u030c","\u0135":"j\u0302","\u1e31":"k\u0301","\u01e9":"k\u030c","\u0137":"k\u0327","\u013a":"l\u0301","\u013e":"l\u030c","\u013c":"l\u0327","\u1e3f":"m\u0301","\u1e41":"m\u0307","\u0144":"n\u0301","\u01f9":"n\u0300","\xf1":"n\u0303","\u0148":"n\u030c","\u1e45":"n\u0307","\u0146":"n\u0327","\xf3":"o\u0301","\xf2":"o\u0300","\xf6":"o\u0308","\u022b":"o\u0308\u0304","\xf5":"o\u0303","\u1e4d":"o\u0303\u0301","\u1e4f":"o\u0303\u0308","\u022d":"o\u0303\u0304","\u014d":"o\u0304","\u1e53":"o\u0304\u0301","\u1e51":"o\u0304\u0300","\u014f":"o\u0306","\u01d2":"o\u030c","\xf4":"o\u0302","\u1ed1":"o\u0302\u0301","\u1ed3":"o\u0302\u0300","\u1ed7":"o\u0302\u0303","\u022f":"o\u0307","\u0231":"o\u0307\u0304","\u0151":"o\u030b","\u1e55":"p\u0301","\u1e57":"p\u0307","\u0155":"r\u0301","\u0159":"r\u030c","\u1e59":"r\u0307","\u0157":"r\u0327","\u015b":"s\u0301","\u1e65":"s\u0301\u0307","\u0161":"s\u030c","\u1e67":"s\u030c\u0307","\u015d":"s\u0302","\u1e61":"s\u0307","\u015f":"s\u0327","\u1e97":"t\u0308","\u0165":"t\u030c","\u1e6b":"t\u0307","\u0163":"t\u0327","\xfa":"u\u0301","\xf9":"u\u0300","\xfc":"u\u0308","\u01d8":"u\u0308\u0301","\u01dc":"u\u0308\u0300","\u01d6":"u\u0308\u0304","\u01da":"u\u0308\u030c","\u0169":"u\u0303","\u1e79":"u\u0303\u0301","\u016b":"u\u0304","\u1e7b":"u\u0304\u0308","\u016d":"u\u0306","\u01d4":"u\u030c","\xfb":"u\u0302","\u016f":"u\u030a","\u0171":"u\u030b","\u1e7d":"v\u0303","\u1e83":"w\u0301","\u1e81":"w\u0300","\u1e85":"w\u0308","\u0175":"w\u0302","\u1e87":"w\u0307","\u1e98":"w\u030a","\u1e8d":"x\u0308","\u1e8b":"x\u0307","\xfd":"y\u0301","\u1ef3":"y\u0300","\xff":"y\u0308","\u1ef9":"y\u0303","\u0233":"y\u0304","\u0177":"y\u0302","\u1e8f":"y\u0307","\u1e99":"y\u030a","\u017a":"z\u0301","\u017e":"z\u030c","\u1e91":"z\u0302","\u017c":"z\u0307","\xc1":"A\u0301","\xc0":"A\u0300","\xc4":"A\u0308","\u01de":"A\u0308\u0304","\xc3":"A\u0303","\u0100":"A\u0304","\u0102":"A\u0306","\u1eae":"A\u0306\u0301","\u1eb0":"A\u0306\u0300","\u1eb4":"A\u0306\u0303","\u01cd":"A\u030c","\xc2":"A\u0302","\u1ea4":"A\u0302\u0301","\u1ea6":"A\u0302\u0300","\u1eaa":"A\u0302\u0303","\u0226":"A\u0307","\u01e0":"A\u0307\u0304","\xc5":"A\u030a","\u01fa":"A\u030a\u0301","\u1e02":"B\u0307","\u0106":"C\u0301","\u1e08":"C\u0327\u0301","\u010c":"C\u030c","\u0108":"C\u0302","\u010a":"C\u0307","\xc7":"C\u0327","\u010e":"D\u030c","\u1e0a":"D\u0307","\u1e10":"D\u0327","\xc9":"E\u0301","\xc8":"E\u0300","\xcb":"E\u0308","\u1ebc":"E\u0303","\u0112":"E\u0304","\u1e16":"E\u0304\u0301","\u1e14":"E\u0304\u0300","\u0114":"E\u0306","\u1e1c":"E\u0327\u0306","\u011a":"E\u030c","\xca":"E\u0302","\u1ebe":"E\u0302\u0301","\u1ec0":"E\u0302\u0300","\u1ec4":"E\u0302\u0303","\u0116":"E\u0307","\u0228":"E\u0327","\u1e1e":"F\u0307","\u01f4":"G\u0301","\u1e20":"G\u0304","\u011e":"G\u0306","\u01e6":"G\u030c","\u011c":"G\u0302","\u0120":"G\u0307","\u0122":"G\u0327","\u1e26":"H\u0308","\u021e":"H\u030c","\u0124":"H\u0302","\u1e22":"H\u0307","\u1e28":"H\u0327","\xcd":"I\u0301","\xcc":"I\u0300","\xcf":"I\u0308","\u1e2e":"I\u0308\u0301","\u0128":"I\u0303","\u012a":"I\u0304","\u012c":"I\u0306","\u01cf":"I\u030c","\xce":"I\u0302","\u0130":"I\u0307","\u0134":"J\u0302","\u1e30":"K\u0301","\u01e8":"K\u030c","\u0136":"K\u0327","\u0139":"L\u0301","\u013d":"L\u030c","\u013b":"L\u0327","\u1e3e":"M\u0301","\u1e40":"M\u0307","\u0143":"N\u0301","\u01f8":"N\u0300","\xd1":"N\u0303","\u0147":"N\u030c","\u1e44":"N\u0307","\u0145":"N\u0327","\xd3":"O\u0301","\xd2":"O\u0300","\xd6":"O\u0308","\u022a":"O\u0308\u0304","\xd5":"O\u0303","\u1e4c":"O\u0303\u0301","\u1e4e":"O\u0303\u0308","\u022c":"O\u0303\u0304","\u014c":"O\u0304","\u1e52":"O\u0304\u0301","\u1e50":"O\u0304\u0300","\u014e":"O\u0306","\u01d1":"O\u030c","\xd4":"O\u0302","\u1ed0":"O\u0302\u0301","\u1ed2":"O\u0302\u0300","\u1ed6":"O\u0302\u0303","\u022e":"O\u0307","\u0230":"O\u0307\u0304","\u0150":"O\u030b","\u1e54":"P\u0301","\u1e56":"P\u0307","\u0154":"R\u0301","\u0158":"R\u030c","\u1e58":"R\u0307","\u0156":"R\u0327","\u015a":"S\u0301","\u1e64":"S\u0301\u0307","\u0160":"S\u030c","\u1e66":"S\u030c\u0307","\u015c":"S\u0302","\u1e60":"S\u0307","\u015e":"S\u0327","\u0164":"T\u030c","\u1e6a":"T\u0307","\u0162":"T\u0327","\xda":"U\u0301","\xd9":"U\u0300","\xdc":"U\u0308","\u01d7":"U\u0308\u0301","\u01db":"U\u0308\u0300","\u01d5":"U\u0308\u0304","\u01d9":"U\u0308\u030c","\u0168":"U\u0303","\u1e78":"U\u0303\u0301","\u016a":"U\u0304","\u1e7a":"U\u0304\u0308","\u016c":"U\u0306","\u01d3":"U\u030c","\xdb":"U\u0302","\u016e":"U\u030a","\u0170":"U\u030b","\u1e7c":"V\u0303","\u1e82":"W\u0301","\u1e80":"W\u0300","\u1e84":"W\u0308","\u0174":"W\u0302","\u1e86":"W\u0307","\u1e8c":"X\u0308","\u1e8a":"X\u0307","\xdd":"Y\u0301","\u1ef2":"Y\u0300","\u0178":"Y\u0308","\u1ef8":"Y\u0303","\u0232":"Y\u0304","\u0176":"Y\u0302","\u1e8e":"Y\u0307","\u0179":"Z\u0301","\u017d":"Z\u030c","\u1e90":"Z\u0302","\u017b":"Z\u0307","\u03ac":"\u03b1\u0301","\u1f70":"\u03b1\u0300","\u1fb1":"\u03b1\u0304","\u1fb0":"\u03b1\u0306","\u03ad":"\u03b5\u0301","\u1f72":"\u03b5\u0300","\u03ae":"\u03b7\u0301","\u1f74":"\u03b7\u0300","\u03af":"\u03b9\u0301","\u1f76":"\u03b9\u0300","\u03ca":"\u03b9\u0308","\u0390":"\u03b9\u0308\u0301","\u1fd2":"\u03b9\u0308\u0300","\u1fd1":"\u03b9\u0304","\u1fd0":"\u03b9\u0306","\u03cc":"\u03bf\u0301","\u1f78":"\u03bf\u0300","\u03cd":"\u03c5\u0301","\u1f7a":"\u03c5\u0300","\u03cb":"\u03c5\u0308","\u03b0":"\u03c5\u0308\u0301","\u1fe2":"\u03c5\u0308\u0300","\u1fe1":"\u03c5\u0304","\u1fe0":"\u03c5\u0306","\u03ce":"\u03c9\u0301","\u1f7c":"\u03c9\u0300","\u038e":"\u03a5\u0301","\u1fea":"\u03a5\u0300","\u03ab":"\u03a5\u0308","\u1fe9":"\u03a5\u0304","\u1fe8":"\u03a5\u0306","\u038f":"\u03a9\u0301","\u1ffa":"\u03a9\u0300"},jn=function(){function e(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Un(e,t,this.mode),this.settings=t,this.leftrightDepth=0}var t=e.prototype;return t.expect=function(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new n("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()},t.consume=function(){this.nextToken=null},t.fetch=function(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken},t.switchMode=function(e){this.mode=e,this.gullet.switchMode(e)},t.parse=function(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}},t.subparse=function(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Gr("}")),this.gullet.pushTokens(e);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r},t.parseExpression=function(t,r){for(var n=[];;){"math"===this.mode&&this.consumeSpaces();var a=this.fetch();if(-1!==e.endOfExpression.indexOf(a.text))break;if(r&&a.text===r)break;if(t&&qn[a.text]&&qn[a.text].infix)break;var i=this.parseAtom(r);if(!i)break;"internal"!==i.type&&n.push(i)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)},t.handleInfixNodes=function(e){for(var t,r=-1,a=0;a<e.length;a++)if("infix"===e[a].type){if(-1!==r)throw new n("only one infix operator per group",e[a].token);r=a,t=e[a].replaceWith}if(-1!==r&&t){var i,o,s=e.slice(0,r),l=e.slice(r+1);return i=1===s.length&&"ordgroup"===s[0].type?s[0]:{type:"ordgroup",mode:this.mode,body:s},o=1===l.length&&"ordgroup"===l[0].type?l[0]:{type:"ordgroup",mode:this.mode,body:l},["\\\\abovefrac"===t?this.callFunction(t,[i,e[r],o],[]):this.callFunction(t,[i,o],[])]}return e},t.handleSupSubscript=function(e){var t=this.fetch(),r=t.text;this.consume(),this.consumeSpaces();var a=this.parseGroup(e);if(!a)throw new n("Expected group after '"+r+"'",t);return a},t.formatUnsupportedCmd=function(e){for(var t=[],r=0;r<e.length;r++)t.push({type:"textord",mode:"text",text:e[r]});var n={type:"text",mode:this.mode,body:t};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[n]}},t.parseAtom=function(t){var r,a,i=this.parseGroup("atom",t);if("text"===this.mode)return i;for(;;){this.consumeSpaces();var o=this.fetch();if("\\limits"===o.text||"\\nolimits"===o.text){if(i&&"op"===i.type){var s="\\limits"===o.text;i.limits=s,i.alwaysHandleSupSub=!0}else{if(!i||"operatorname"!==i.type)throw new n("Limit controls must follow a math operator",o);i.alwaysHandleSupSub&&(i.limits="\\limits"===o.text)}this.consume()}else if("^"===o.text){if(r)throw new n("Double superscript",o);r=this.handleSupSubscript("superscript")}else if("_"===o.text){if(a)throw new n("Double subscript",o);a=this.handleSupSubscript("subscript")}else if("'"===o.text){if(r)throw new n("Double superscript",o);var l={type:"textord",mode:this.mode,text:"\\prime"},h=[l];for(this.consume();"'"===this.fetch().text;)h.push(l),this.consume();"^"===this.fetch().text&&h.push(this.handleSupSubscript("superscript")),r={type:"ordgroup",mode:this.mode,body:h}}else{if(!Xn[o.text])break;var c=Xn[o.text],m=Yn.test(o.text);for(this.consume();;){var u=this.fetch().text;if(!Xn[u])break;if(Yn.test(u)!==m)break;this.consume(),c+=Xn[u]}var p=new e(c,this.settings).parse();m?a={type:"ordgroup",mode:"math",body:p}:r={type:"ordgroup",mode:"math",body:p}}}return r||a?{type:"supsub",mode:this.mode,base:i,sup:r,sub:a}:i},t.parseFunction=function(e,t){var r=this.fetch(),a=r.text,i=qn[a];if(!i)return null;if(this.consume(),t&&"atom"!==t&&!i.allowedInArgument)throw new n("Got function '"+a+"' with no arguments"+(t?" as "+t:""),r);if("text"===this.mode&&!i.allowedInText)throw new n("Can't use function '"+a+"' in text mode",r);if("math"===this.mode&&!1===i.allowedInMath)throw new n("Can't use function '"+a+"' in math mode",r);var o=this.parseArguments(a,i),s=o.args,l=o.optArgs;return this.callFunction(a,s,l,r,e)},t.callFunction=function(e,t,r,a,i){var o={funcName:e,parser:this,token:a,breakOnTokenText:i},s=qn[e];if(s&&s.handler)return s.handler(o,t,r);throw new n("No function handler for "+e)},t.parseArguments=function(e,t){var r=t.numArgs+t.numOptionalArgs;if(0===r)return{args:[],optArgs:[]};for(var a=[],i=[],o=0;o<r;o++){var s=t.argTypes&&t.argTypes[o],l=o<t.numOptionalArgs;(t.primitive&&null==s||"sqrt"===t.type&&1===o&&null==i[0])&&(s="primitive");var h=this.parseGroupOfType("argument to '"+e+"'",s,l);if(l)i.push(h);else{if(null==h)throw new n("Null argument, please report this as a bug");a.push(h)}}return{args:a,optArgs:i}},t.parseGroupOfType=function(e,t,r){switch(t){case"color":return this.parseColorGroup(r);case"size":return this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r);case"math":case"text":return this.parseArgumentGroup(r,t);case"hbox":var a=this.parseArgumentGroup(r,"text");return null!=a?{type:"styling",mode:a.mode,body:[a],style:"text"}:null;case"raw":var i=this.parseStringGroup("raw",r);return null!=i?{type:"raw",mode:"text",string:i.text}:null;case"primitive":if(r)throw new n("A primitive argument cannot be optional");var o=this.parseGroup(e);if(null==o)throw new n("Expected group as "+e,this.fetch());return o;case"original":case null:case void 0:return this.parseArgumentGroup(r);default:throw new n("Unknown group type as "+e,this.fetch())}},t.consumeSpaces=function(){for(;" "===this.fetch().text;)this.consume()},t.parseStringGroup=function(e,t){var r=this.gullet.scanArgument(t);if(null==r)return null;for(var n,a="";"EOF"!==(n=this.fetch()).text;)a+=n.text,this.consume();return this.consume(),r.text=a,r},t.parseRegexGroup=function(e,t){for(var r,a=this.fetch(),i=a,o="";"EOF"!==(r=this.fetch()).text&&e.test(o+r.text);)o+=(i=r).text,this.consume();if(""===o)throw new n("Invalid "+t+": '"+a.text+"'",a);return a.range(i,o)},t.parseColorGroup=function(e){var t=this.parseStringGroup("color",e);if(null==t)return null;var r=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!r)throw new n("Invalid color: '"+t.text+"'",t);var a=r[0];return/^[0-9a-f]{6}$/i.test(a)&&(a="#"+a),{type:"color-token",mode:this.mode,color:a}},t.parseSizeGroup=function(e){var t,r=!1;if(this.gullet.consumeSpaces(),!(t=e||"{"===this.gullet.future().text?this.parseStringGroup("size",e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",r=!0);var a=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!a)throw new n("Invalid size: '"+t.text+"'",t);var i={number:+(a[1]+a[2]),unit:a[3]};if(!V(i))throw new n("Invalid unit: '"+i.unit+"'",t);return{type:"size",mode:this.mode,value:i,isBlank:r}},t.parseUrlGroup=function(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==t)return null;var r=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:r}},t.parseArgumentGroup=function(e,t){var r=this.gullet.scanArgument(e);if(null==r)return null;var n=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var a=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var i={type:"ordgroup",mode:this.mode,loc:r.loc,body:a};return t&&this.switchMode(n),i},t.parseGroup=function(e,t){var r,a=this.fetch(),i=a.text;if("{"===i||"\\begingroup"===i){this.consume();var o="{"===i?"}":"\\endgroup";this.gullet.beginGroup();var s=this.parseExpression(!1,o),l=this.fetch();this.expect(o),this.gullet.endGroup(),r={type:"ordgroup",mode:this.mode,loc:Fr.range(a,l),body:s,semisimple:"\\begingroup"===i||void 0}}else if(null==(r=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===i[0]&&!Gn.hasOwnProperty(i)){if(this.settings.throwOnError)throw new n("Undefined control sequence: "+i,a);r=this.formatUnsupportedCmd(i),this.consume()}return r},t.formLigatures=function(e){for(var t=e.length-1,r=0;r<t;++r){var n=e[r],a=n.text;"-"===a&&"-"===e[r+1].text&&(r+1<t&&"-"===e[r+2].text?(e.splice(r,3,{type:"textord",mode:"text",loc:Fr.range(n,e[r+2]),text:"---"}),t-=2):(e.splice(r,2,{type:"textord",mode:"text",loc:Fr.range(n,e[r+1]),text:"--"}),t-=1)),"'"!==a&&"`"!==a||e[r+1].text!==a||(e.splice(r,2,{type:"textord",mode:"text",loc:Fr.range(n,e[r+1]),text:a+a}),t-=1)}},t.parseSymbol=function(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var r=t.slice(5),a="*"===r.charAt(0);if(a&&(r=r.slice(1)),r.length<2||r.charAt(0)!==r.slice(-1))throw new n("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:r=r.slice(1,-1),star:a}}_n.hasOwnProperty(t[0])&&!ae[this.mode][t[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=_n[t[0]]+t.slice(1));var i,o=In.exec(t);if(o&&("i"===(t=t.substring(0,o.index))?t="\u0131":"j"===t&&(t="\u0237")),ae[this.mode][t]){this.settings.strict&&"math"===this.mode&&Ee.indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var s,l=ae[this.mode][t].group,h=Fr.range(e);if(te.hasOwnProperty(l)){var c=l;s={type:"atom",mode:this.mode,family:c,loc:h,text:t}}else s={type:l,mode:this.mode,loc:h,text:t};i=s}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(S(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),i={type:"textord",mode:"text",loc:Fr.range(e),text:t}}if(this.consume(),o)for(var m=0;m<o[0].length;m++){var u=o[0][m];if(!Wn[u])throw new n("Unknown accent ' "+u+"'",e);var p=Wn[u][this.mode]||Wn[u].text;if(!p)throw new n("Accent "+u+" unsupported in "+this.mode+" mode",e);i={type:"accent",mode:this.mode,loc:Fr.range(e),label:p,isStretchy:!1,isShifty:!0,base:i}}return i},e}();jn.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var $n=function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new jn(e,t);delete r.gullet.macros.current["\\df@tag"];var a=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new n("\\tag works only in display equations");a=[{type:"tag",mode:"text",body:a,tag:r.subparse([new Gr("\\df@tag")])}]}return a},Zn=function(e,t,r){t.textContent="";var n=Jn(e,r).toNode();t.appendChild(n)};"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&("undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Zn=function(){throw new n("KaTeX doesn't work in quirks mode.")});var Kn=function(e,t,r){if(r.throwOnError||!(e instanceof n))throw e;var a=Ke.makeSpan(["katex-error"],[new Z(t)]);return a.setAttribute("title",e.toString()),a.setAttribute("style","color:"+r.errorColor),a},Jn=function(e,t){var r=new m(t);try{var n=$n(e,r);return Lt(n,e,r)}catch(t){return Kn(t,e,r)}},Qn={version:"0.16.2",render:Zn,renderToString:function(e,t){return Jn(e,t).toMarkup()},ParseError:n,SETTINGS_SCHEMA:h,__parse:function(e,t){var r=new m(t);return $n(e,r)},__renderToDomTree:Jn,__renderToHTMLTree:function(e,t){var r=new m(t);try{return function(e,t,r){var n=St(e,Ot(r)),a=Ke.makeSpan(["katex"],[n]);return Et(a,r)}($n(e,r),0,r)}catch(t){return Kn(t,e,r)}},__setFontMetrics:function(e,t){T[e]=t},__defineSymbol:ie,__defineMacro:Pr,__domTree:{Span:W,Anchor:_,SymbolNode:Z,SvgNode:K,PathNode:J,LineNode:Q}};return t=t.default}()}));
\ No newline at end of file diff --git a/source/know/category/algorithms/index.md b/source/know/category/algorithms/index.md new file mode 100644 index 0000000..ed2ac6e --- /dev/null +++ b/source/know/category/algorithms/index.md @@ -0,0 +1,4 @@ +--- +title: "Algorithms" +layout: "category" +--- diff --git a/source/know/category/classical-mechanics/index.md b/source/know/category/classical-mechanics/index.md new file mode 100644 index 0000000..78c0771 --- /dev/null +++ b/source/know/category/classical-mechanics/index.md @@ -0,0 +1,4 @@ +--- +title: "Classical mechanics" +layout: "category" +--- diff --git a/source/know/category/complex-analysis/index.md b/source/know/category/complex-analysis/index.md new file mode 100644 index 0000000..7947f51 --- /dev/null +++ b/source/know/category/complex-analysis/index.md @@ -0,0 +1,4 @@ +--- +title: "Complex analysis" +layout: "category" +--- diff --git a/source/know/category/continuum-physics/index.md b/source/know/category/continuum-physics/index.md new file mode 100644 index 0000000..895d4e8 --- /dev/null +++ b/source/know/category/continuum-physics/index.md @@ -0,0 +1,4 @@ +--- +title: "Continuum physics" +layout: "category" +--- diff --git a/source/know/category/cryptography/index.md b/source/know/category/cryptography/index.md new file mode 100644 index 0000000..0078829 --- /dev/null +++ b/source/know/category/cryptography/index.md @@ -0,0 +1,4 @@ +--- +title: "Cryptography" +layout: "category" +--- diff --git a/source/know/category/electromagnetism/index.md b/source/know/category/electromagnetism/index.md new file mode 100644 index 0000000..825cb7c --- /dev/null +++ b/source/know/category/electromagnetism/index.md @@ -0,0 +1,4 @@ +--- +title: "Electromagnetism" +layout: "category" +--- diff --git a/source/know/category/fiber-optics/index.md b/source/know/category/fiber-optics/index.md new file mode 100644 index 0000000..ca48b72 --- /dev/null +++ b/source/know/category/fiber-optics/index.md @@ -0,0 +1,4 @@ +--- +title: "Fiber optics" +layout: "category" +--- diff --git a/source/know/category/fluid-dynamics/index.md b/source/know/category/fluid-dynamics/index.md new file mode 100644 index 0000000..56ed063 --- /dev/null +++ b/source/know/category/fluid-dynamics/index.md @@ -0,0 +1,4 @@ +--- +title: "Fluid dynamics" +layout: "category" +--- diff --git a/source/know/category/fluid-mechanics/index.md b/source/know/category/fluid-mechanics/index.md new file mode 100644 index 0000000..a4109d9 --- /dev/null +++ b/source/know/category/fluid-mechanics/index.md @@ -0,0 +1,4 @@ +--- +title: "Fluid mechanics" +layout: "category" +--- diff --git a/source/know/category/fluid-statics/index.md b/source/know/category/fluid-statics/index.md new file mode 100644 index 0000000..97a2055 --- /dev/null +++ b/source/know/category/fluid-statics/index.md @@ -0,0 +1,4 @@ +--- +title: "Fluid statics" +layout: "category" +--- diff --git a/source/know/category/index.md b/source/know/category/index.md new file mode 100644 index 0000000..9952eba --- /dev/null +++ b/source/know/category/index.md @@ -0,0 +1,33 @@ +--- +title: "List of categories" +date: 2021-02-22 +layout: "default" +--- + +# List of categories + +{% assign by_letter = site.pages + | where_exp: "item", "item.layout == 'category'" + | group_by_exp: "item", "item.title | truncate: 1, ''" + | sort: "name" +%} + +This is an alphabetical list of the categories in this knowledge base. + +<div style="text-align: center;"> +‐ +{% for letter in by_letter %} +<a href="#{{ letter.name }}">{{ letter.name }}</a> +‐ +{% endfor %} +</div> + +{% for letter in by_letter %} +<h2 id="{{ letter.name }}">{{ letter.name }}</h2> +<ul> + {% assign items = letter.items | sort: "title" %} + {% for item in items %} + <li><a href="{{ item.url }}">{{ item.title }}</a></li> + {% endfor %} +</ul> +{% endfor %} diff --git a/source/know/category/laser-theory/index.md b/source/know/category/laser-theory/index.md new file mode 100644 index 0000000..f56e7a1 --- /dev/null +++ b/source/know/category/laser-theory/index.md @@ -0,0 +1,4 @@ +--- +title: "Laser theory" +layout: "category" +--- diff --git a/source/know/category/mathematics/index.md b/source/know/category/mathematics/index.md new file mode 100644 index 0000000..e40678f --- /dev/null +++ b/source/know/category/mathematics/index.md @@ -0,0 +1,4 @@ +--- +title: "Mathematics" +layout: "category" +--- diff --git a/source/know/category/measure-theory/index.md b/source/know/category/measure-theory/index.md new file mode 100644 index 0000000..2b77528 --- /dev/null +++ b/source/know/category/measure-theory/index.md @@ -0,0 +1,4 @@ +--- +title: "Measure theory" +layout: "category" +--- diff --git a/source/know/category/nonlinear-optics/index.md b/source/know/category/nonlinear-optics/index.md new file mode 100644 index 0000000..edf73d4 --- /dev/null +++ b/source/know/category/nonlinear-optics/index.md @@ -0,0 +1,4 @@ +--- +title: "Nonlinear optics" +layout: "category" +--- diff --git a/source/know/category/numerical-methods/index.md b/source/know/category/numerical-methods/index.md new file mode 100644 index 0000000..7e7ee13 --- /dev/null +++ b/source/know/category/numerical-methods/index.md @@ -0,0 +1,4 @@ +--- +title: "Numerical methods" +layout: "category" +--- diff --git a/source/know/category/optics/index.md b/source/know/category/optics/index.md new file mode 100644 index 0000000..2889f03 --- /dev/null +++ b/source/know/category/optics/index.md @@ -0,0 +1,4 @@ +--- +title: "Optics" +layout: "category" +--- diff --git a/source/know/category/perturbation/index.md b/source/know/category/perturbation/index.md new file mode 100644 index 0000000..3901a32 --- /dev/null +++ b/source/know/category/perturbation/index.md @@ -0,0 +1,4 @@ +--- +title: "Perturbation" +layout: "category" +--- diff --git a/source/know/category/physics/index.md b/source/know/category/physics/index.md new file mode 100644 index 0000000..5fecc13 --- /dev/null +++ b/source/know/category/physics/index.md @@ -0,0 +1,4 @@ +--- +title: "Physics" +layout: "category" +--- diff --git a/source/know/category/plasma-physics/index.md b/source/know/category/plasma-physics/index.md new file mode 100644 index 0000000..8e23912 --- /dev/null +++ b/source/know/category/plasma-physics/index.md @@ -0,0 +1,4 @@ +--- +title: "Plasma physics" +layout: "category" +--- diff --git a/source/know/category/plasma-waves/index.md b/source/know/category/plasma-waves/index.md new file mode 100644 index 0000000..4fb7b4a --- /dev/null +++ b/source/know/category/plasma-waves/index.md @@ -0,0 +1,4 @@ +--- +title: "Plasma waves" +layout: "category" +--- diff --git a/source/know/category/quantum-information/index.md b/source/know/category/quantum-information/index.md new file mode 100644 index 0000000..4fb3a26 --- /dev/null +++ b/source/know/category/quantum-information/index.md @@ -0,0 +1,4 @@ +--- +title: "Quantum information" +layout: "category" +--- diff --git a/source/know/category/quantum-mechanics/index.md b/source/know/category/quantum-mechanics/index.md new file mode 100644 index 0000000..279062a --- /dev/null +++ b/source/know/category/quantum-mechanics/index.md @@ -0,0 +1,4 @@ +--- +title: "Quantum mechanics" +layout: "category" +--- diff --git a/source/know/category/statistics/index.md b/source/know/category/statistics/index.md new file mode 100644 index 0000000..be0f520 --- /dev/null +++ b/source/know/category/statistics/index.md @@ -0,0 +1,4 @@ +--- +title: "Statistics" +layout: "category" +--- diff --git a/source/know/category/stochastic-analysis/index.md b/source/know/category/stochastic-analysis/index.md new file mode 100644 index 0000000..99827b4 --- /dev/null +++ b/source/know/category/stochastic-analysis/index.md @@ -0,0 +1,4 @@ +--- +title: "Stochastic analysis" +layout: "category" +--- diff --git a/source/know/category/surface-tension/index.md b/source/know/category/surface-tension/index.md new file mode 100644 index 0000000..a0e8dbb --- /dev/null +++ b/source/know/category/surface-tension/index.md @@ -0,0 +1,4 @@ +--- +title: "Surface tension" +layout: "category" +--- diff --git a/source/know/category/thermodynamic-ensembles/index.md b/source/know/category/thermodynamic-ensembles/index.md new file mode 100644 index 0000000..57fb482 --- /dev/null +++ b/source/know/category/thermodynamic-ensembles/index.md @@ -0,0 +1,4 @@ +--- +title: "Thermodynamic ensembles" +layout: "category" +--- diff --git a/source/know/category/thermodynamics/index.md b/source/know/category/thermodynamics/index.md new file mode 100644 index 0000000..1f1fa11 --- /dev/null +++ b/source/know/category/thermodynamics/index.md @@ -0,0 +1,4 @@ +--- +title: "Thermodynamics" +layout: "category" +--- diff --git a/source/know/category/two-level-system/index.md b/source/know/category/two-level-system/index.md new file mode 100644 index 0000000..57d03f7 --- /dev/null +++ b/source/know/category/two-level-system/index.md @@ -0,0 +1,4 @@ +--- +title: "Two-level system" +layout: "category" +--- diff --git a/source/know/concept/alfven-waves/index.md b/source/know/concept/alfven-waves/index.md new file mode 100644 index 0000000..9c5e460 --- /dev/null +++ b/source/know/concept/alfven-waves/index.md @@ -0,0 +1,243 @@ +--- +title: "Alfvén waves" +date: 2022-01-31 +categories: +- Physics +- Plasma physics +- Plasma waves +layout: "concept" +--- + +In the [magnetohydrodynamic](/know/concept/magnetohydrodynamics/) description of a plasma, +we split the velocity $\vb{u}$, electric current $\vb{J}$, +[magnetic field](/know/concept/magnetic-field/) $\vb{B}$ +and [electric field](/know/concept/electric-field/) $\vb{E}$ like so, +into a constant uniform equilibrium (subscript $0$) +and a small unknown perturbation (subscript $1$): + +$$\begin{aligned} + \vb{u} + = \vb{u}_0 + \vb{u}_1 + \qquad + \vb{J} + = \vb{J}_0 + \vb{J}_1 + \qquad + \vb{B} + = \vb{B}_0 + \vb{B}_1 + \qquad + \vb{E} + = \vb{E}_0 + \vb{E}_1 +\end{aligned}$$ + +Inserting this decomposition into the ideal form of the generalized Ohm's law +and keeping only terms that are first-order in the perturbation, we get: + +$$\begin{aligned} + 0 + &= (\vb{E}_0 + \vb{E}_1) + (\vb{u}_0 + \vb{u}_1) \cross (\vb{B}_0 + \vb{B}_1) + \\ + &= \vb{E}_1 + \vb{u}_1 \cross \vb{B}_0 +\end{aligned}$$ + +We do this for the momentum equation too, +assuming that $\vb{J}_0 \!=\! 0$ (to be justified later). +Note that the temperature is set to zero, such that the pressure vanishes: + +$$\begin{aligned} + \rho \pdv{\vb{u}_1}{t} + = \vb{J}_1 \cross \vb{B}_0 +\end{aligned}$$ + +Where $\rho$ is the uniform equilibrium density. +We would like an equation for $\vb{J}_1$, +which is provided by the magnetohydrodynamic form of Ampère's law: + +$$\begin{aligned} + \nabla \cross \vb{B}_1 + = \mu_0 \vb{J}_1 + \qquad \implies \quad + \vb{J}_1 + = \frac{1}{\mu_0} \nabla \cross \vb{B}_1 +\end{aligned}$$ + +Substituting this into the momentum equation, +and differentiating with respect to $t$: + +$$\begin{aligned} + \rho \pdvn{2}{\vb{u}_1}{t} + = \frac{1}{\mu_0} \bigg( \Big( \nabla \cross \pdv{}{\vb{B}1}{t} \Big) \cross \vb{B}_0 \bigg) +\end{aligned}$$ + +For which we can use Faraday's law to rewrite $\ipdv{\vb{B}_1}{t}$, +incorporating Ohm's law too: + +$$\begin{aligned} + \pdv{\vb{B}_1}{t} + = - \nabla \cross \vb{E}_1 + = \nabla \cross (\vb{u}_1 \cross \vb{B}_0) +\end{aligned}$$ + +Inserting this into the momentum equation for $\vb{u}_1$ +thus yields its final form: + +$$\begin{aligned} + \rho \pdvn{2}{\vb{u}_1}{t} + = \frac{1}{\mu_0} \bigg( \Big( \nabla \cross \big( \nabla \cross (\vb{u}_1 \cross \vb{B}_0) \big) \Big) \cross \vb{B}_0 \bigg) +\end{aligned}$$ + +Suppose the magnetic field is pointing in $z$-direction, +i.e. $\vb{B}_0 = B_0 \vu{e}_z$. +Then Faraday's law justifies our earlier assumption that $\vb{J}_0 = 0$, +and the equation can be written as: + +$$\begin{aligned} + \pdvn{2}{\vb{u}_1}{t} + = v_A^2 \bigg( \Big( \nabla \cross \big( \nabla \cross (\vb{u}_1 \cross \vu{e}_z) \big) \Big) \cross \vu{e}_z \bigg) +\end{aligned}$$ + +Where we have defined the so-called **Alfvén velocity** $v_A$ to be given by: + +$$\begin{aligned} + \boxed{ + v_A + \equiv \sqrt{\frac{B_0^2}{\mu_0 \rho}} + } +\end{aligned}$$ + +Now, consider the following plane-wave ansatz for $\vb{u}_1$, +with wavevector $\vb{k}$ and frequency $\omega$: + +$$\begin{aligned} + \vb{u}_1(\vb{r}, t) + &= \vb{u}_1 \exp(i \vb{k} \cdot \vb{r} - i \omega t) +\end{aligned}$$ + +Inserting this into the above differential equation for $\vb{u}_1$ leads to: + +$$\begin{aligned} + \omega^2 \vb{u}_1 + = v_A^2 \bigg( \Big( \vb{k} \cross \big( \vb{k} \cross (\vb{u}_1 \cross \vu{e}_z) \big) \Big) \cross \vu{e}_z \bigg) +\end{aligned}$$ + +To evaluate this, we rotate our coordinate system around the $z$-axis +such that $\vb{k} = (0, k_\perp, k_\parallel)$, +i.e. the wavevector's $x$-component is zero. +Calculating the cross products: + +$$\begin{aligned} + \omega^2 \vb{u}_1 + &= v_A^2 \bigg( \Big( \begin{bmatrix} 0 \\ k_\perp \\ k_\parallel \end{bmatrix} + \cross \big( \begin{bmatrix} 0 \\ k_\perp \\ k_\parallel \end{bmatrix} + \cross ( \begin{bmatrix} u_{1x} \\ u_{1y} \\ u_{1z} \end{bmatrix} + \cross \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix} ) \big) \Big) + \cross \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix} \bigg) + \\ + &= v_A^2 \bigg( \Big( \begin{bmatrix} 0 \\ k_\perp \\ k_\parallel \end{bmatrix} + \cross \big( \begin{bmatrix} 0 \\ k_\perp \\ k_\parallel \end{bmatrix} + \cross \begin{bmatrix} u_{1y} \\ -u_{1x} \\ 0 \end{bmatrix} \big) \Big) + \cross \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix} \bigg) + \\ + &= v_A^2 \bigg( \Big( \begin{bmatrix} 0 \\ k_\perp \\ k_\parallel \end{bmatrix} + \cross \begin{bmatrix} k_\parallel u_{1x} \\ k_\parallel u_{1y} \\ -k_\perp u_{1y} \end{bmatrix} \Big) + \cross \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix} \bigg) + \\ + &= v_A^2 \bigg( \begin{bmatrix} -(k_\perp^2 \!+ k_\parallel^2) u_{1y} \\ k_\parallel^2 u_{1x} \\ -k_\perp k_\parallel u_{1x} \end{bmatrix} + \cross \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix} \bigg) + \\ + &= v_A^2 \begin{bmatrix} k_\parallel^2 u_{1x} \\ (k_\perp^2 \!+ k_\parallel^2) u_{1y} \\ 0 \end{bmatrix} +\end{aligned}$$ + +We rewrite this equation in matrix form, +using that $k_\perp^2 \!+ k_\parallel^2 = k^2 \equiv |\vb{k}|^2$: + +$$\begin{aligned} + \begin{bmatrix} + \omega^2 - v_A^2 k_\parallel^2 & 0 & 0 \\ + 0 & \omega^2 - v_A^2 k^2 & 0 \\ + 0 & 0 & \omega^2 + \end{bmatrix} + \vb{u}_1 + = 0 +\end{aligned}$$ + +This has the form of an eigenvalue problem for $\omega^2$, +meaning we must find non-trivial solutions, +where we cannot simply choose the components of $\vb{u}_1$ to satisfy the equation. +To achieve this, we demand that the matrix' determinant is zero: + +$$\begin{aligned} + \big(\omega^2 - v_A^2 k_\parallel^2\big) \: \big(\omega^2 - v_A^2 k^2\big) \: \omega^2 + = 0 +\end{aligned}$$ + +This equation has three solutions for $\omega^2$, +one for each of its three factors being zero. +The simplest case $\omega^2 = 0$ is of no interest to us, +because we are looking for waves. + +The first interesting case is $\omega^2 = v_A^2 k_\parallel^2$, +yielding the following dispersion relation: + +$$\begin{aligned} + \boxed{ + \omega + = \pm v_A k_\parallel + } +\end{aligned}$$ + +The resulting waves are called **shear Alfvén waves**. +From the eigenvalue problem, we see that in this case +$\vb{u}_1 = (u_{1x}, 0, 0)$, meaning $\vb{u}_1 \cdot \vb{k} = 0$: +these waves are **transverse**. +The phase velocity $v_p$ and group velocity $v_g$ are as follows, +where $\theta$ is the angle between $\vb{k}$ and $\vb{B}_0$: + +$$\begin{aligned} + v_p + = \frac{|\omega|}{k} + = v_A \frac{k_\parallel}{k} + = v_A \cos(\theta) + \qquad \qquad + v_g + = \pdv{|\omega|}{k} + = v_A +\end{aligned}$$ + +The other interesting case is $\omega^2 = v_A^2 k^2$, +which leads to so-called **compressional Alfvén waves**, +with the simple dispersion relation: + +$$\begin{aligned} + \boxed{ + \omega + = \pm v_A k + } +\end{aligned}$$ + +Looking at the eigenvalue problem reveals that $\vb{u}_1 = (0, u_{1y}, 0)$, +meaning $\vb{u}_1 \cdot \vb{k} = u_{1y} k_\perp$, +so these waves are not necessarily transverse, nor longitudinal (since $k_\parallel$ is free). +The phase velocity $v_p$ and group velocity $v_g$ are given by: + +$$\begin{aligned} + v_p + = \frac{|\omega|}{k} + = v_A + \qquad \qquad + v_g + = \pdv{|\omega|}{k} + = v_A +\end{aligned}$$ + +The mechanism behind both of these oscillations is magnetic tension: +the waves are "ripples" in the field lines, +which get straightened out by Faraday's law, +but the ions' inertia causes them to overshoot and form ripples again. + + + +## References +1. M. Salewski, A.H. Nielsen, + *Plasma physics: lecture notes*, + 2021, unpublished. + diff --git a/source/know/concept/archimedes-principle/index.md b/source/know/concept/archimedes-principle/index.md new file mode 100644 index 0000000..4bab87b --- /dev/null +++ b/source/know/concept/archimedes-principle/index.md @@ -0,0 +1,89 @@ +--- +title: "Archimedes' principle" +date: 2021-04-10 +categories: +- Fluid statics +- Fluid mechanics +- Physics +layout: "concept" +--- + +Many objects float when placed on a liquid, +but some float higher than others, +and some do not float at all, sinking instead. +**Archimedes' principle** balances the forces, +and predicts how much of a body is submerged, +and how much is non-submerged. + +In truth, there is no real distinction between +the submerged and non-submerged parts, +since the latter is surrounded by another fluid (air), +which has a pressure and thus affects it. +The right thing to do is treat the entire body as being +submerged in a fluid with varying properties. + +Let us consider a volume $V$ completely submerged in such a fluid. +This volume will experience a downward force due to gravity, given by: + +$$\begin{aligned} + \va{F}_g + = \int_V \va{g} \rho_\mathrm{b} \dd{V} +\end{aligned}$$ + +Where $\va{g}$ is the gravitational field, +and $\rho_\mathrm{b}$ is the density of the body. +Meanwhile, the pressure $p$ of the surrounding fluid exerts a force +on the entire surface $S$ of $V$: + +$$\begin{aligned} + \va{F}_p + = - \oint_S p \dd{\va{S}} + = - \int_V \nabla p \dd{V} +\end{aligned}$$ + +Where we have used the divergence theorem. +Assuming [hydrostatic equilibrium](/know/concept/hydrostatic-pressure/), +we replace $\nabla p$, +leading to the definition of the **buoyant force**: + +$$\begin{aligned} + \boxed{ + \va{F}_p + = - \int_V \va{g} \rho_\mathrm{f} \dd{V} + } +\end{aligned}$$ + +For the body to be at rest, we require $\va{F}_g + \va{F}_p = 0$. +Concretely, the equilibrium condition is: + +$$\begin{aligned} + \boxed{ + \int_V \va{g} (\rho_\mathrm{b} - \rho_\mathrm{f}) \dd{V} + = 0 + } +\end{aligned}$$ + +It is commonly assumed that $\va{g}$ is constant everywhere, with magnitude $\mathrm{g}$. +If we also assume that $\rho_\mathrm{f}$ is constant on the "submerged" side, +and zero on the "non-submerged" side, we find: + +$$\begin{aligned} + 0 + = \mathrm{g} (m_\mathrm{b} - m_\mathrm{f}) +\end{aligned}$$ + +In other words, the mass $m_\mathrm{b}$ of the entire body +is equal to the mass $m_\mathrm{f}$ of the fluid it displaces. +This is the best-known version of Archimedes' principle. + +Note that if $\rho_\mathrm{b} > \rho_\mathrm{f}$, +then the displaced mass $m_\mathrm{f} < m_\mathrm{b}$ +even if the entire body is submerged, +and the object will therefore continue to sink. + + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/bb84-protocol/index.md b/source/know/concept/bb84-protocol/index.md new file mode 100644 index 0000000..95ba720 --- /dev/null +++ b/source/know/concept/bb84-protocol/index.md @@ -0,0 +1,233 @@ +--- +title: "BB84 protocol" +date: 2021-03-06 +categories: +- Quantum information +- Cryptography +layout: "concept" +--- + +The **BB84** or **Bennett-Brassard 1984** protocol is +a *quantum key distribution* (QKD) protocol, +whose purpose is to securely transmit a string of random bits +over a quantum channel for later use as a one-time pad. +It is provably information-secure, thanks to the fact that +quantum channels cannot be eavesdropped without interfering with the signal. + +Alice wants to send a secret key to Bob. +Between them, they have one quantum channel and one classical channel. +Both channels may have eavesdroppers without compromising the security of the BB84 protocol, +as long as Alice and Bob authenticate all data sent over the classical channel. + +First, Alice securely generates a sequence of random (classical) bits. +Note that the BB84 protocol is only suitable for random (high-entropy) data, +because the later stages of the protocol involve revealing parts of the data +over the (insecure) classical channel. + +For each bit, Alice randomly chooses a qubit basis, +either $\{ \Ket{0}, \Ket{1} \}$ (eigenstates of the $z$-spin $\hat{\sigma}_z$) +or $\{ \Ket{-}, \Ket{+} \}$ (eigenstates of the $x$-spin $\hat{\sigma}_x$). +Using the basis she chose, she then transmits the bits to Bob over the quantum channel, +encoding them as follows: + +$$\begin{aligned} + 0 \:\:\rightarrow\:\: \Ket{0} \:\mathrm{or}\: \Ket{+} + \qquad \quad + 1 \:\:\rightarrow\:\: \Ket{1} \:\mathrm{or}\: \Ket{-} +\end{aligned}$$ + +Crucially, Bob has no idea which basis Alice used for any of the bits. +For every bit, he chooses $\hat{\sigma}_z$ or $\hat{\sigma}_x$ at random, +and makes a measurement of the qubit, yielding 0 or 1. +If he guessed the basis correctly, he gets the bit value intended by Alice, +but if he guessed incorrectly, he randomly gets 0 or 1 with a 50-50 probability: + +$$\begin{aligned} + | \Inprod{0}{+} |^2 = | \Inprod{0}{-} |^2 = | \Inprod{1}{+} |^2 = | \Inprod{1}{-} |^2 = \frac{1}{2} +\end{aligned}$$ + +After Alice has sent all her qubits, +the next step is **basis reconciliation**: +over the classical channel, Bob announces, for each bit, +which basis he chose, and Alice tells him if he was right or wrong. +Bob discards all bits where he guessed wrongly. +If their quantum channel did not have any noise or eavesdroppers, +Alice and Bob now have a perfectly correlated secret string of bits. + + +## Eavesdropper detection + +But what if there is actually an eavesdropper? +Consider a third party, Eve, who wants to intercept Alice' secret string. +The main advantage of using QKD compared to classical protocols +is that such an eavesdropper can be detected. + +Suppose that Eve is performing an *intercept-resend attack* +(not very effective, but simple), +where she listens on the quantum channel. +For each qubit received from Alice, Eve chooses +$\hat{\sigma}_z$ or $\hat{\sigma}_x$ at random and measures it. +She records her results and resends the qubits to Bob +using the basis she chose, which may or may not be what Alice intended. + +If Eve guesses Alice' basis correctly, her presence is not revealed, +and the protocol proceeds as normal. +However, if she guesses wrongly (which has a probability of 50%), +her bit value might be incorrect, and she will resend whatever she measured +to Bob encoded in the wrong basis. + +If we assume that Eve chose wrongly, +Bob might measure using Eve's basis, +which will yield a 50% error rate due to Eve's mistake. +Otherwise, Bob might measure using Alice' basis, +which will also yield a 50% error rate due to the disagreement with Eve. + +In the end, the probability is 0.5 that Eve chose correctly, +which, multiplied by the 0.5 error rate from Bob's choice, +will result in a 0.25 error rate due to Eve's presence. +To detect this, after basis reconciliation, +Bob reveals a part of his secret string as a sacrifice, +which allows Alice to estimate the error rate. +If the rate is too high, Eve is detected, and the protocol can be aborted, +although that is not mandatory. + +This was an intercept-resend attack. +There exist other attacks, but similar logic holds. +It has been proven by Shor and Preskill in 2000 +that as long as the error rate is below 11%, +the BB84 protocol is fully secure, i.e. there cannot be any eavesdroppers. + + +## Error correction + +In practice, even without Eve, quantum channels are imperfect, +and will introduce some errors in the qubits received by Bob. +Suppose that after basis reconciliation, +Alice and Bob have the strings +$\{a_1, ..., a_N\}$ and $\{b_1, ..., b_N\}$, respectively. +We define $p$ as the probability that Alice and Bob agree on the $n$th bit, +which we assume to be greater than 50%: + +$$\begin{aligned} + p = P(a_n = b_n) > \frac{1}{2} +\end{aligned}$$ + +Ideally, $p = 1$. To improve $p$, the following simple scheme can be used: +starting at $n = 1$, Alice and Bob reveal $A$ and $B$ over the classical channel, +where $\oplus$ is an XOR: + +$$\begin{aligned} + A = a_n \oplus a_{n+1} + \qquad \quad + B = b_n \oplus b_{n+1} +\end{aligned}$$ + +If $A = B$, then $a_{n+1}$ and $b_{n+1}$ are discarded to prevent +a listener on the classical channel from learning anything about the string. +If $A \neq B$, all of $a_n$, $b_n$, $a_{n+1}$ and $b_{n+1}$ are discarded, +and then Alice and Bob move on to $n = 3$, etc. + +Given that $A = B$, the probability that $a_n = b_n$, +which is what we want, is given by: + +$$\begin{aligned} + P(a_{n} = b_{n} | A = B) + &= \frac{P(a_{n} = b_{n} \land A = B)}{P(A = B)} + \\ + &= \frac{P(a_{n} = b_{n} \land a_{n+1} = b_{n+1})}{P(a_{n} = b_{n} \land a_{n+1} = b_{n+1}) + P(a_{n} \neq b_{n} \land a_{n+1} \neq b_{n+1})} + \\ + &= \frac{P(a_{n} = b_{n}) \: P(a_{n+1} = b_{n+1})}{P(a_{n} = b_{n}) \: P(a_{n+1} = b_{n+1}) + P(a_{n} \neq b_{n}) \: P(a_{n+1} \neq b_{n+1})} +\end{aligned}$$ + +We use the definition of $p$ to get the following inequality, +which can be verified by plotting: + +$$\begin{aligned} + P(a_{n} = b_{n} | A = B) + = \frac{p^2}{p^2 + (1 - p)^2} + > p +\end{aligned}$$ + +Alice and Bob can repeat this error correction scheme multiple times, +until their estimate of $p$ is satisfactory. +This involves discarding many bits, +so the length $N_\mathrm{new}$ of the string they end up with +after one iteration is given by: + +$$\begin{aligned} + N_\mathrm{new} + = \frac{1}{2} N_\mathrm{old} P(A = B) + = \frac{1}{2} N_\mathrm{old} \big( p^2 + (1 - p)^2 \big) +\end{aligned}$$ + +More efficient schemes exist, which do not consume so many bits. + + +## Privacy amplification + +Suppose that after the error correction step, $p = 1$, +so Alice and Bob fully agree on the random string. +However, in the meantime, Eve has been listening, +and has been doing a good job +building up her own string $\{e_1, ..., e_N\}$, +such that she knows more that 50% of the bits: + +$$\begin{aligned} + q = P(e_n = a_n) > \frac{1}{2} +\end{aligned}$$ + +**Privacy amplification** is an optional final step of the BB84 protocol +which aims to reduce Eve's $q$. +Alice and Bob use their existing strings to generate a new one +$\{a_1', ..., a_M'\}$: + +$$\begin{aligned} + a_1' + = a_1 \oplus a_2 = b_1 \oplus b_2 + \qquad + a_2' + = a_3 \oplus a_4 = b_3 \oplus b_4 + \qquad + \cdots +\end{aligned}$$ + +Note that this halves the string's length; +more efficient schemes exist, which consume less. + +To see why this improves Alice and Bob's privacy, +suppose that Eve is following along, +and creates a new string $\{e_1', ..., e_M'\}$ +where $e_m' = e_{2m - 1} \oplus e_{2m}$. +The probability that Eve's result agrees with +Alice and Bob's string is given by: + +$$\begin{aligned} + P(e_m' = a_m') + &= P(e_1 = a_1 \land e_2 = a_2) + P(e_1 \neq a_1 \land e_2 \neq a_2) + \\ + &= P(e_1 = a_1) \: P(e_2 = a_2) + P(e_1 \neq a_1) \: P(e_2 \neq a_2) +\end{aligned}$$ + +Recognizing $q$ 's definition, +we find the following inequality, +which can be verified by plotting: + +$$\begin{aligned} + P(e_m' = a_m') + = q^2 + (1 - q)^2 + < q +\end{aligned}$$ + +After repeating this step several times, $q$ will be close to 1/2, +which is the ideal value: for $q =$ 0.5, +Eve would only know 50% of the bits, +which is equivalent to her guessing at random. + + +## References +1. N. Brunner, + *Quantum information theory: lecture notes*, + 2019, unpublished. +2. J.B. Brask, + *Quantum information: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/bell-state/index.md b/source/know/concept/bell-state/index.md new file mode 100644 index 0000000..15b916d --- /dev/null +++ b/source/know/concept/bell-state/index.md @@ -0,0 +1,93 @@ +--- +title: "Bell state" +date: 2021-03-09 +categories: +- Quantum mechanics +- Quantum information +layout: "concept" +--- + +In quantum information, the **Bell states** are a set of four two-qubit states +which are simple and useful examples of [quantum entanglement](/know/concept/quantum-entanglement/). +They are given by: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \ket{\Phi^{\pm}} + &= \frac{1}{\sqrt{2}} \Big( \Ket{0}_A \Ket{0}_B \pm \Ket{1}_A \Ket{1}_B \Big) + \\ + \ket{\Psi^{\pm}} + &= \frac{1}{\sqrt{2}} \Big( \Ket{0}_A \Ket{1}_B \pm \Ket{1}_A \Ket{0}_B \Big) + \end{aligned} + } +\end{aligned}$$ + +Where e.g. $\Ket{0}_A \Ket{1}_B = \Ket{0}_A \otimes \Ket{1}_B$ +is the tensor product of qubit $A$ in state $\Ket{0}$ and $B$ in $\Ket{1}$. +These states form an orthonormal basis for the two-qubit +[Hilbert space](/know/concept/hilbert-space/). + +More importantly, however, +is that the Bell states are maximally entangled, +which we prove here for $\ket{\Phi^{+}}$. +Consider the following pure [density operator](/know/concept/density-operator/): + +$$\begin{aligned} + \hat{\rho} + = \ket{\Phi^{+}} \bra{\Phi^{+}} + &= \frac{1}{2} \Big( \Ket{0}_A \Ket{0}_B + \Ket{1}_A \Ket{1}_B \Big) \Big( \Bra{0}_A \Bra{0}_B + \Bra{1}_A \Bra{1}_B \Big) +\end{aligned}$$ + +The reduced density operator $\hat{\rho}_A$ of qubit $A$ is then calculated as follows: + +$$\begin{aligned} + \hat{\rho}_A + &= \Tr_B(\hat{\rho}) + = \sum_{b = 0, 1} \Bra{b}_B \Big( \ket{\Phi^{+}} \bra{\Phi^{+}} \Big) \Ket{b}_B + \\ + &= \sum_{b = 0, 1} \Big( \Ket{0}_A \Inprod{b}{0}_B + \Ket{1}_A \Inprod{b}{1}_B \Big) + \Big( \Bra{0}_A \Inprod{0}{b}_B + \Bra{1}_A \Inprod{1}{b}_B \Big) + \\ + &= \frac{1}{2} \Big( \Ket{0}_A \Bra{0}_A + \Ket{1}_A \Bra{1}_A \Big) + = \frac{1}{2} \hat{I} +\end{aligned}$$ + +This result is maximally mixed, therefore $\ket{\Phi^{+}}$ is maximally entangled. +The same holds for the other three Bell states, +and is equally true for qubit $B$. + +This means that a measurement of qubit $A$ +has a 50-50 chance to yield $\Ket{0}$ or $\Ket{1}$. +However, due to the entanglement, +measuring $A$ also has consequences for qubit $B$: + +$$\begin{aligned} + \big| \Bra{0}_A \! \Bra{0}_B \cdot \ket{\Phi^{+}} \big|^2 + &= \frac{1}{2} \Big( \Inprod{0}{0}_A \Inprod{0}{0}_B + \Inprod{0}{1}_A \Inprod{0}{1}_B \Big)^2 + = \frac{1}{2} + \\ + \big| \Bra{0}_A \! \Bra{1}_B \cdot \ket{\Phi^{+}} \big|^2 + &= \frac{1}{2} \Big( \Inprod{0}{0}_A \Inprod{1}{0}_B + \Inprod{0}{1}_A \Inprod{1}{1}_B \Big)^2 + = 0 + \\ + \big| \Bra{1}_A \! \Bra{0}_B \cdot \ket{\Phi^{+}} \big|^2 + &= \frac{1}{2} \Big( \Inprod{1}{0}_A \Inprod{0}{0}_B + \Inprod{1}{1}_A \Inprod{0}{1}_B \Big)^2 + = 0 + \\ + \big| \Bra{1}_A \! \Bra{1}_B \cdot \ket{\Phi^{+}} \big|^2 + &= \frac{1}{2} \Big( \Inprod{1}{0}_A \Inprod{1}{0}_B + \Inprod{1}{1}_A \Inprod{1}{1}_B \Big)^2 + = \frac{1}{2} +\end{aligned}$$ + +As an example, if $A$ collapses into $\Ket{0}$ due to a measurement, +then $B$ instantly also collapses into $\Ket{0}$, never $\Ket{1}$, +even if it was not measured. +This was a specific example for $\ket{\Phi^{+}}$, +but analogous results can be found for the other Bell states. + + +## References +1. J.B. Brask, + *Quantum information: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/bells-theorem/index.md b/source/know/concept/bells-theorem/index.md new file mode 100644 index 0000000..1752854 --- /dev/null +++ b/source/know/concept/bells-theorem/index.md @@ -0,0 +1,372 @@ +--- +title: "Bell's theorem" +date: 2021-03-28 +categories: +- Physics +- Quantum mechanics +- Quantum information +layout: "concept" +--- + +**Bell's theorem** states that the laws of quantum mechanics +cannot be explained by theories built on +so-called **local hidden variables** (LHVs). + +Suppose that we have two spin-1/2 particles, called $A$ and $B$, +in an entangled [Bell state](/know/concept/bell-state/): + +$$\begin{aligned} + \Ket{\Psi^{-}} + = \frac{1}{\sqrt{2}} \Big( \Ket{\uparrow \downarrow} - \Ket{\downarrow \uparrow} \Big) +\end{aligned}$$ + +Since they are entangled, +if we measure the $z$-spin of particle $A$, and find e.g. $\Ket{\uparrow}$, +then particle $B$ immediately takes the opposite state $\Ket{\downarrow}$. +The point is that this collapse is instant, +regardless of the distance between $A$ and $B$. + +Einstein called this effect "action-at-a-distance", +and used it as evidence that quantum mechanics is an incomplete theory. +He said that there must be some **hidden variable** $\lambda$ +that determines the outcome of measurements of $A$ and $B$ +from the moment the entangled pair is created. +However, according to Bell's theorem, he was wrong. + +To prove this, let us assume that Einstein was right, and some $\lambda$, +which we cannot understand, let alone calculate or measure, controls the results. +We want to know the spins of the entangled pair +along arbitrary directions $\vec{a}$ and $\vec{b}$, +so the outcomes for particles $A$ and $B$ are: + +$$\begin{aligned} + A(\vec{a}, \lambda) = \pm 1 + \qquad \quad + B(\vec{b}, \lambda) = \pm 1 +\end{aligned}$$ + +Where $\pm 1$ are the eigenvalues of the Pauli matrices +in the chosen directions $\vec{a}$ and $\vec{b}$: + +$$\begin{aligned} + \hat{\sigma}_a + &= \vec{a} \cdot \vec{\sigma} + = a_x \hat{\sigma}_x + a_y \hat{\sigma}_y + a_z \hat{\sigma}_z + \\ + \hat{\sigma}_b + &= \vec{b} \cdot \vec{\sigma} + = b_x \hat{\sigma}_x + b_y \hat{\sigma}_y + b_z \hat{\sigma}_z +\end{aligned}$$ + +Whether $\lambda$ is a scalar or a vector does not matter; +we simply demand that it follows an unknown probability distribution $\rho(\lambda)$: + +$$\begin{aligned} + \int \rho(\lambda) \dd{\lambda} = 1 + \qquad \quad + \rho(\lambda) \ge 0 +\end{aligned}$$ + +The product of the outcomes of $A$ and $B$ then has the following expectation value. +Note that we only multiply $A$ and $B$ for shared $\lambda$-values: +this is what makes it a **local** hidden variable: + +$$\begin{aligned} + \Expval{A_a B_b} + = \int \rho(\lambda) \: A(\vec{a}, \lambda) \: B(\vec{b}, \lambda) \dd{\lambda} +\end{aligned}$$ + +From this, two inequalities can be derived, +which both prove Bell's theorem. + + +## Bell inequality + +If $\vec{a} = \vec{b}$, then we know that $A$ and $B$ always have opposite spins: + +$$\begin{aligned} + A(\vec{a}, \lambda) + = A(\vec{b}, \lambda) + = - B(\vec{b}, \lambda) +\end{aligned}$$ + +The expectation value of the product can therefore be rewritten as follows: + +$$\begin{aligned} + \Expval{A_a B_b} + = - \int \rho(\lambda) \: A(\vec{a}, \lambda) \: A(\vec{b}, \lambda) \dd{\lambda} +\end{aligned}$$ + +Next, we introduce an arbitrary third direction $\vec{c}$, +and use the fact that $( A(\vec{b}, \lambda) )^2 = 1$: + +$$\begin{aligned} + \Expval{A_a B_b} - \Expval{A_a B_c} + &= - \int \rho(\lambda) \Big( A(\vec{a}, \lambda) \: A(\vec{b}, \lambda) - A(\vec{a}, \lambda) \: A(\vec{c}, \lambda) \Big) \dd{\lambda} + \\ + &= - \int \rho(\lambda) \Big( 1 - A(\vec{b}, \lambda) \: A(\vec{c}, \lambda) \Big) A(\vec{a}, \lambda) \: A(\vec{b}, \lambda) \dd{\lambda} +\end{aligned}$$ + +Inside the integral, the only factors that can be negative +are the last two, and their product is $\pm 1$. +Taking the absolute value of the whole left, +and of the integrand on the right, we thus get: + +$$\begin{aligned} + \Big| \Expval{A_a B_b} - \Expval{A_a B_c} \Big| + &\le \int \rho(\lambda) \Big( 1 - A(\vec{b}, \lambda) \: A(\vec{c}, \lambda) \Big) + \: \Big| A(\vec{a}, \lambda) \: A(\vec{b}, \lambda) \Big| \dd{\lambda} + \\ + &\le \int \rho(\lambda) \dd{\lambda} - \int \rho(\lambda) A(\vec{b}, \lambda) \: A(\vec{c}, \lambda) \dd{\lambda} +\end{aligned}$$ + +Since $\rho(\lambda)$ is a normalized probability density function, +we arrive at the **Bell inequality**: + +$$\begin{aligned} + \boxed{ + \Big| \Expval{A_a B_b} - \Expval{A_a B_c} \Big| + \le 1 + \Expval{A_b B_c} + } +\end{aligned}$$ + +Any theory involving an LHV $\lambda$ must obey this inequality. +The problem, however, is that quantum mechanics dictates the expectation values +for the state $\Ket{\Psi^{-}}$: + +$$\begin{aligned} + \Expval{A_a B_b} = - \vec{a} \cdot \vec{b} +\end{aligned}$$ + +Finding directions which violate the Bell inequality is easy: +for example, if $\vec{a}$ and $\vec{b}$ are orthogonal, +and $\vec{c}$ is at a $\pi/4$ angle to both of them, +then the left becomes $0.707$ and the right $0.293$, +which clearly disagrees with the inequality, +meaning that LHVs are impossible. + + +## CHSH inequality + +The **Clauser-Horne-Shimony-Holt** or simply **CHSH inequality** +takes a slightly different approach, and is more useful in practice. + +Consider four spin directions, two for $A$ called $\vec{a}_1$ and $\vec{a}_2$, +and two for $B$ called $\vec{b}_1$ and $\vec{b}_2$. +Let us introduce the following abbreviations: + +$$\begin{aligned} + A_1 &= A(\vec{a}_1, \lambda) + \qquad \quad + A_2 = A(\vec{a}_2, \lambda) + \\ + B_1 &= B(\vec{b}_1, \lambda) + \qquad \quad + B_2 = B(\vec{b}_2, \lambda) +\end{aligned}$$ + +From the definition of the expectation value, +we know that the difference is given by: + +$$\begin{aligned} + \Expval{A_1 B_1} - \Expval{A_1 B_2} + = \int \rho(\lambda) \Big( A_1 B_1 - A_1 B_2 \Big) \dd{\lambda} +\end{aligned}$$ + +We introduce some new terms and rearrange the resulting expression: + +$$\begin{aligned} + \Expval{A_1 B_1} - \Expval{A_1 B_2} + &= \int \rho(\lambda) \Big( A_1 B_1 - A_1 B_2 \pm A_1 B_1 A_2 B_2 \mp A_1 B_1 A_2 B_2 \Big) \dd{\lambda} + \\ + &= \int \rho(\lambda) A_1 B_1 \Big( 1 \pm A_2 B_2 \Big) \dd{\lambda} + - \!\int \rho(\lambda) A_1 B_2 \Big( 1 \pm A_2 B_1 \Big) \dd{\lambda} +\end{aligned}$$ + +Taking the absolute value of both sides +and invoking the triangle inequality then yields: + +$$\begin{aligned} + \Big| \Expval{A_1 B_1} - \Expval{A_1 B_2} \Big| + &= \bigg|\! \int \rho(\lambda) A_1 B_1 \Big( 1 \pm A_2 B_2 \Big) \dd{\lambda} + - \!\int \rho(\lambda) A_1 B_2 \Big( 1 \pm A_2 B_1 \Big) \dd{\lambda} \!\bigg| + \\ + &\le \bigg|\! \int \rho(\lambda) A_1 B_1 \Big( 1 \pm A_2 B_2 \Big) \dd{\lambda} \!\bigg| + + \bigg|\! \int \rho(\lambda) A_1 B_2 \Big( 1 \pm A_2 B_1 \Big) \dd{\lambda} \!\bigg| +\end{aligned}$$ + +Using the fact that the product of $A$ and $B$ is always either $-1$ or $+1$, +we can reduce this to: + +$$\begin{aligned} + \Big| \Expval{A_1 B_1} - \Expval{A_1 B_2} \Big| + &\le \int \rho(\lambda) \Big| A_1 B_1 \Big| \Big( 1 \pm A_2 B_2 \Big) \dd{\lambda} + + \!\int \rho(\lambda) \Big| A_1 B_2 \Big| \Big( 1 \pm A_2 B_1 \Big) \dd{\lambda} + \\ + &\le \int \rho(\lambda) \Big( 1 \pm A_2 B_2 \Big) \dd{\lambda} + + \!\int \rho(\lambda) \Big( 1 \pm A_2 B_1 \Big) \dd{\lambda} +\end{aligned}$$ + +Evaluating these integrals gives us the following inequality, +which holds for both choices of $\pm$: + +$$\begin{aligned} + \Big| \Expval{A_1 B_1} - \Expval{A_1 B_2} \Big| + &\le 2 \pm \Expval{A_2 B_2} \pm \Expval{A_2 B_1} +\end{aligned}$$ + +We should choose the signs such that the right-hand side is as small as possible, that is: + +$$\begin{aligned} + \Big| \Expval{A_1 B_1} - \Expval{A_1 B_2} \Big| + &\le 2 \pm \Big( \Expval{A_2 B_2} + \Expval{A_2 B_1} \Big) + \\ + &\le 2 - \Big| \Expval{A_2 B_2} + \Expval{A_2 B_1} \Big| +\end{aligned}$$ + +Rearranging this and once again using the triangle inequality, +we get the CHSH inequality: + +$$\begin{aligned} + 2 + &\ge \Big| \Expval{A_1 B_1} - \Expval{A_1 B_2} \Big| + \Big| \Expval{A_2 B_2} + \Expval{A_2 B_1} \Big| + \\ + &\ge \Big| \Expval{A_1 B_1} - \Expval{A_1 B_2} + \Expval{A_2 B_2} + \Expval{A_2 B_1} \Big| +\end{aligned}$$ + +The quantity on the right-hand side is sometimes called the **CHSH quantity** $S$, +and measures the correlation between the spins of $A$ and $B$: + +$$\begin{aligned} + \boxed{ + S \equiv \Expval{A_2 B_1} + \Expval{A_2 B_2} + \Expval{A_1 B_1} - \Expval{A_1 B_2} + } +\end{aligned}$$ + +The CHSH inequality places an upper bound on the magnitude of $S$ +for LHV-based theories: + +$$\begin{aligned} + \boxed{ + |S| \le 2 + } +\end{aligned}$$ + + +## Tsirelson's bound + +Quantum physics can violate the CHSH inequality, but by how much? +Consider the following two-particle operator, +whose expectation value is the CHSH quantity, i.e. $S = \expval{\hat{S}}$: + +$$\begin{aligned} + \hat{S} + = \hat{A}_2 \otimes \hat{B}_1 + \hat{A}_2 \otimes \hat{B}_2 + \hat{A}_1 \otimes \hat{B}_1 - \hat{A}_1 \otimes \hat{B}_2 +\end{aligned}$$ + +Where $\otimes$ is the tensor product, +and e.g. $\hat{A}_1$ is the Pauli matrix for the $\vec{a}_1$-direction. +The square of this operator is then given by: + +$$\begin{aligned} + \hat{S}^2 + = \quad &\hat{A}_2^2 \otimes \hat{B}_1^2 + \hat{A}_2^2 \otimes \hat{B}_1 \hat{B}_2 + + \hat{A}_2 \hat{A}_1 \otimes \hat{B}_1^2 - \hat{A}_2 \hat{A}_1 \otimes \hat{B}_1 \hat{B}_2 + \\ + + &\hat{A}_2^2 \otimes \hat{B}_2 \hat{B}_1 + \hat{A}_2^2 \otimes \hat{B}_2^2 + + \hat{A}_2 \hat{A}_1 \otimes \hat{B}_2 \hat{B}_1 - \hat{A}_2 \hat{A}_1 \otimes \hat{B}_2^2 + \\ + + &\hat{A}_1 \hat{A}_2 \otimes \hat{B}_1^2 + \hat{A}_1 \hat{A}_2 \otimes \hat{B}_1 \hat{B}_2 + + \hat{A}_1^2 \otimes \hat{B}_1^2 - \hat{A}_1^2 \otimes \hat{B}_1 \hat{B}_2 + \\ + - &\hat{A}_1 \hat{A}_2 \otimes \hat{B}_2 \hat{B}_1 - \hat{A}_1 \hat{A}_2 \otimes \hat{B}_2^2 + - \hat{A}_1^2 \otimes \hat{B}_2 \hat{B}_1 + \hat{A}_1^2 \otimes \hat{B}_2^2 + \\ + = \quad &\hat{A}_2^2 \otimes \hat{B}_1^2 + \hat{A}_2^2 \otimes \hat{B}_2^2 + \hat{A}_1^2 \otimes \hat{B}_1^2 + \hat{A}_1^2 \otimes \hat{B}_2^2 + \\ + + &\hat{A}_2^2 \otimes \acomm{\hat{B}_1}{\hat{B}_2} - \hat{A}_1^2 \otimes \acomm{\hat{B}_1}{\hat{B}_2} + + \acomm{\hat{A}_1}{\hat{A}_2} \otimes \hat{B}_1^2 - \acomm{\hat{A}_1}{\hat{A}_2} \otimes \hat{B}_2^2 + \\ + + &\hat{A}_1 \hat{A}_2 \otimes \comm{\hat{B}_1}{\hat{B}_2} - \hat{A}_2 \hat{A}_1 \otimes \comm{\hat{B}_1}{\hat{B}_2} +\end{aligned}$$ + +Spin operators are unitary, so their square is the identity, +e.g. $\hat{A}_1^2 = \hat{I}$. Therefore $\hat{S}^2$ reduces to: + +$$\begin{aligned} + \hat{S}^2 + &= 4 \: (\hat{I} \otimes \hat{I}) + \comm{\hat{A}_1}{\hat{A}_2} \otimes \comm{\hat{B}_1}{\hat{B}_2} +\end{aligned}$$ + +The *norm* $\norm{\hat{S}^2}$ of this operator +is the largest possible expectation value $\expval{\hat{S}^2}$, +which is the same as its largest eigenvalue. +It is given by: + +$$\begin{aligned} + \Norm{\hat{S}^2} + &= 4 + \Norm{\comm{\hat{A}_1}{\hat{A}_2} \otimes \comm{\hat{B}_1}{\hat{B}_2}} + \\ + &\le 4 + \Norm{\comm{\hat{A}_1}{\hat{A}_2}} \Norm{\comm{\hat{B}_1}{\hat{B}_2}} +\end{aligned}$$ + +We find a bound for the norm of the commutators by using the triangle inequality, such that: + +$$\begin{aligned} + \Norm{\comm{\hat{A}_1}{\hat{A}_2}} + = \Norm{\hat{A}_1 \hat{A}_2 - \hat{A}_2 \hat{A}_1} + \le \Norm{\hat{A}_1 \hat{A}_2} + \Norm{\hat{A}_2 \hat{A}_1} + \le 2 \Norm{\hat{A}_1 \hat{A}_2} + \le 2 +\end{aligned}$$ + +And $\norm{\comm{\hat{B}_1}{\hat{B}_2}} \le 2$ for the same reason. +The norm is the largest eigenvalue, therefore: + +$$\begin{aligned} + \Norm{\hat{S}^2} + \le 4 + 2 \cdot 2 + = 8 + \quad \implies \quad + \Norm{\hat{S}} + \le \sqrt{8} + = 2 \sqrt{2} +\end{aligned}$$ + +We thus arrive at **Tsirelson's bound**, +which states that quantum mechanics can violate +the CHSH inequality by a factor of $\sqrt{2}$: + +$$\begin{aligned} + \boxed{ + |S| + \le 2 \sqrt{2} + } +\end{aligned}$$ + +Importantly, this is a *tight* bound, +meaning that there exist certain spin measurement directions +for which Tsirelson's bound becomes an equality, for example: + +$$\begin{aligned} + \hat{A}_1 = \hat{\sigma}_z + \qquad + \hat{A}_2 = \hat{\sigma}_x + \qquad + \hat{B}_1 = \frac{\hat{\sigma}_z + \hat{\sigma}_x}{\sqrt{2}} + \qquad + \hat{B}_2 = \frac{\hat{\sigma}_z - \hat{\sigma}_x}{\sqrt{2}} +\end{aligned}$$ + +Using the fact that $\Expval{A_a B_b} = - \vec{a} \cdot \vec{b}$, +it can then be shown that $S = 2 \sqrt{2}$ in this case. + + + +## References +1. D.J. Griffiths, D.F. Schroeter, + *Introduction to quantum mechanics*, 3rd edition, + Cambridge. +2. J.B. Brask, + *Quantum information: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/beltrami-identity/index.md b/source/know/concept/beltrami-identity/index.md new file mode 100644 index 0000000..e9d7a4c --- /dev/null +++ b/source/know/concept/beltrami-identity/index.md @@ -0,0 +1,134 @@ +--- +title: "Beltrami identity" +date: 2022-09-17 +categories: +- Physics +- Mathematics +layout: "concept" +--- + +Consider a general functional $J[f]$ of the following form, +with $f(x)$ an unknown function: + +$$\begin{aligned} + J[f] + = \int_{x_0}^{x_1} L(f, f', x) \dd{x} +\end{aligned}$$ + +Where $L$ is the Lagrangian. +To find the $f$ that maximizes or minimizes $J[f]$, +the [calculus of variations](/know/concept/calculus-of-variations/) +states that the Euler-Lagrange equation must be solved for $f$: + +$$\begin{aligned} + 0 + = \pdv{L}{f} - \dv{}{x} \Big( \pdv{L}{f'} \Big) +\end{aligned}$$ + +We now want to know exactly how $L$ depends on the free variable $x$, +since it is a function of $x$, $f(x)$ and $f'(x)$. +Using the chain rule: + +$$\begin{aligned} + \dv{L}{x} + = \pdv{L}{f} \dv{f}{x} + \pdv{L}{f'} \dv{f'}{x} + \pdv{L}{x} +\end{aligned}$$ + +Substituting the Euler-Lagrange equation into the first term gives us: + +$$\begin{aligned} + \dv{L}{x} + &= f' \dv{}{x} \Big( \pdv{L}{f'} \Big) + \dv{f'}{x} \pdv{L}{f'} + \pdv{L}{x} + \\ + &= \dv{}{x} \bigg( f' \pdv{L}{f'} \bigg) + \pdv{L}{x} +\end{aligned}$$ + +Although we started from the "hard" derivative $\idv{L}{x}$, +we arrive at an expression for the "soft" derivative $\ipdv{L}{x}$, +describing the *explicit* dependence of $L$ on $x$: + +$$\begin{aligned} + - \pdv{L}{x} + = \dv{}{x} \bigg( f' \pdv{L}{f'} - L \bigg) +\end{aligned}$$ + +What if $L$ does not explicitly depend on $x$, i.e. $\ipdv{L}{x} = 0$? +In that case, the equation can be integrated to give the **Beltrami identity**: + +$$\begin{aligned} + \boxed{ + f' \pdv{L}{f'} - L + = C + } +\end{aligned}$$ + +Where $C$ is a constant. +This says that the left-hand side is a conserved quantity in $x$, +which could be useful to know. +If we insert a concrete expression for $L$, +the Beltrami identity might be easier to solve for $f$ than the full Euler-Lagrange equation. +The assumption $\ipdv{L}{x} = 0$ is justified; +for example, if $x$ is time, it means that the potential is time-independent. + + +## Higher dimensions + +Above, a 1D problem was considered, i.e. $f$ depended only on a single variable $x$. +Consider now a 2D problem, such that $J[f]$ is given by: + +$$\begin{aligned} + J[f] = \iint_{(x_0, y_0)}^{(x_1, y_1)} L(f, f_x, f_y, x, y) \dd{x} \dd{y} +\end{aligned}$$ + +In which case the Euler-Lagrange equation takes the following form: + +$$\begin{aligned} + 0 = \pdv{L}{f} - \dv{}{x} \Big( \pdv{L}{f_x} \Big) - \dv{}{y} \Big( \pdv{L}{f_y} \Big) +\end{aligned}$$ + +Once again, we calculate the hard $x$-derivative of $L$ (the $y$-derivative is analogous): + +$$\begin{aligned} + \dv{L}{x} + &= \pdv{L}{f} \dv{f}{x} + \pdv{L}{f_x} \dv{f_x}{x} + \pdv{L}{f_y} \dv{f_y}{x} + \pdv{L}{x} + \\ + &= \dv{f}{x} \bigg( \dv{}{x} \Big( \pdv{L}{f_x} \Big) + \dv{}{y} \Big( \pdv{L}{f_y} \Big) \bigg) + + \pdv{L}{f_x} \dv{f_x}{x} + \pdv{L}{f_y} \dv{f_y}{x} + \pdv{L}{x} + \\ + &= \dv{}{x} \Big( f_x \pdv{L}{f_x} \Big) + \dv{}{y} \Big( f_x \pdv{L}{f_y} \Big) + \pdv{L}{x} +\end{aligned}$$ + +This time, we arrive at the following expression for the soft derivative $\ipdv{L}{x}$: + +$$\begin{aligned} + - \pdv{L}{x} + &= \dv{}{x} \Big( f_x \pdv{L}{f_x} - L \Big) + \dv{}{y} \Big( f_x \pdv{L}{f_y} \Big) +\end{aligned}$$ + +Due to the derivatives, this cannot be cleanly turned into an analogue of the 1D Beltrami identity, +and therefore we use that name only in the 1D case. + +However, if $\ipdv{L}{x} = 0$, this equation is still useful. +For an off-topic demonstration of this fact, +let us choose $x$ as the transverse coordinate, and integrate over it to get: + +$$\begin{aligned} + 0 + &= - \int_{x_0}^{x_1} \pdv{L}{x} \dd{x} + \\ + &= \int_{x_0}^{x_1} \dv{}{x} \Big( f_x \pdv{L}{f_x} - L \Big) + \dv{}{y} \Big( f_x \pdv{L}{f_y} \Big) \dd{x} + \\ + &= \Big[ f_x \pdv{L}{f_x} - L \Big]_{x_0}^{x_1} + \dv{}{y} \int_{x_0}^{x_1} \Big( f_x \pdv{L}{f_y} \Big) \dd{x} +\end{aligned}$$ + +If our boundary conditions cause the boundary term to vanish (as is often the case), +then the integral on the right is a conserved quantity with respect to $y$. +While not as elegant as the 1D Beltrami identity, +the above 2D counterpart still fulfills the same role. + + + +## References +1. O. Bang, + *Nonlinear mathematical physics: lecture notes*, 2020, + unpublished. diff --git a/source/know/concept/bernoullis-theorem/index.md b/source/know/concept/bernoullis-theorem/index.md new file mode 100644 index 0000000..c7f7483 --- /dev/null +++ b/source/know/concept/bernoullis-theorem/index.md @@ -0,0 +1,85 @@ +--- +title: "Bernoulli's theorem" +date: 2021-04-02 +categories: +- Physics +- Fluid mechanics +- Fluid dynamics +layout: "concept" +--- + +For inviscid fluids, **Bernuilli's theorem** states +that an increase in flow velocity $\va{v}$ is paired +with a decrease in pressure $p$ and/or potential energy. +For a qualitative argument, look no further than +one of the [Euler equations](/know/concept/euler-equations/), +with a [material derivative](/know/concept/material-derivative/): + +$$\begin{aligned} + \frac{\mathrm{D} \va{v}}{\mathrm{D} t} + = \pdv{\va{v}}{t} + (\va{v} \cdot \nabla) \va{v} + = \va{g} - \frac{\nabla p}{\rho} +\end{aligned}$$ + +Assuming that $\va{v}$ is constant in $t$, +it becomes clear that a higher $\va{v}$ requires a lower $p$. + + +## Simple form + +For an incompressible fluid +with a time-independent velocity field $\va{v}$ (i.e. **steady flow**), +Bernoulli's theorem formally states that the +**Bernoulli head** $H$ is constant along a streamline: + +$$\begin{aligned} + \boxed{ + H + = \frac{1}{2} \va{v}^2 + \Phi + \frac{p}{\rho} + } +\end{aligned}$$ + +Where $\Phi$ is the gravitational potential, such that $\va{g} = - \nabla \Phi$. +To prove this theorem, we take the material derivative of $H$: + +$$\begin{aligned} + \frac{\mathrm{D} H}{\mathrm{D} t} + &= \va{v} \cdot \frac{\mathrm{D} \va{v}}{\mathrm{D} t} + + \frac{\mathrm{D} \Phi}{\mathrm{D} t} + + \frac{1}{\rho} \frac{\mathrm{D} p}{\mathrm{D} t} +\end{aligned}$$ + +In the first term we insert the Euler equation, +and in the other two we expand the derivatives: + +$$\begin{aligned} + \frac{\mathrm{D} H}{\mathrm{D} t} + &= \va{v} \cdot \Big( \va{g} - \frac{\nabla p}{\rho} \Big) + + \Big( \pdv{\Phi}{t} + (\va{v} \cdot \nabla) \Phi \Big) + + \frac{1}{\rho} \Big( \pdv{p}{t} + (\va{v} \cdot \nabla) p \Big) + \\ + &= \pdv{\Phi}{t} + \frac{1}{\rho} \pdv{p}{t} + + \va{v} \cdot \big( \va{g} + \nabla \Phi \big) + \va{v} \cdot \Big( \frac{\nabla p}{\rho} - \frac{\nabla p}{\rho} \Big) +\end{aligned}$$ + +Using the fact that $\va{g} = - \nabla \Phi$, +we are left with the following equation: + +$$\begin{aligned} + \frac{\mathrm{D} H}{\mathrm{D} t} + &= \pdv{\Phi}{t} + \frac{1}{\rho} \pdv{p}{t} +\end{aligned}$$ + +Assuming that the flow is steady, both derivatives vanish, +leading us to the conclusion that $H$ is conserved along the streamline. + +In fact, there exists **Bernoulli's stronger theorem**, +which states that $H$ is constant *everywhere* in regions with +zero [vorticity](/know/concept/vorticity/) $\va{\omega} = 0$. +For a proof, see the derivation of $\va{\omega}$'s equation of motion. + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/bernstein-vazirani-algorithm/bernstein-vazirani-circuit.png b/source/know/concept/bernstein-vazirani-algorithm/bernstein-vazirani-circuit.png Binary files differnew file mode 100644 index 0000000..83ccde2 --- /dev/null +++ b/source/know/concept/bernstein-vazirani-algorithm/bernstein-vazirani-circuit.png diff --git a/source/know/concept/bernstein-vazirani-algorithm/index.md b/source/know/concept/bernstein-vazirani-algorithm/index.md new file mode 100644 index 0000000..8720c81 --- /dev/null +++ b/source/know/concept/bernstein-vazirani-algorithm/index.md @@ -0,0 +1,101 @@ +--- +title: "Bernstein-Vazirani algorithm" +date: 2021-05-01 +categories: +- Quantum information +- Algorithms +layout: "concept" +--- + +In quantum information, +the **Bernstein-Vazirani algorithm** proves +the supremacy of quantum computers +over classical deterministic or probabilistic computers. +It is extremely similar to the +[Deutsch-Jozsa algorithm](/know/concept/deutsch-jozsa-algorithm/), +and even uses the same circuit. + +It solves a very artificial problem: +we are given a "black box" function $f(x)$ +that takes an $N$-bit $x$ and returns a single bit, +which we are promised is the lowest bit of the bitwise dot product +of $x$ with an unknown $N$-bit string $s$: + +$$\begin{aligned} + f(x) + = s \cdot x \:\:(\bmod \: 2) + = (s_1 x_1 + s_2 x_2 + \:...\: + s_N x_N) \:\:(\bmod \: 2) +\end{aligned}$$ + +The goal is to find $s$. +To solve this problem, +a classical computer would need to call $f(x)$ exactly $N$ times +with $x = 2^n$ for $n \in \{ 0, ..., N \!-\! 1\}$. +However, the Bernstein-Vazirani algorithm +allows a quantum computer to do it with only a single query. +It uses the following circuit: + +<a href="bernstein-vazirani-circuit.png"> +<img src="bernstein-vazirani-circuit.png" style="width:52%"> +</a> + +Where $U_f$ is a phase oracle, +whose action is defined as follows, +where $\Ket{x} = \Ket{x_1} \cdots \Ket{x_N}$: + +$$\begin{aligned} + \Ket{x} + \quad \to \boxed{U_f} \to \quad + (-1)^{f(x)} \Ket{x} + = (-1)^{s \cdot x} \Ket{x} +\end{aligned}$$ + +That is, it introduces a phase flip based on the value of $f(x)$. +For an example implementation of such an oracle, +see the Deutsch-Jozsa algorithm: +its circuit is identical to this one, +but describes $U_f$ in a different (but equivalent) way. + +Starting from the state $\Ket{0}^{\otimes N}$, +applying the [Hadamard gate](/know/concept/quantum-gate/) $H$ +to all qubits yields: + +$$\begin{aligned} + \Ket{0}^{\otimes N} + \quad \to \boxed{H^{\otimes N}} \to \quad + \Ket{+}^{\otimes N} + = \frac{1}{\sqrt{2^N}} \sum_{x = 0}^{2^N - 1} \Ket{x} +\end{aligned}$$ + +This is an equal superposition of all candidates $\Ket{x}$, +which we feed to the oracle: + +$$\begin{aligned} + \frac{1}{\sqrt{2^N}} \sum_{x = 0}^{2^N - 1} \Ket{x} + \quad \to \boxed{U_f} \to \quad + \frac{1}{\sqrt{2^N}} \sum_{x = 0}^{2^N - 1} (-1)^{s \cdot x} \Ket{x} +\end{aligned}$$ + +Then, thanks to the definition of the Hadamard transform, +a final set of $H$-gates leads us to: + +$$\begin{aligned} + \frac{1}{\sqrt{2^N}} \sum_{x = 0}^{2^N - 1} (-1)^{s \cdot x} \Ket{x} + \quad \to \boxed{H^{\otimes N}} \to \quad + \Ket{s} + = \Ket{s_1} \cdots \Ket{s_N} +\end{aligned}$$ + +Which, upon measurement, gives us the desired binary representation of $s$. +For comparison, the Deutsch-Jozsa algorithm only cares whether $s = 0$ or $s \neq 0$, +whereas this algorithm is interested in the exact value of $s$. + + + +## References +1. J.S. Neergaard-Nielsen, + *Quantum information: lectures notes*, + 2021, unpublished. +2. S. Aaronson, + *Introduction to quantum information science: lecture notes*, + 2018, unpublished. diff --git a/source/know/concept/berry-phase/index.md b/source/know/concept/berry-phase/index.md new file mode 100644 index 0000000..b95788a --- /dev/null +++ b/source/know/concept/berry-phase/index.md @@ -0,0 +1,213 @@ +--- +title: "Berry phase" +date: 2021-11-29 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +Consider a Hamiltonian $\hat{H}$ that does not explicitly depend on time, +but does depend on a given parameter $\vb{R}$. +The Schrödinger equations then read: + +$$\begin{aligned} + i \hbar \dv{}{t}\Ket{\Psi_n(t)} + &= \hat{H}(\vb{R}) \Ket{\Psi_n(t)} + \\ + \hat{H}(\vb{R}) \Ket{\psi_n(\vb{R})} + &= E_n(\vb{R}) \Ket{\psi_n(\vb{R})} +\end{aligned}$$ + +The general full solution $\Ket{\Psi_n}$ has the following form, +where we allow $\vb{R}$ to evolve in time, +and we have abbreviated the traditional phase of the "wiggle factor" as $L_n$: + +$$\begin{aligned} + \Ket{\Psi_n(t)} + = \exp(i \gamma_n(t)) \exp(-i L_n(t) / \hbar) \: \Ket{\psi_n(\vb{R}(t))} + \qquad + L_n(t) \equiv \int_0^t E_n(\vb{R}(t')) \dd{t'} +\end{aligned}$$ + +The **geometric phase** $\gamma_n(t)$ is more interesting. +It is not included in $\Ket{\psi_n}$, +because it depends on the path $\vb{R}(t)$ +rather than only the present $\vb{R}$ and $t$. +Its dynamics can be found by inserting the above $\Ket{\Psi_n}$ +into the time-dependent Schrödinger equation: + +$$\begin{aligned} + \dv{}{t}\Ket{\Psi_n} + &= i \dv{\gamma_n}{t} \Ket{\Psi_n} - \frac{i}{\hbar} \dv{L_n}{t} \Ket{\Psi_n} + + \exp(i \gamma_n) \exp(-i L_n / \hbar) \dv{}{t}\Ket{\psi_n} + \\ + &= i \dv{\gamma_n}{t} \Ket{\Psi_n} + \frac{1}{i \hbar} E_n \Ket{\Psi_n} + + \exp(i \gamma_n) \exp(-i L_n / \hbar) \: \Ket{\nabla_\vb{R} \psi_n} \cdot \dv{\vb{R}}{t} + \\ + &= i \dv{\gamma_n}{t} \Ket{\Psi_n} + \frac{1}{i \hbar} \hat{H} \Ket{\Psi_n} + + \exp(i \gamma_n) \exp(-i L_n / \hbar) \: \Ket{\nabla_\vb{R} \psi_n} \cdot \dv{\vb{R}}{t} +\end{aligned}$$ + +Here we recognize the Schrödinger equation, so those terms cancel. +We are then left with: + +$$\begin{aligned} + - i \dv{\gamma_n}{t} \Ket{\Psi_n} + &= \exp(i \gamma_n) \exp(-i L_n / \hbar) \: \Ket{\nabla_\vb{R} \psi_n} \cdot \dv{\vb{R}}{t} +\end{aligned}$$ + +Front-multiplying by $i \Bra{\Psi_n}$ gives us +the equation of motion of the geometric phase $\gamma_n$: + +$$\begin{aligned} + \boxed{ + \dv{\gamma_n}{t} + = - \vb{A}_n(\vb{R}) \cdot \dv{\vb{R}}{t} + } +\end{aligned}$$ + +Where we have defined the so-called **Berry connection** $\vb{A}_n$ as follows: + +$$\begin{aligned} + \boxed{ + \vb{A}_n(\vb{R}) + \equiv -i \Inprod{\psi_n(\vb{R})}{\nabla_\vb{R} \psi_n(\vb{R})} + } +\end{aligned}$$ + +Importantly, note that $\vb{A}_n$ is real, +provided that $\Ket{\psi_n}$ is always normalized for all $\vb{R}$. +To prove this, we start from the fact that $\nabla_\vb{R} 1 = 0$: + +$$\begin{aligned} + 0 + &= \nabla_\vb{R} \Inprod{\psi_n}{\psi_n} + = \Inprod{\nabla_\vb{R} \psi_n}{\psi_n} + \Inprod{\psi_n}{\nabla_\vb{R} \psi_n} + \\ + &= \Inprod{\psi_n}{\nabla_\vb{R} \psi_n}^* + \Inprod{\psi_n}{\nabla_\vb{R} \psi_n} + = 2 \Real\{ - i \vb{A}_n \} + = 2 \Imag\{ \vb{A}_n \} +\end{aligned}$$ + +Consequently, $\vb{A}_n = \Imag \Inprod{\psi_n}{\nabla_\vb{R} \psi_n}$ is always real, +because $\Inprod{\psi_n}{\nabla_\vb{R} \psi_n}$ is imaginary. + +Suppose now that the parameter $\vb{R}(t)$ is changed adiabatically +(i.e. so slow that the system stays in the same eigenstate) +for $t \in [0, T]$, along a circuit $C$ with $\vb{R}(0) \!=\! \vb{R}(T)$. +Integrating the phase $\gamma_n(t)$ over this contour $C$ then yields +the **Berry phase** $\gamma_n(C)$: + +$$\begin{aligned} + \boxed{ + \gamma_n(C) + = - \oint_C \vb{A}_n(\vb{R}) \cdot \dd{\vb{R}} + } +\end{aligned}$$ + +But we have a problem: $\vb{A}_n$ is not unique! +Due to the Schrödinger equation's gauge invariance, +any function $f(\vb{R}(t))$ can be added to $\gamma_n(t)$ +without making an immediate physical difference to the state. +Consider the following general gauge transformation: + +$$\begin{aligned} + \ket{\tilde{\psi}_n(\vb{R})} + \equiv \exp(i f(\vb{R})) \: \Ket{\psi_n(\vb{R})} +\end{aligned}$$ + +To find $\vb{A}_n$ for a particular choice of $f$, +we need to evaluate the inner product +$\inprod{\tilde{\psi}_n}{\nabla_\vb{R} \tilde{\psi}_n}$: + +$$\begin{aligned} + \inprod{\tilde{\psi}_n}{\nabla_\vb{R} \tilde{\psi}_n} + &= \exp(i f) \Big( i \nabla_\vb{R} f \: \inprod{\tilde{\psi}_n}{\psi_n} + \inprod{\tilde{\psi}_n}{\nabla_\vb{R} \psi_n} \Big) + \\ + &= i \nabla_\vb{R} f \: \inprod{\psi_n}{\psi_n} + \inprod{\psi_n}{\nabla_\vb{R} \psi_n} + \\ + &= i \nabla_\vb{R} f + \inprod{\psi_n}{\nabla_\vb{R} \psi_n} +\end{aligned}$$ + +Unfortunately, $f$ does not vanish as we would have liked, +so $\vb{A}_n$ depends on our choice of $f$. + +However, the curl of a gradient is always zero, +so although $\vb{A}_n$ is not unique, +its curl $\nabla_\vb{R} \cross \vb{A}_n$ is guaranteed to be. +Conveniently, we can introduce a curl in the definition of $\gamma_n(C)$ +by applying Stokes' theorem, under the assumption +that $\vb{A}_n$ has no singularities in the area enclosed by $C$ +(fortunately, $\vb{A}_n$ can always be chosen to satisfy this): + +$$\begin{aligned} + \boxed{ + \gamma_n(C) + = - \iint_{S(C)} \vb{B}_n(\vb{R}) \cdot \dd{\vb{S}} + } +\end{aligned}$$ + +Where we defined $\vb{B}_n$ as the curl of $\vb{A}_n$. +Now $\gamma_n(C)$ is guaranteed to be unique. +Note that $\vb{B}_n$ is analogous to a magnetic field, +and $\vb{A}_n$ to a magnetic vector potential: + +$$\begin{aligned} + \vb{B}_n(\vb{R}) + \equiv \nabla_\vb{R} \cross \vb{A}_n(\vb{R}) + = \Imag\!\Big\{ \nabla_\vb{R} \cross \Inprod{\psi_n(\vb{R})}{\nabla_\vb{R} \psi_n(\vb{R})} \Big\} +\end{aligned}$$ + +Unfortunately, $\nabla_\vb{R} \psi_n$ is difficult to evaluate explicitly, +so we would like to rewrite $\vb{B}_n$ such that it does not enter. +We do this as follows, inserting $1 = \sum_{m} \Ket{\psi_m} \Bra{\psi_m}$ along the way: + +$$\begin{aligned} + i \vb{B}_n + = \nabla_\vb{R} \cross \Inprod{\psi_n}{\nabla_\vb{R} \psi_n} + &= \Inprod{\psi_n}{\nabla_\vb{R} \cross \nabla_\vb{R} \psi_n} + \Bra{\nabla_\vb{R} \psi_n} \cross \Ket{\nabla_\vb{R} \psi_n} + \\ + &= \sum_{m} \Inprod{\nabla_\vb{R} \psi_n}{\psi_m} \cross \Inprod{\psi_m}{\nabla_\vb{R} \psi_n} +\end{aligned}$$ + +The fact that $\Inprod{\psi_n}{\nabla_\vb{R} \psi_n}$ is imaginary +means it is parallel to its complex conjugate, +and thus the cross product vanishes, so we exclude $n$ from the sum: + +$$\begin{aligned} + \vb{B}_n + &= \sum_{m \neq n} \Inprod{\nabla_\vb{R} \psi_n}{\psi_m} \cross \Inprod{\psi_m}{\nabla_\vb{R} \psi_n} +\end{aligned}$$ + +From the [Hellmann-Feynman theorem](/know/concept/hellmann-feynman-theorem/), +we know that the inner products can be rewritten: + +$$\begin{aligned} + \Inprod{\psi_m}{\nabla_\vb{R} \psi_n} + = \frac{\matrixel{\psi_n}{\nabla_\vb{R} \hat{H}}{\psi_m}}{E_n - E_m} +\end{aligned}$$ + +Where we have assumed that there is no degeneracy. +This leads to the following result: + +$$\begin{aligned} + \boxed{ + \vb{B}_n + = \Imag \sum_{m \neq n} + \frac{\matrixel{\psi_n}{\nabla_\vb{R} \hat{H}}{\psi_m} \cross \matrixel{\psi_m}{\nabla_\vb{R} \hat{H}}{\psi_n}}{(E_n - E_m)^2} + } +\end{aligned}$$ + +Which only involves $\nabla_\vb{R} \hat{H}$, +and is therefore easier to evaluate than any $\Ket{\nabla_\vb{R} \psi_n}$. + + + +## References +1. M.V. Berry, + [Quantal phase factors accompanying adiabatic changes](https://doi.org/10.1098/rspa.1984.0023), + 1984, Royal Society. +2. G. Grosso, G.P. Parravicini, + *Solid state physics*, + 2nd edition, Elsevier. diff --git a/source/know/concept/binomial-distribution/index.md b/source/know/concept/binomial-distribution/index.md new file mode 100644 index 0000000..c25da3d --- /dev/null +++ b/source/know/concept/binomial-distribution/index.md @@ -0,0 +1,220 @@ +--- +title: "Binomial distribution" +date: 2021-02-26 +categories: +- Statistics +- Mathematics +layout: "concept" +--- + +The **binomial distribution** is a discrete probability distribution +describing a **Bernoulli process**: a set of independent $N$ trials where +each has only two possible outcomes, "success" and "failure", +the former with probability $p$ and the latter with $q = 1 - p$. +The binomial distribution then gives the probability +that $n$ out of the $N$ trials succeed: + +$$\begin{aligned} + \boxed{ + P_N(n) = \binom{N}{n} \: p^n q^{N - n} + } +\end{aligned}$$ + +The first factor is known as the **binomial coefficient**, which describes the +number of microstates (i.e. permutations) that have $n$ successes out of $N$ trials. +These happen to be the coefficients in the polynomial $(a + b)^N$, +and can be read off of Pascal's triangle. +It is defined as follows: + +$$\begin{aligned} + \boxed{ + \binom{N}{n} = \frac{N!}{n! (N - n)!} + } +\end{aligned}$$ + +The remaining factor $p^n (1 - p)^{N - n}$ is then just the +probability of attaining each microstate. + +The expected or mean number of successes $\mu$ after $N$ trials is as follows: + +$$\begin{aligned} + \boxed{ + \mu = N p + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-mean"/> +<label for="proof-mean">Proof</label> +<div class="hidden"> +<label for="proof-mean">Proof.</label> +The trick is to treat $p$ and $q$ as independent until the last moment: + +$$\begin{aligned} + \mu + &= \sum_{n = 0}^N n \binom{N}{n} p^n q^{N - n} + = \sum_{n = 0}^N \binom{N}{n} \Big( p \pdv{(p^n)}{p} \Big) q^{N - n} + \\ + &= p \pdv{}{p}\sum_{n = 0}^N \binom{N}{n} p^n q^{N - n} + = p \pdv{}{p}(p + q)^N + = N p (p + q)^{N - 1} +\end{aligned}$$ + +Inserting $q = 1 - p$ then gives the desired result. +</div> +</div> + +Meanwhile, we find the following variance $\sigma^2$, +with $\sigma$ being the standard deviation: + +$$\begin{aligned} + \boxed{ + \sigma^2 = N p q + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-var"/> +<label for="proof-var">Proof</label> +<div class="hidden"> +<label for="proof-var">Proof.</label> +We use the same trick to calculate $\overline{n^2}$ +(the mean squared number of successes): + +$$\begin{aligned} + \overline{n^2} + &= \sum_{n = 0}^N n^2 \binom{N}{n} p^n q^{N - n} + = \sum_{n = 0}^N n \binom{N}{n} \Big( p \pdv{}{p}\Big)^2 p^n q^{N - n} + \\ + &= \Big( p \pdv{}{p}\Big)^2 \sum_{n = 0}^N \binom{N}{n} p^n q^{N - n} + = \Big( p \pdv{}{p}\Big)^2 (p + q)^N + \\ + &= N p \pdv{}{p}p (p + q)^{N - 1} + = N p \big( (p + q)^{N - 1} + (N - 1) p (p + q)^{N - 2} \big) + \\ + &= N p + N^2 p^2 - N p^2 +\end{aligned}$$ + +Using this and the earlier expression $\mu = N p$, we find the variance $\sigma^2$: + +$$\begin{aligned} + \sigma^2 + &= \overline{n^2} - \mu^2 + = N p + N^2 p^2 - N p^2 - N^2 p^2 + = N p (1 - p) +\end{aligned}$$ + +By inserting $q = 1 - p$, we arrive at the desired expression. +</div> +</div> + +As $N \to \infty$, the binomial distribution +turns into the continuous normal distribution, +a fact that is sometimes called the **de Moivre-Laplace theorem**: + +$$\begin{aligned} + \boxed{ + \lim_{N \to \infty} P_N(n) = \frac{1}{\sqrt{2 \pi \sigma^2}} \exp\!\Big(\!-\!\frac{(n - \mu)^2}{2 \sigma^2} \Big) + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-normal"/> +<label for="proof-normal">Proof</label> +<div class="hidden"> +<label for="proof-normal">Proof.</label> +We take the Taylor expansion of $\ln\!\big(P_N(n)\big)$ +around the mean $\mu = Np$: + +$$\begin{aligned} + \ln\!\big(P_N(n)\big) + &= \sum_{m = 0}^\infty \frac{(n - \mu)^m}{m!} D_m(\mu) + \quad \mathrm{where} \quad + D_m(n) = \dvn{m}{\ln\!\big(P_N(n)\big)}{n} +\end{aligned}$$ + +We use Stirling's approximation to calculate the factorials in $D_m$: + +$$\begin{aligned} + \ln\!\big(P_N(n)\big) + &= \ln(N!) - \ln(n!) - \ln\!\big((N - n)!\big) + n \ln(p) + (N - n) \ln(q) + \\ + &\approx \ln(N!) - n \big( \ln(n)\!-\!\ln(p)\!-\!1 \big) - (N\!-\!n) \big( \ln(N\!-\!n)\!-\!\ln(q)\!-\!1 \big) +\end{aligned}$$ + +For $D_0(\mu)$, we need to use a stronger version of Stirling's approximation +to get a non-zero result. We take advantage of $N - N p = N q$: + +$$\begin{aligned} + D_0(\mu) + &= \ln(N!) - \ln\!\big((N p)!\big) - \ln\!\big((N q)!\big) + N p \ln(p) + N q \ln(q) + \\ + &= \Big( N \ln(N) - N + \frac{1}{2} \ln(2\pi N) \Big) + - \Big( N p \ln(N p) - N p + \frac{1}{2} \ln(2\pi N p) \Big) \\ + &\qquad - \Big( N q \ln(N q) - N q + \frac{1}{2} \ln(2\pi N q) \Big) + + N p \ln(p) + N q \ln(q) + \\ + &= N \ln(N) - N (p + q) \ln(N) + N (p + q) - N - \frac{1}{2} \ln(2\pi N p q) + \\ + &= - \frac{1}{2} \ln(2\pi N p q) + = \ln\!\Big( \frac{1}{\sqrt{2\pi \sigma^2}} \Big) +\end{aligned}$$ + +Next, we expect that $D_1(\mu) = 0$, because $\mu$ is the maximum. +This is indeed the case: + +$$\begin{aligned} + D_1(n) + &= - \big( \ln(n)\!-\!\ln(p)\!-\!1 \big) + \big( \ln(N\!-\!n)\!-\!\ln(q)\!-\!1 \big) - 1 + 1 + \\ + &= - \ln(n) + \ln(N - n) + \ln(p) - \ln(q) + \\ + D_1(\mu) + &= \ln(N q) - \ln(N p) + \ln(p) - \ln(q) + = \ln(N p q) - \ln(N p q) + = 0 +\end{aligned}$$ + +For the same reason, we expect that $D_2(\mu)$ is negative. +We find the following expression: + +$$\begin{aligned} + D_2(n) + &= - \frac{1}{n} - \frac{1}{N - n} + \qquad + D_2(\mu) + = - \frac{1}{Np} - \frac{1}{Nq} + = - \frac{p + q}{N p q} + = - \frac{1}{\sigma^2} +\end{aligned}$$ + +The higher-order derivatives tend to zero for $N \to \infty$, so we discard them: + +$$\begin{aligned} + D_3(n) + = \frac{1}{n^2} - \frac{1}{(N - n)^2} + \qquad + D_4(n) + = - \frac{2}{n^3} - \frac{2}{(N - n)^3} + \qquad + \cdots +\end{aligned}$$ + +Putting everything together, for large $N$, +the Taylor series approximately becomes: + +$$\begin{aligned} + \ln\!\big(P_N(n)\big) + \approx D_0(\mu) + \frac{(n - \mu)^2}{2} D_2(\mu) + = \ln\!\Big( \frac{1}{\sqrt{2\pi \sigma^2}} \Big) - \frac{(n - \mu)^2}{2 \sigma^2} +\end{aligned}$$ + +Taking $\exp$ of this expression then yields a normalized Gaussian distribution. +</div> +</div> + + +## References +1. H. Gould, J. Tobochnik, + *Statistical and thermal physics*, 2nd edition, + Princeton. diff --git a/source/know/concept/blasius-boundary-layer/index.md b/source/know/concept/blasius-boundary-layer/index.md new file mode 100644 index 0000000..86b0e02 --- /dev/null +++ b/source/know/concept/blasius-boundary-layer/index.md @@ -0,0 +1,113 @@ +--- +title: "Blasius boundary layer" +date: 2021-05-29 +categories: +- Physics +- Fluid mechanics +- Fluid dynamics +layout: "concept" +--- + +In fluid dynamics, the **Blasius boundary layer** is an application of +the [Prandtl equations](/know/concept/prandtl-equations/), +which govern the flow of a fluid +at large Reynolds number $\mathrm{Re} \gg 1$ +close to a surface. +Specifically, the Blasius layer is the solution +for a half-plane approached from the edge by a fluid. + +A fluid with velocity field $\va{v} = U \vu{e}_x$ flows to the plane, +which starts at $y = 0$ and exists for $x \ge 0$. +To describe this, we make an ansatz +for the *slip-flow* region's $x$-velocity $v_x(x, y)$: + +$$\begin{aligned} + v_x + = U f'(s) + \qquad \quad + s + \equiv \frac{y}{\delta(x)} +\end{aligned}$$ + +Note that $f'(s)$ is the derivative of an unknown $f(s)$, +and that it obeys the boundary conditions $f'(0) = 0$ and $f'(\infty) = 1$. +Furthermore, $\delta(x)$ is the thickness of the stationary boundary layer at the surface. +To derive the Prandtl equations, +the estimate $\delta(x) = \sqrt{\nu x / U}$ was used, +which we will stick with. +For later use, it is worth writing the derivatives of $s$: + +$$\begin{aligned} + \pdv{s}{x} + = - y \frac{\delta'}{\delta^2} + = - s \frac{\delta'}{\delta} + \qquad \quad + \pdv{s}{y} + = \frac{1}{\delta} +\end{aligned}$$ + +Inserting the ansatz for $v_x$ into the incompressibility condition then yields: + +$$\begin{aligned} + \pdv{v_y}{y} + = - \pdv{v_x}{x} + = U s f'' \frac{\delta'}{\delta} +\end{aligned}$$ + +Which we integrate to get an expression for the $y$-velocity $v_y$, namely: + +$$\begin{aligned} + v_y + = U \frac{\delta'}{\delta} \int s f'' \dd{y} + = U \delta' \: (s f' - f) +\end{aligned}$$ + +Now, consider the main Prandtl equation, +assuming that the attack velocity $U$ is constant: + +$$\begin{aligned} + v_x \pdv{v_x}{x} + v_y \pdv{v_x}{y} + = \nu \pdvn{2}{v_x}{y} +\end{aligned}$$ + +Inserting our expressions for $v_x$ and $v_y$ into this leads us to: + +$$\begin{aligned} + - U^2 \frac{\delta'}{\delta} s f'' f' + U^2 \frac{\delta'}{\delta} f'' (s f' - f) + = \nu U \frac{1}{\delta^2} f''' +\end{aligned}$$ + +After multiplying it by $\delta^2 / U$ and cancelling out some terms, +it reduces to: + +$$\begin{aligned} + \nu f''' + U \delta' \delta f'' f + = 0 +\end{aligned}$$ + +Then, substituting $\delta(x) = \sqrt{\nu x / U}$ and $\delta'(x) = (1/2) \sqrt{\nu / (U x)}$ yields: + +$$\begin{aligned} + \nu f''' + U \frac{\nu}{2 U} f'' f + = 0 +\end{aligned}$$ + +Simplifying this leads us to the **Blasius equation**, +which is a nonlinear ODE for $f(s)$: + +$$\begin{aligned} + \boxed{ + 2 f''' + f'' f = 0 + } +\end{aligned}$$ + +Unfortunately, this cannot be solved analytically, only numerically. +Nevertheless, the result shows a boundary layer $\delta(x)$ +exhibiting the expected downstream thickening. + + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/bloch-sphere/bloch-small.jpg b/source/know/concept/bloch-sphere/bloch-small.jpg Binary files differnew file mode 100644 index 0000000..e99c0e1 --- /dev/null +++ b/source/know/concept/bloch-sphere/bloch-small.jpg diff --git a/source/know/concept/bloch-sphere/bloch.jpg b/source/know/concept/bloch-sphere/bloch.jpg Binary files differnew file mode 100644 index 0000000..9515d84 --- /dev/null +++ b/source/know/concept/bloch-sphere/bloch.jpg diff --git a/source/know/concept/bloch-sphere/index.md b/source/know/concept/bloch-sphere/index.md new file mode 100644 index 0000000..d333c50 --- /dev/null +++ b/source/know/concept/bloch-sphere/index.md @@ -0,0 +1,133 @@ +--- +title: "Bloch sphere" +date: 2021-03-09 +categories: +- Quantum mechanics +- Quantum information +- Two-level system +layout: "concept" +--- + +In quantum mechanics, particularly quantum information, +the **Bloch sphere** is an invaluable tool to visualize qubits. +All pure qubit states are represented by a point on the sphere's surface: + +<a href="bloch.jpg"> +<img src="bloch-small.jpg" style="width:50%"> +</a> + +The $x$, $y$ and $z$-axes represent the components of a spin-1/2-alike system, +and their extremes are the eigenstates of the Pauli matrices: + +$$\begin{aligned} + \hat{\sigma}_z + \to \{\Ket{0}, \Ket{1}\} + \qquad + \hat{\sigma}_x + \to \{\Ket{+}, \Ket{-}\} + \qquad + \hat{\sigma}_y + \to \{\Ket{+i}, \Ket{-i}\} +\end{aligned}$$ + +Where the latter two states are expressed as follows in the conventional $z$-basis: + +$$\begin{aligned} + \Ket{\pm} + = \frac{\Ket{0} \pm \Ket{1}}{\sqrt{2}} + \qquad \quad + \Ket{\pm i} + = \frac{\Ket{0} \pm i \Ket{1}}{\sqrt{2}} +\end{aligned}$$ + +More generally, every point on the surface of the sphere +describes a pure qubit state in terms of the angles $\theta$ and $\varphi$, +respectively the elevation and azimuth: + +$$\begin{aligned} + \Ket{\Psi} = \cos\!\Big(\frac{\theta}{2}\Big) \Ket{0} + \exp(i \varphi) \sin\!\Big(\frac{\theta}{2}\Big) \Ket{1} +\end{aligned}$$ + +We can generalize this further by describing points using the **Bloch vector** $\vec{r}$, +with radius $r \le 1$: + +$$\begin{aligned} + \boxed{ + \vec{r} + = \begin{bmatrix} r_x \\ r_y \\ r_z \end{bmatrix} + = \begin{bmatrix} r \sin\theta \cos\varphi \\ r \sin\theta \sin\varphi \\ r \cos\theta \end{bmatrix} + } +\end{aligned}$$ + +Note that $\vec{r}$ is not actually a qubit state, +but rather an implicit description of one, +meaning that it does not need to be normalized. +The main point of the Bloch vector is that it allows us +to describe the qubit using a [density operator](/know/concept/density-operator/): + +$$\begin{aligned} + \boxed{ + \hat{\rho} + = \frac{1}{2} \Big( \hat{I} + \vec{r} \cdot \vec{\sigma} \Big) + } +\end{aligned}$$ + +Where $\vec{\sigma} = (\hat{\sigma}_x, \hat{\sigma}_y, \hat{\sigma}_z)$ is the Pauli "vector". +Now, we know that $\hat{\rho}$ represents a pure ensemble +if and only if it is idempotent, i.e. $\hat{\rho}^2 = \hat{\rho}$: + +$$\begin{aligned} + \hat{\rho}^2 + &= \frac{1}{4} \Big( \hat{I}^2 + 2 \hat{I} (\vec{r} \cdot \vec{\sigma}) + (\vec{r} \cdot \vec{\sigma})^2 \Big) + = \frac{1}{4} \Big( \hat{I} + 2 (\vec{r} \cdot \vec{\sigma}) + (\vec{r} \cdot \vec{\sigma})^2 \Big) +\end{aligned}$$ + +You can easily convince yourself that if $(\vec{r} \cdot \vec{\sigma})^2 = \hat{I}$, +then we get $\hat{\rho}$ again, and the state is pure: + +$$\begin{aligned} + (\vec{r} \cdot \vec{\sigma})^2 + &= (r_x \hat{\sigma}_x + r_y \hat{\sigma}_y + r_z \hat{\sigma}_z)^2 + \\ + &= r_x^2 \hat{\sigma}_x^2 + r_x r_y \hat{\sigma}_x \hat{\sigma}_y + r_x r_z \hat{\sigma}_x \hat{\sigma}_z + + r_x r_y \hat{\sigma}_y \hat{\sigma}_x + r_y^2 \hat{\sigma}_y^2 + \\ + &\quad + r_y r_z \hat{\sigma}_y \hat{\sigma}_z + r_x r_z \hat{\sigma}_z \hat{\sigma}_x + + r_y r_z \hat{\sigma}_z \hat{\sigma}_y + r_z^2 \hat{\sigma}_z^2 + \\ + &= r_x^2 \hat{I} + r_y^2 \hat{I} + r_z^2 \hat{I} + + r_x r_y \{ \hat{\sigma}_x, \hat{\sigma}_y \} + + r_y r_z \{ \hat{\sigma}_y, \hat{\sigma}_z \} + + r_x r_z \{ \hat{\sigma}_x, \hat{\sigma}_z \} + \\ + &= (r_x^2 + r_y^2 + r_z^2) \hat{I} + = r^2 \hat{I} +\end{aligned}$$ + +Therefore, if the radius $r = 1$, the ensemble is pure, +else if $r < 1$ it is mixed. + +Another useful property of the Bloch vector +is that the expectation value of the Pauli matrices +are given by the corresponding component of $\vec{r}$, +for example for $\hat{\sigma}_z$: + +$$\begin{aligned} + \Expval{\hat{\sigma}_z} + &= \Tr(\hat{\rho} \hat{\sigma}_z) + = \frac{1}{2} \Tr\!\big(\hat{\sigma}_z + (\vec{r} \cdot \vec{\sigma}) \hat{\sigma}_z \big) + = \frac{1}{2} \Tr\!\big( (r_x \hat{\sigma}_x + r_y \hat{\sigma}_y + r_z \hat{\sigma}_z) \hat{\sigma}_z \big) + \\ + &= \frac{1}{2} \Tr\!\big( r_x \hat{\sigma}_x \hat{\sigma}_z + r_y \hat{\sigma}_y \hat{\sigma}_z + r_z \hat{\sigma}_z^2 \big) + = \frac{1}{2} \Tr\!\big( r_z \hat{I} \big) + = r_z +\end{aligned}$$ + + +## References +1. N. Brunner, + *Quantum information theory: lecture notes*, + 2019, unpublished. +2. J.B. Brask, + *Quantum information: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/blochs-theorem/index.md b/source/know/concept/blochs-theorem/index.md new file mode 100644 index 0000000..496d8d3 --- /dev/null +++ b/source/know/concept/blochs-theorem/index.md @@ -0,0 +1,110 @@ +--- +title: "Bloch's theorem" +date: 2021-02-22 +categories: +- Quantum mechanics +layout: "concept" +--- + +In quantum mechanics, **Bloch's theorem** states that, +given a potential $V(\vb{r})$ which is periodic on a lattice, +i.e. $V(\vb{r}) = V(\vb{r} + \vb{a})$ +for a primitive lattice vector $\vb{a}$, +then it follows that the solutions $\psi(\vb{r})$ +to the time-independent Schrödinger equation +take the following form, +where the function $u(\vb{r})$ is periodic on the same lattice, +i.e. $u(\vb{r}) = u(\vb{r} + \vb{a})$: + +$$ +\begin{aligned} + \boxed{ + \psi(\vb{r}) = u(\vb{r}) e^{i \vb{k} \cdot \vb{r}} + } +\end{aligned} +$$ + +In other words, in a periodic potential, +the solutions are simply plane waves with a periodic modulation, +known as **Bloch functions** or **Bloch states**. + +This is suprisingly easy to prove: +if the Hamiltonian $\hat{H}$ is lattice-periodic, +then both $\psi(\vb{r})$ and $\psi(\vb{r} + \vb{a})$ +are eigenstates with the same energy: + +$$ +\begin{aligned} + \hat{H} \psi(\vb{r}) = E \psi(\vb{r}) + \qquad + \hat{H} \psi(\vb{r} + \vb{a}) = E \psi(\vb{r} + \vb{a}) +\end{aligned} +$$ + +Now define the unitary translation operator $\hat{T}(\vb{a})$ such that +$\psi(\vb{r} + \vb{a}) = \hat{T}(\vb{a}) \psi(\vb{r})$. +From the previous equation, we then know that: + +$$ +\begin{aligned} + \hat{H} \hat{T}(\vb{a}) \psi(\vb{r}) + = E \hat{T}(\vb{a}) \psi(\vb{r}) + = \hat{T}(\vb{a}) \big(E \psi(\vb{r})\big) + = \hat{T}(\vb{a}) \hat{H} \psi(\vb{r}) +\end{aligned} +$$ + +In other words, if $\hat{H}$ is lattice-periodic, +then it will commute with $\hat{T}(\vb{a})$, +i.e. $[\hat{H}, \hat{T}(\vb{a})] = 0$. +Consequently, $\hat{H}$ and $\hat{T}(\vb{a})$ must share eigenstates $\psi(\vb{r})$: + +$$ +\begin{aligned} + \hat{H} \:\psi(\vb{r}) = E \:\psi(\vb{r}) + \qquad \qquad + \hat{T}(\vb{a}) \:\psi(\vb{r}) = \tau \:\psi(\vb{r}) +\end{aligned} +$$ + +Since $\hat{T}$ is unitary, +its eigenvalues $\tau$ must have the form $e^{i \theta}$, with $\theta$ real. +Therefore a translation by $\vb{a}$ causes a phase shift, +for some vector $\vb{k}$: + +$$ +\begin{aligned} + \psi(\vb{r} + \vb{a}) + = \hat{T}(\vb{a}) \:\psi(\vb{r}) + = e^{i \theta} \:\psi(\vb{r}) + = e^{i \vb{k} \cdot \vb{a}} \:\psi(\vb{r}) +\end{aligned} +$$ + +Let us now define the following function, +keeping our arbitrary choice of $\vb{k}$: + +$$ +\begin{aligned} + u(\vb{r}) + = e^{- i \vb{k} \cdot \vb{r}} \:\psi(\vb{r}) +\end{aligned} +$$ + +As it turns out, this function is guaranteed to be lattice-periodic for any $\vb{k}$: + +$$ +\begin{aligned} + u(\vb{r} + \vb{a}) + &= e^{- i \vb{k} \cdot (\vb{r} + \vb{a})} \:\psi(\vb{r} + \vb{a}) + \\ + &= e^{- i \vb{k} \cdot \vb{r}} e^{- i \vb{k} \cdot \vb{a}} e^{i \vb{k} \cdot \vb{a}} \:\psi(\vb{r}) + \\ + &= e^{- i \vb{k} \cdot \vb{r}} \:\psi(\vb{r}) + \\ + &= u(\vb{r}) +\end{aligned} +$$ + +Then Bloch's theorem follows from +isolating the definition of $u(\vb{r})$ for $\psi(\vb{r})$. diff --git a/source/know/concept/boltzmann-equation/index.md b/source/know/concept/boltzmann-equation/index.md new file mode 100644 index 0000000..6193fe6 --- /dev/null +++ b/source/know/concept/boltzmann-equation/index.md @@ -0,0 +1,357 @@ +--- +title: "Boltzmann equation" +date: 2022-10-02 +categories: +- Physics +- Thermodynamics +- Fluid mechanics +layout: "concept" +--- + +Consider a collection of particles, +each with its own position $\vb{r}$ and velocity $\vb{v}$. +We can thus define a probability density function $f(\vb{r}, \vb{v}, t)$ +describing the expected number of particles at $(\vb{r}, \vb{v})$ at time $t$. +Let the total number of particles $N$ be conserved, then clearly: + +$$\begin{aligned} + N = \iint_{-\infty}^\infty f(\vb{r}, \vb{v}, t) \dd{\vb{r}} \dd{\vb{v}} +\end{aligned}$$ + +At equilibrium, all processes affecting the particles +no longer have a net effect, so $f$ is fixed: + +$$\begin{aligned} + \dv{f}{t} + = 0 +\end{aligned}$$ + +If each particle's momentum only changes due to collisions, +then a non-equilibrium state can be described as follows, very generally: + +$$\begin{aligned} + \dv{f}{t} + = \bigg(\! \pdv{f}{t} \!\bigg)_\mathrm{\!col} +\end{aligned}$$ + +Where the right-hand side simply means "all changes in $f$ due to collisions". +Applying the chain rule to the left-hand side then yields: + +$$\begin{aligned} + \bigg(\! \pdv{f}{t} \!\bigg)_\mathrm{\!col} + &= \pdv{f}{t} + \bigg( \pdv{f}{x} \dv{x}{t} \!+\! \pdv{f}{y} \dv{y}{t} \!+\! \pdv{f}{z} \dv{z}{t} \bigg) + + \bigg( \pdv{f}{v_x} \dv{v_x}{t} \!+\! \pdv{f}{v_y} \dv{v_y}{t} \!+\! \pdv{f}{v_z} \dv{v_z}{t} \bigg) + \\ + &= \pdv{f}{t} + \bigg( v_x \pdv{f}{x} \!+\! v_y \pdv{f}{y} \!+\! v_z \pdv{f}{z} \bigg) + + \bigg( a_x \pdv{f}{v_x} \!+\! a_y \pdv{f}{v_y} \!+\! a_z \pdv{f}{v_z} \bigg) + \\ + &= \pdv{f}{t} + \vb{v} \cdot \nabla f + \vb{a} \cdot \pdv{f}{\vb{v}} +\end{aligned}$$ + +Where we have introduced the shorthand $\ipdv{f}{\vb{v}}$. +Inserting Newton's second law $\vb{F} = m \vb{a}$ +leads us to the **Boltzmann equation** or +**Boltzmann transport equation** (BTE): + +$$\begin{aligned} + \boxed{ + \pdv{f}{t} + \vb{v} \cdot \nabla f + \frac{\vb{F}}{m} \cdot \pdv{f}{\vb{v}} + = \bigg(\! \pdv{f}{t} \!\bigg)_\mathrm{\!col} + } +\end{aligned}$$ + +But what about the collision term? +Expressions for it exist, which are almost exact in many cases, +but unfortunately also quite difficult to work with. +In addition, $f$ is a 7-dimensional function, +so the BTE is already hard to solve without collisions. +We only present the simplest case, +known as the **Bhatnagar-Gross-Krook approximation**: +if the equilibrium state $f_0(\vb{r}, \vb{v})$ is known, +then each collision brings the system closer to $f_0$: + +$$\begin{aligned} + \pdv{f}{t} + \vb{v} \cdot \nabla f + \frac{\vb{F}}{m} \cdot \pdv{f}{\vb{v}} + = \frac{f_0 - f}{\tau} +\end{aligned}$$ + +Where $\tau$ is the average collision period. +The right-hand side is called the **Krook term**. + + + +## Moment equations + +From the definition of $f$, +we see that integrating over all $\vb{v}$ yields the particle density $n$: + +$$\begin{aligned} + n(\vb{r}, t) = \int_{-\infty}^\infty f(\vb{r}, \vb{v}, t) \dd{\vb{v}} +\end{aligned}$$ + +Consequently, a purely velocity-dependent quantity $Q(\vb{v})$ can be averaged like so: + +$$\begin{aligned} + \Expval{Q} + = \frac{1}{n} \int_{-\infty}^\infty Q(\vb{r}, \vb{v}, t) \: f(\vb{r}, \vb{v}, t) \dd{\vb{v}} +\end{aligned}$$ + +With that in mind, we multiply the collisionless BTE equation by $Q(\vb{v})$ and integrate, +assuming that $\vb{F}$ does not depend on $\vb{v}$: + +$$\begin{aligned} + 0 + &= \int_{-\infty}^\infty Q \bigg( \pdv{f}{t} + \vb{v} \cdot \nabla f + \frac{\vb{F}}{m} \cdot \pdv{f}{\vb{v}} \bigg) \dd{\vb{v}} + \\ + &= \int Q \pdv{f}{t} \dd{\vb{v}} + \int (\vb{v} \cdot \nabla f) \: Q \dd{\vb{v}} + \frac{\vb{F}}{m} \cdot \int Q \pdv{f}{\vb{v}} \dd{\vb{v}} + \\ + &= \pdv{}{t}\int Q f \dd{\vb{v}} + \int \Big( \nabla \cdot (\vb{v} f) - f (\nabla \cdot \vb{v}) \Big) Q \dd{\vb{v}} + + \frac{\vb{F}}{m} \cdot \int \bigg( \pdv{}{\vb{v}} (Q f) - f \pdv{Q}{\vb{v}} \bigg) \dd{\vb{v}} +\end{aligned}$$ + +The first integral is simply $n \Expval{Q}$. +In the second integral, note that $\vb{v}$ is a coordinate +and hence not dependent on $\vb{r}$, so $\nabla \cdot \vb{v} = 0$. +Since $f$ is a probability density, $f \to 0$ for $\vb{v} \to \pm\infty$, +so the first term in the third integral vanishes after it is integrated: + +$$\begin{aligned} + 0 + &= \pdv{}{t}\big(n \Expval{Q}\big) + \int \nabla \cdot (\vb{v} f) \: Q \dd{\vb{v}} + + \frac{\vb{F}}{m} \cdot \bigg( \Big[ Q f \Big]_{-\infty}^\infty - \int f \pdv{Q}{\vb{v}} \dd{\vb{v}} \bigg) + \\ + &= \pdv{}{t}\big(n \Expval{Q}\big) + \nabla \cdot \int Q \vb{v} f \dd{\vb{v}} + - \frac{\vb{F}}{m} \cdot \int f \pdv{Q}{\vb{v}} \dd{\vb{v}} +\end{aligned}$$ + +We thus arrive at the prototype of the BTE's so-called **moment equations**: + +$$\begin{aligned} + \boxed{ + 0 + = \pdv{}{t}\big(n \Expval{Q}\big) + \nabla \cdot \big(n \Expval{Q \vb{v}}\big) - \frac{\vb{F}}{m} \cdot \bigg( n \Expval{\pdv{Q}{\vb{v}}} \bigg) + } +\end{aligned}$$ + +If we set $Q = m$, then the mass density $\rho = n \Expval{Q}$, +and we find that the **zeroth moment** of the BTE describes conservation of mass, +where $\vb{V} \equiv \Expval{\vb{v}} = \int \vb{v} f \dd{\vb{v}}$ is the fluid velocity: + +$$\begin{aligned} + \boxed{ + 0 + = \pdv{\rho}{t} + \nabla \cdot \big(\rho \vb{V}\big) + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-moment0"/> +<label for="proof-moment0">Proof</label> +<div class="hidden"> +<label for="proof-moment0">Proof.</label> +We insert $Q = m$ into our prototype, +and since $m$ is constant, the rest is trivial: + +$$\begin{aligned} + 0 + &= \pdv{}{t}\big(n \Expval{m}\big) + \nabla \cdot \big(n \Expval{m \vb{v}}\big) - \frac{\vb{F}}{m} \cdot \bigg( n \Expval{\pdv{m}{\vb{v}}} \bigg) + \\ + &= \pdv{\rho}{t} + \nabla \cdot \big(\rho \Expval{\vb{v}}\big) - 0 +\end{aligned}$$ +</div> +</div> + +If we instead choose the momentum $Q = m \vb{v}$, +we find that the **first moment** of the BTE describes conservation of momentum, +where $\hat{P}$ is the [Cauchy stress tensor](/know/concept/cauchy-stress-tensor/): + +$$\begin{aligned} + \boxed{ + 0 + = \pdv{}{t}\big(\rho \vb{V}\big) + \rho \vb{V} (\nabla \cdot \vb{V}) + \nabla \cdot \hat{P} - n \vb{F} + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-moment1"/> +<label for="proof-moment1">Proof</label> +<div class="hidden"> +<label for="proof-moment1">Proof.</label> +We insert $Q = m \vb{v}$ into our prototype and recognize $\rho$ wherever possible: + +$$\begin{aligned} + 0 + &= \pdv{}{t}\big(n \Expval{m \vb{v}}\big) + \nabla \cdot \big(n \Expval{m \vb{v} \vb{v}}\big) + - \frac{\vb{F}}{m} \cdot \bigg( n \Expval{\pdv{(m \vb{v})}{\vb{v}}} \bigg) + \\ + &= \pdv{}{t}\big(\rho \Expval{\vb{v}}\big) + \nabla \cdot \big(\rho \Expval{\vb{v} \vb{v}}\big) + - \vb{F} \cdot \bigg( n \Expval{\pdv{\vb{v}}{\vb{v}}} \bigg) +\end{aligned}$$ + +With $\vb{v} \vb{v}$ being a dyadic product. +To give it a physical interpretation, +we split $\vb{v} = \vb{V} \!+\! \vb{w}$, +where $\vb{V}$ is the average velocity vector, +and $\vb{w}$ is the local deviation from $\vb{V}$: + +$$\begin{aligned} + \Expval{\vb{v} \vb{v}} + &= \Expval{(\vb{V} \!+\! \vb{w}) (\vb{V} \!+\! \vb{w})} + = \Expval{\vb{V} \vb{V} + 2 \vb{V} \vb{w} + \vb{w} \vb{w}} + = \vb{V} \vb{V} + 2 \vb{V} \Expval{\vb{w}} + \Expval{\vb{w} \vb{w}} +\end{aligned}$$ + +Since $\vb{w}$ represents a deviation from the mean, $\Expval{\vb{w}} = 0$. +We define the pressure tensor: + +$$\begin{aligned} + \hat{P} + \equiv \rho \Expval{\vb{w} \vb{w}} + = \rho \Expval{(\vb{v} \!-\! \vb{V}) (\vb{v} \!-\! \vb{V})} +\end{aligned}$$ + +This leads to the expected result, +where $\nabla \cdot (\rho \vb{V}\vb{V})$ represents the fluid momentum, +and $\nabla \cdot \hat{P}$ the viscous/pressure momentum: + +$$\begin{aligned} + 0 + &= \pdv{}{t}\big(\rho \vb{V}\big) + \nabla \cdot \big(\rho \vb{V} \vb{V} + \hat{P}\big) - n \vb{F} +\end{aligned}$$ +</div> +</div> + +Finally, if we choose the kinetic energy $Q = m |\vb{v}|^2 / 2$, +we find that the **second moment** gives conservation of energy, +where $U$ is the thermal energy density and $\vb{J}$ is the heat flux: + +$$\begin{aligned} + \boxed{ + 0 + = \pdv{}{t}\bigg(\frac{\rho}{2} |\vb{V}|^2 + U \bigg) + + \nabla \cdot \bigg(\frac{\rho}{2} |\vb{V}|^2 \vb{V} + \vb{V} \cdot \hat{P} + U \vb{V} + \vb{J} \bigg) + - \vb{F} \cdot \big( n \vb{V} \big) + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-moment2"/> +<label for="proof-moment2">Proof</label> +<div class="hidden"> +<label for="proof-moment2">Proof.</label> +We insert $Q = m |\vb{v}|^2 / 2$ into our prototype and recognize $\rho$ wherever possible: + +$$\begin{aligned} + 0 + &= \pdv{}{t}\bigg(n \Expval{\frac{m |\vb{v}|^2}{2}}\bigg) + + \nabla \cdot \bigg(n \Expval{\frac{m |\vb{v}|^2}{2} \vb{v}}\bigg) + - \frac{\vb{F}}{m} \cdot \bigg( n \Expval{\pdv{}{\vb{v}} \frac{m |\vb{v}|^2}{2}} \bigg) + \\ + &= \pdv{}{t}\bigg(\frac{\rho}{2} \Expval{|\vb{v}|^2}\bigg) + + \nabla \cdot \bigg(\frac{\rho}{2} \Expval{|\vb{v}|^2 \vb{v}}\bigg) + - \frac{\vb{F}}{2} \cdot \bigg( n \Expval{\pdv{|\vb{v}|^2}{\vb{v}}} \bigg) +\end{aligned}$$ + +We handle these terms one by one. Substituting $\vb{v} = \vb{V} + \vb{w}$ in the first gives: + +$$\begin{aligned} + \Expval{|\vb{v}|^2} + &= \Expval{(\vb{V} \!+\! \vb{w}) \cdot (\vb{V} \!+\! \vb{w})} + = \Expval{|\vb{V}|^2 + 2 \vb{V} \cdot \vb{w} + |\vb{w}|^2} + \\ + &= |\vb{V}|^2 + 2 \vb{V} \cdot \Expval{\vb{w}} + \Expval{|\vb{w}|^2} + = |\vb{V}|^2 + \Expval{|\vb{w}|^2} +\end{aligned}$$ + +And likewise for the second term, +where we recognize the stress tensor $\Expval{\vb{w} \vb{w}}$: + +$$\begin{aligned} + \Expval{|\vb{v}|^2 \vb{v}} + &= \Expval{(\vb{V} \!+\! \vb{w}) \cdot (\vb{V} \!+\! \vb{w}) (\vb{V} \!+\! \vb{w})} + = \Expval{(|\vb{V}|^2 + 2 \vb{V} \cdot \vb{w} + |\vb{w}|^2) (\vb{V} \!+\! \vb{w})} + \\ + &= \Expval{|\vb{V}|^2 \vb{V} + |\vb{V}|^2 \vb{w} + + 2 (\vb{V} \cdot \vb{w}) \vb{V} + 2 (\vb{V} \cdot \vb{w}) \vb{w} + + |\vb{w}|^2 \vb{V} + |\vb{w}|^2 \vb{w}} + \\ + &= |\vb{V}|^2 \vb{V} + |\vb{V}|^2 \Expval{\vb{w}} + + 2 (\vb{V} \cdot \Expval{\vb{w}}) \vb{V} + 2 \Expval{(\vb{V} \cdot \vb{w}) \vb{w}} + + \Expval{|\vb{w}|^2} \vb{V} + \Expval{|\vb{w}|^2 \vb{w}} + \\ + &= |\vb{V}|^2 \vb{V} + 0 + 0 + 2 \vb{V} \cdot \Expval{\vb{w} \vb{w}} + + \Expval{|\vb{w}|^2} \vb{V} + \Expval{|\vb{w}|^2 \vb{w}} +\end{aligned}$$ + +The third term is fairly obvious, but we calculate it rigorously just to be safe: + +$$\begin{aligned} + \pdv{|\vb{v}|^2}{\vb{v}} + &= \pdv{}{\vb{v}} \big( v_x^2 + v_y^2 + v_z^2 \big) + = \vu{e}_x \pdv{v_x^2}{v_x} + \vu{e}_y \pdv{v_y^2}{v_y} + \vu{e}_z \pdv{v_z^2}{v_z} + = 2 \vb{v} +\end{aligned}$$ + +To clarify the physical interpretation, +we define $U$, $\vb{J}$ and $\hat{P}$ as follows: + +$$\begin{aligned} + U + &\equiv \frac{\rho}{2} \Expval{|\vb{w}|^2} + = \frac{\rho}{2} \Expval{(\vb{v} \!-\! \vb{V}) \cdot (\vb{v} \!-\! \vb{V})} + \\ + \vb{J} + &\equiv \frac{\rho}{2} \Expval{|\vb{w}|^2 \vb{w}} + = \frac{\rho}{2} \Expval{(\vb{v} \!-\! \vb{V}) \cdot (\vb{v} \!-\! \vb{V})(\vb{v} \!-\! \vb{V})} + \\ + \hat{P} + &\equiv \rho \Expval{\vb{w} \vb{w}} + = \rho \Expval{(\vb{v} \!-\! \vb{V}) (\vb{v} \!-\! \vb{V})} +\end{aligned}$$ + +Putting it all together, we arrive at the expected result, namely: + +$$\begin{aligned} + 0 + &= \pdv{}{t}\bigg(\frac{\rho}{2} |\vb{V}|^2 + U \bigg) + + \nabla \cdot \bigg(\frac{\rho}{2} |\vb{V}|^2 \vb{V} + \vb{V} \cdot \hat{P} + U \vb{V} + \vb{J} \bigg) + - \vb{F} \cdot \big( n \vb{V} \big) +\end{aligned}$$ + +For the sake of clarity, we write out the pressure term, including the outer divergence: + +$$\begin{aligned} + \nabla \cdot (\vb{V} \cdot \hat{P}) + &= (\nabla \cdot \hat{P}{}^{\mathrm{T}}) \cdot \vb{V} + = \nabla \cdot + \begin{bmatrix} + P_{xx} & P_{xy} & P_{xz} \\ + P_{yx} & P_{yy} & P_{yz} \\ + P_{zx} & P_{zy} & P_{zz} + \end{bmatrix} + \cdot + \begin{bmatrix} + V_x \\ V_y \\ V_z + \end{bmatrix} + \\ + &= + \begin{bmatrix} + \displaystyle \pdv{P_{xx}}{x} + \pdv{P_{xy}}{y} + \pdv{P_{xz}}{z} \\ + \displaystyle \pdv{P_{yx}}{x} + \pdv{P_{yy}}{y} + \pdv{P_{yz}}{z} \\ + \displaystyle \pdv{P_{zx}}{x} + \pdv{P_{zy}}{y} + \pdv{P_{zz}}{z} + \end{bmatrix}^{\top} + \cdot + \begin{bmatrix} + V_x \\ V_y \\ V_z + \end{bmatrix} + = \sum_{i=1}^{3} \sum_{j=1}^{3} \pdv{P_{ij}}{x_j} V_i +\end{aligned}$$ +</div> +</div> + + + +## References +1. M. Salewski, A.H. Nielsen, + *Plasma physics: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/boltzmann-relation/index.md b/source/know/concept/boltzmann-relation/index.md new file mode 100644 index 0000000..6dd04d2 --- /dev/null +++ b/source/know/concept/boltzmann-relation/index.md @@ -0,0 +1,90 @@ +--- +title: "Boltzmann relation" +date: 2021-10-18 +categories: +- Physics +- Plasma physics +layout: "concept" +--- + +In a plasma where the ions and electrons are both in thermal equilibrium, +and in the absence of short-lived induced electromagnetic fields, +their densities $n_i$ and $n_e$ can be predicted. + +By definition, a particle in an [electric field](/know/concept/electric-field/) $\vb{E}$ +experiences a [Lorentz force](/know/concept/lorentz-force/) $\vb{F}_e$. +This corresponds to a force density $\vb{f}_e$, +such that $\vb{F}_e = \vb{f}_e \dd{V}$. +For the electrons, we thus have: + +$$\begin{aligned} + \vb{f}_e + = q_e n_e \vb{E} + = - q_e n_e \nabla \phi +\end{aligned}$$ + +Meanwhile, if we treat the electrons as a gas +obeying the ideal gas law $p_e = k_B T_e n_e$, +then the pressure $p_e$ leads to another force density $\vb{f}_p$: + +$$\begin{aligned} + \vb{f}_p + = - \nabla p_e + = - k_B T_e \nabla n_e +\end{aligned}$$ + +At equilibrium, we demand that $\vb{f}_e = - \vb{f}_p$, +and isolate this equation for $\nabla n_e$, yielding: + +$$\begin{aligned} + k_B T_e \nabla n_e + = - q_e n_e \nabla \phi + \quad \implies \quad + \nabla n_e + = - \frac{q_e \nabla \phi}{k_B T_e} n_e + = - \nabla \bigg( \frac{q_e \phi}{k_B T_e} \bigg) n_e +\end{aligned}$$ + +This equation is straightforward to integrate, +leading to the following expression for $n_e$, +known as the **Boltzmann relation**, +due to its resemblance to the statistical Boltzmann distribution +(see [canonical ensemble](/know/concept/canonical-ensemble/)): + +$$\begin{aligned} + \boxed{ + n_e(\vb{r}) + = n_{e0} \exp\!\bigg( \!-\! \frac{q_e \phi(\vb{r})}{k_B T_e} \bigg) + } +\end{aligned}$$ + +Where the linearity factor $n_{e0}$ represents +the electron density for $\phi = 0$. +We can do the same for ions instead of electrons, +leading to the following ion density $n_i$: + +$$\begin{aligned} + \boxed{ + n_i(\vb{r}) + = n_{i0} \exp\!\bigg( \!-\! \frac{q_i \phi(\vb{r})}{k_B T_i} \bigg) + } +\end{aligned}$$ + +However, due to their larger mass, +ions are much slower to respond to fluctuations in the above equilibrium. +Consequently, after a perturbation, +the ions spend much more time in a transient non-equilibrium state +than the electrons, so this formula for $n_i$ is only valid +if the perturbation is sufficiently slow, +allowing the ions to keep up. +Usually, electrons do not suffer the same issue, +thanks to their small mass and fast response. + + +## References +1. P.M. Bellan, + *Fundamentals of plasma physics*, + 1st edition, Cambridge. +2. M. Salewski, A.H. Nielsen, + *Plasma physics: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/bose-einstein-distribution/index.md b/source/know/concept/bose-einstein-distribution/index.md new file mode 100644 index 0000000..8397a8f --- /dev/null +++ b/source/know/concept/bose-einstein-distribution/index.md @@ -0,0 +1,77 @@ +--- +title: "Bose-Einstein distribution" +date: 2021-07-11 +categories: +- Physics +- Statistics +- Quantum mechanics +layout: "concept" +--- + +**Bose-Einstein statistics** describe how bosons, +which do not obey the [Pauli exclusion principle](/know/concept/pauli-exclusion-principle/), +will distribute themselves across the available states +in a system at equilibrium. + +Consider a single-particle state $s$, +which can contain any number of bosons. +Since the occupation number $N$ is variable, +we turn to the [grand canonical ensemble](/know/concept/grand-canonical-ensemble/), +whose grand partition function $\mathcal{Z}$ is as follows, +where $\varepsilon$ is the energy per particle, +and $\mu$ is the chemical potential: + +$$\begin{aligned} + \mathcal{Z} + = \sum_{N = 0}^\infty \Big( \exp(- \beta (\varepsilon - \mu)) \Big)^{N} + = \frac{1}{1 - \exp(- \beta (\varepsilon - \mu))} +\end{aligned}$$ + +The corresponding [thermodynamic potential](/know/concept/thermodynamic-potential/) +is the Landau potential $\Omega$, given by: + +$$\begin{aligned} + \Omega + = - k T \ln{\mathcal{Z}} + = k T \ln\!\Big( 1 - \exp(- \beta (\varepsilon - \mu)) \Big) +\end{aligned}$$ + +The average number of particles $\Expval{N}$ +is found by taking a derivative of $\Omega$: + +$$\begin{aligned} + \Expval{N} + = - \pdv{\Omega}{\mu} + = k T \pdv{\ln{\mathcal{Z}}}{\mu} + = \frac{\exp(- \beta (\varepsilon - \mu))}{1 - \exp(- \beta (\varepsilon - \mu))} +\end{aligned}$$ + +By multitplying both the numerator and the denominator by $\exp(\beta(\varepsilon \!-\! \mu))$, +we arrive at the standard form of the **Bose-Einstein distribution** $f_B$: + +$$\begin{aligned} + \boxed{ + \Expval{N} + = f_B(\varepsilon) + = \frac{1}{\exp(\beta (\varepsilon - \mu)) - 1} + } +\end{aligned}$$ + +This tells the expected occupation number $\Expval{N}$ of state $s$, +given a temperature $T$ and chemical potential $\mu$. +The corresponding variance $\sigma^2$ of $N$ is found to be: + +$$\begin{aligned} + \boxed{ + \sigma^2 + = k T \pdv{\Expval{N}}{\mu} + = \Expval{N} \big(1 + \Expval{N}\big) + } +\end{aligned}$$ + + + +## References +1. H. Gould, J. Tobochnik, + *Statistical and thermal physics*, 2nd edition, + Princeton. diff --git a/source/know/concept/calculus-of-variations/index.md b/source/know/concept/calculus-of-variations/index.md new file mode 100644 index 0000000..81d9a5f --- /dev/null +++ b/source/know/concept/calculus-of-variations/index.md @@ -0,0 +1,339 @@ +--- +title: "Calculus of variations" +date: 2021-02-24 +categories: +- Mathematics +- Physics +layout: "concept" +--- + +The **calculus of variations** lays the mathematical groundwork +for [Lagrangian mechanics](/know/concept/lagrangian-mechanics/). + +Consider a **functional** $J$, mapping a function $f(x)$ to a scalar value +by integrating over the so-called **Lagrangian** $L$, +which represents an expression involving $x$, $f$ and the derivative $f'$: + +$$\begin{aligned} + J[f] = \int_{x_0}^{x_1} L(f, f', x) \dd{x} +\end{aligned}$$ + +If $J$ in some way measures the physical "cost" (e.g. energy) of +the path $f(x)$ taken by a physical system, +the **principle of least action** states that $f$ will be a minimum of $J[f]$, +so for example the expended energy will be minimized. +In practice, various cost metrics may be used, +so maxima of $J[f]$ are also interesting to us. + +If $f(x, \varepsilon\!=\!0)$ is the optimal route, then a slightly +different (and therefore worse) path between the same two points can be expressed +using the parameter $\varepsilon$: + +$$\begin{aligned} + f(x, \varepsilon) = f(x, 0) + \varepsilon \eta(x) + \qquad \mathrm{or} \qquad + \delta f = \varepsilon \eta(x) +\end{aligned}$$ + +Where $\eta(x)$ is an arbitrary differentiable deviation. +Since $f(x, \varepsilon)$ must start and end in the same points as $f(x,0)$, +we have the boundary conditions: + +$$\begin{aligned} + \eta(x_0) = \eta(x_1) = 0 +\end{aligned}$$ + +Given $L$, the goal is to find an equation for the optimal path $f(x,0)$. +Just like when finding the minimum of a real function, +the minimum $f$ of a functional $J[f]$ is a stationary point +with respect to the deviation weight $\varepsilon$, +a condition often written as $\delta J = 0$. +In the following, the integration limits have been omitted: + +$$\begin{aligned} + 0 + &= \delta J + = \pdv{J}{\varepsilon} \Big|_{\varepsilon = 0} + = \int \pdv{L}{\varepsilon} \dd{x} + = \int \pdv{L}{f} \pdv{f}{\varepsilon} + \pdv{L}{f'} \pdv{f'}{\varepsilon} \dd{x} + \\ + &= \int \pdv{L}{f} \eta + \pdv{L}{f'} \eta' \dd{x} + = \Big[ \pdv{L}{f'} \eta \Big]_{x_0}^{x_1} + \int \pdv{L}{f} \eta - \dv{}{x}\Big( \pdv{L}{f'} \Big) \eta \dd{x} +\end{aligned}$$ + +The boundary term from partial integration vanishes due to the boundary +conditions for $\eta(x)$. We are thus left with: + +$$\begin{aligned} + 0 + = \int \eta \bigg( \pdv{L}{f} - \dv{}{x}\Big( \pdv{L}{f'} \Big) \bigg) \dd{x} +\end{aligned}$$ + +This holds for all $\eta$, but $\eta$ is arbitrary, so in fact +only the parenthesized expression matters: + +$$\begin{aligned} + \boxed{ + 0 = \pdv{L}{f} - \dv{}{x}\Big( \pdv{L}{f'} \Big) + } +\end{aligned}$$ + +This is known as the **Euler-Lagrange equation** of the Lagrangian $L$, +and its solutions represent the optimal paths $f(x, 0)$. + + +## Multiple functions + +Suppose that the Lagrangian $L$ depends on multiple independent functions +$f_1, f_2, ..., f_N$: + +$$\begin{aligned} + J[f_1, ..., f_N] = \int_{x_0}^{x_1} L(f_1, ..., f_N, f_1', ..., f_N', x) \dd{x} +\end{aligned}$$ + +In this case, every $f_n(x)$ has its own deviation $\eta_n(x)$, +satisfying $\eta_n(x_0) = \eta_n(x_1) = 0$: + +$$\begin{aligned} + f_n(x, \varepsilon) = f_n(x, 0) + \varepsilon \eta_n(x) +\end{aligned}$$ + +The derivation procedure is identical to the case $N = 1$ from earlier: + +$$\begin{aligned} + 0 + &= \pdv{J}{\varepsilon} \Big|_{\varepsilon = 0} + = \int \pdv{L}{\varepsilon} \dd{x} + = \int \sum_{n} \Big( \pdv{L}{f_n} \pdv{f_n}{\varepsilon} + \pdv{L}{f_n'} \pdv{f_n'}{\varepsilon} \Big) \dd{x} + \\ + &= \int \sum_{n} \Big( \pdv{L}{f_n} \eta_n + \pdv{L}{f_n'} \eta_n' \Big) \dd{x} + \\ + &= \Big[ \sum_{n} \pdv{L}{f_n'} \eta_n \Big]_{x_0}^{x_1} + + \int \sum_{n} \eta_n \bigg( \pdv{L}{f_n} - \dv{}{x}\Big( \pdv{L}{f_n'} \Big) \bigg) \dd{x} +\end{aligned}$$ + +Once again, $\eta_n(x)$ is arbitrary and disappears at the boundaries, +so we end up with $N$ equations of the same form as for a single function: + +$$\begin{aligned} + \boxed{ + 0 = \pdv{L}{f_1} - \dv{}{x}\Big( \pdv{L}{f_1'} \Big) + \quad \cdots \quad + 0 = \pdv{L}{f_N} - \dv{}{x}\Big( \pdv{L}{f_N'} \Big) + } +\end{aligned}$$ + + +## Higher-order derivatives + +Suppose that the Lagrangian $L$ depends on multiple derivatives of $f(x)$: + +$$\begin{aligned} + J[f] = \int_{x_0}^{x_1} L(f, f', f'', ..., f^{(N)}, x) \dd{x} +\end{aligned}$$ + +Once again, the derivation procedure is the same as before: + +$$\begin{aligned} + 0 + &= \pdv{J}{\varepsilon} \Big|_{\varepsilon = 0} + = \int \pdv{L}{\varepsilon} \dd{x} + = \int \pdv{L}{f} \pdv{f}{\varepsilon} + \sum_{n} \pdv{L}{f^{(n)}} \pdv{f^{(n)}}{\varepsilon} \dd{x} + \\ + &= \int \pdv{L}{f} \eta + \sum_{n} \pdv{L}{f^{(n)}} \eta^{(n)} \dd{x} +\end{aligned}$$ + +The goal is to turn each $\eta^{(n)}(x)$ into $\eta(x)$, so we need to +partially integrate the $n$th term of the sum $n$ times. In this case, +we will need some additional boundary conditions for $\eta(x)$: + +$$\begin{aligned} + \eta'(x_0) = \eta'(x_1) = 0 + \qquad \cdots \qquad + \eta^{(N-1)}(x_0) = \eta^{(N-1)}(x_1) = 0 +\end{aligned}$$ + +This eliminates the boundary terms from partial integration, leaving: + +$$\begin{aligned} + 0 + &= \int \eta \bigg( \pdv{L}{f} + \sum_{n} (-1)^n \dvn{n}{}{x}\Big( \pdv{L}{f^{(n)}} \Big) \bigg) \dd{x} +\end{aligned}$$ + +Once again, because $\eta(x)$ is arbitrary, the Euler-Lagrange equation becomes: + +$$\begin{aligned} + \boxed{ + 0 = \pdv{L}{f} + \sum_{n} (-1)^n \dvn{n}{}{x}\Big( \pdv{L}{f^{(n)}} \Big) + } +\end{aligned}$$ + + +## Multiple coordinates + +Suppose now that $f$ is a function of multiple variables. +For brevity, we only consider two variables $x$ and $y$, +but the results generalize effortlessly to larger amounts. +The Lagrangian now depends on all the partial derivatives of $f(x, y)$: + +$$\begin{aligned} + J[f] = \iint_{(x_0, y_0)}^{(x_1, y_1)} L(f, f_x, f_y, x, y) \dd{x} \dd{y} +\end{aligned}$$ + +The arbitrary deviation $\eta$ is then also a function of multiple variables: + +$$\begin{aligned} + f(x, y; \varepsilon) = f(x, y; 0) + \varepsilon \eta(x, y) +\end{aligned}$$ + +The derivation procedure starts in the exact same way as before: + +$$\begin{aligned} + 0 + &= \pdv{J}{\varepsilon} \Big|_{\varepsilon = 0} + = \iint \pdv{L}{\varepsilon} \dd{x} \dd{y} + \\ + &= \iint \pdv{L}{f} \pdv{f}{\varepsilon} + \pdv{L}{f_x} \pdv{f_x}{\varepsilon} + \pdv{L}{f_y} \pdv{f_y}{\varepsilon} \dd{x} \dd{y} + \\ + &= \iint \pdv{L}{f} \eta + \pdv{L}{f_x} \eta_x + \pdv{L}{f_y} \eta_y \dd{x} \dd{y} +\end{aligned}$$ + +We partially integrate for both $\eta_x$ and $\eta_y$, yielding: + +$$\begin{aligned} + 0 + &= \int \Big[ \pdv{L}{f_x} \eta \Big]_{x_0}^{x_1} \dd{y} + \int \Big[ \pdv{L}{f_y} \eta \Big]_{y_0}^{y_1} \dd{x} + \\ + &\quad + \iint \eta \bigg( \pdv{L}{f} - \dv{}{x}\Big( \pdv{L}{f_x} \Big) - \dv{}{y}\Big( \pdv{L}{f_y} \Big) \bigg) \dd{x} \dd{y} +\end{aligned}$$ + +But now, to eliminate these boundary terms, we need extra conditions for $\eta$: + +$$\begin{aligned} + \forall y: \eta(x_0, y) = \eta(x_1, y) = 0 + \qquad + \forall x: \eta(x, y_0) = \eta(x, y_1) = 0 +\end{aligned}$$ + +In other words, the deviation $\eta$ must be zero on the whole "box". +Again relying on the fact that $\eta$ is arbitrary, the Euler-Lagrange +equation is: + +$$\begin{aligned} + 0 = \pdv{L}{f} - \dv{}{x}\Big( \pdv{L}{f_x} \Big) - \dv{}{y}\Big( \pdv{L}{f_y} \Big) +\end{aligned}$$ + +This generalizes nicely to functions of even more variables $x_1, x_2, ..., x_N$: + +$$\begin{aligned} + \boxed{ + 0 = \pdv{L}{f} - \sum_{n} \dv{}{x_n}\Big( \pdv{L}{f_{x_n}} \Big) + } +\end{aligned}$$ + + +## Constraints + +So far, for multiple functions $f_1, ..., f_N$, +we have been assuming that all $f_n$ are independent, and by extension all $\eta_n$. +Suppose that we now have $M < N$ constraints $\phi_m$ +that all $f_n$ need to obey, introducing implicit dependencies between them. + +Let us consider constraints $\phi_m$ of the two forms below. +It is important that they are **holonomic**, +meaning they do not depend on any derivatives of any $f_n(x)$: + +$$\begin{aligned} + \phi_m(f_1, ..., f_N, x) = 0 + \qquad \mathrm{or} \qquad + \int_{x_0}^{x_1} \phi_m(f_1, ..., f_N, x) \dd{x} = C_m +\end{aligned}$$ + +Where $C_m$ is a constant. +Note that the first form can also be used for $\phi_m = C_m \neq 0$, +by simply redefining the constraint as $\phi_m^0 = \phi_m - C_m = 0$. + +To solve this constrained optimization problem for $f_n(x)$, +we introduce [Lagrange multipliers](/know/concept/lagrange-multiplier/) $\lambda_m$. +In the former case $\lambda_m(x)$ is a function of $x$, while in the +latter case $\lambda_m$ is constant: + +$$\begin{aligned} + \int \lambda_m(x) \: \phi_m(\{f_n\}, x) \dd{x} = 0 + \qquad \mathrm{or} \qquad + \lambda_m \int \phi_m(\{f_n\}, x) \dd{x} = \lambda_m C_m +\end{aligned}$$ + +The reason for this distinction in $\lambda_m$ +is that we need to find the stationary points with respect to $\varepsilon$ +of both constraint types. Written in the variational form, this is: + +$$\begin{aligned} + \delta \int \lambda_m \: \phi_m \dd{x} = 0 +\end{aligned}$$ + +From this, we define a new Lagrangian $\Lambda$ for the functional $J$, +with the contraints built in: + +$$\begin{aligned} + J[f_n] + &= \int \Lambda(f_1, ..., f_N; f_1', ..., f_N'; \lambda_1, ..., \lambda_M; x) \dd{x} + \\ + &= \int L + \sum_{m} \lambda_m \phi_m \dd{x} +\end{aligned}$$ + +Then we derive the Euler-Lagrange equation as usual for $\Lambda$ instead of $L$: + +$$\begin{aligned} + 0 + &= \delta \int \Lambda \dd{x} + = \int \pdv{\Lambda}{\varepsilon} \dd{x} + = \int \sum_n \Big( \pdv{\Lambda}{f_n} \pdv{f_n}{\varepsilon} + \pdv{\Lambda}{f_n'} \pdv{f_n'}{\varepsilon} \Big) \dd{x} + \\ + &= \int \sum_n \Big( \pdv{\Lambda}{f_n} \eta_n + \pdv{\Lambda}{f_n'} \eta_n' \Big) \dd{x} + \\ + &= \Big[ \sum_n \pdv{\Lambda}{f_n'} \eta_n \Big]_{x_0}^{x_1} + + \int \sum_n \eta_n \bigg( \pdv{\Lambda}{f_n} - \dv{}{x}\Big( \pdv{\Lambda}{f_n'} \Big) \bigg) \dd{x} +\end{aligned}$$ + +Using the same logic as before, we end up with a set of Euler-Lagrange equations with $\Lambda$: + +$$\begin{aligned} + 0 + = \pdv{\Lambda}{f_n} - \dv{}{x}\Big( \pdv{\Lambda}{f_n'} \Big) +\end{aligned}$$ + +By inserting the definition of $\Lambda$, we then get the following. +Recall that $\phi_m$ is holonomic, and thus independent of all derivatives $f_n'$: + +$$\begin{aligned} + \boxed{ + 0 + = \pdv{L}{f_n} - \dv{}{x}\Big( \pdv{L}{f_n'} \Big) + \sum_{m} \lambda_m \pdv{\phi_m}{f_n} + } +\end{aligned}$$ + +These are **Lagrange's equations of the first kind**, +with their second-kind counterparts being the earlier Euler-Lagrange equations. +Note that there are $N$ separate equations, one for each $f_n$. + +Due to the constraints $\phi_m$, the functions $f_n$ are not independent. +This is solved by choosing $\lambda_m$ such that $M$ of the $N$ equations hold, +i.e. solving a system of $M$ equations for $\lambda_m$: + +$$\begin{aligned} + \dv{}{x}\Big( \pdv{L}{f_n'} \Big) - \pdv{L}{f_n} + = \sum_{m} \lambda_m \pdv{\phi_m}{f_n} +\end{aligned}$$ + +And then the remaining $N - M$ equations can be solved in the normal unconstrained way. + + + +## References +1. G.B. Arfken, H.J. Weber, + *Mathematical methods for physicists*, 6th edition, 2005, + Elsevier. +2. O. Bang, + *Applied mathematics for physicists: lecture notes*, 2019, + unpublished. diff --git a/source/know/concept/canonical-ensemble/index.md b/source/know/concept/canonical-ensemble/index.md new file mode 100644 index 0000000..aca2a33 --- /dev/null +++ b/source/know/concept/canonical-ensemble/index.md @@ -0,0 +1,239 @@ +--- +title: "Canonical ensemble" +date: 2021-07-10 +categories: +- Physics +- Thermodynamics +- Thermodynamic ensembles +layout: "concept" +--- + +The **canonical ensemble** or **NVT ensemble** builds on +the [microcanonical ensemble](/know/concept/microcanonical-ensemble/), +by allowing the system to exchange energy with a very large heat bath, +such that its temperature $T$ remains constant, +but internal energy $U$ does not. +The conserved state functions are +the temperature $T$, the volume $V$, and the particle count $N$. + +We refer to the system of interest as $A$, and the heat bath as $B$. +The combination $A\!+\!B$ forms a microcanonical ensemble, +i.e. it has a fixed total energy $U$, +and eventually reaches an equilibrium +with a uniform temperature $T$ in both $A$ and $B$. + +Assuming that this equilibrium has been reached, +we want to know which microstates $A$ prefers in that case. +Specifically, if $A$ has energy $U_A$, and $B$ has $U_B$, +which $U_A$ does $A$ prefer? + +Let $c_B(U_B)$ be the number of $B$-microstates with energy $U_B$. +Then the probability that $A$ is in a specific microstate $s_A$ is as follows, +where $U_A(s_A)$ is the resulting energy: + +$$\begin{aligned} + p(s_A) + = \frac{c_B(U - U_A(s_A))}{D} + \qquad \quad + D \equiv \sum_{s_A} c_B(U - U_A(s_A)) +\end{aligned}$$ + +In other words, we choose an $s_A$, +and count the number $c_B$ of compatible $B$-microstates. + +Since the heat bath is large, let us assume that $U_B \gg U_A$. +We thus approximate $\ln{p(s_A)}$ by +Taylor-expanding $\ln{c_B(U_B)}$ around $U_B = U$: + +$$\begin{aligned} + \ln{p(s_A)} + &= -\ln{D} + \ln\!\big(c_B(U - U_A(s_A))\big) + \\ + &\approx - \ln{D} + \ln{c_B(U)} - \bigg( \dv{(\ln{c_B})}{U_B} \bigg) \: U_A(s_A) +\end{aligned}$$ + +Here, we use the definition of entropy $S_B \equiv k \ln{c_B}$, +and that its $U_B$-derivative is $1/T$: + +$$\begin{aligned} + \ln{p(s_A)} + &\approx - \ln{D} + \ln{c_B(U)} - \frac{U_A(s_A)}{k} \Big( \pdv{S_B}{U_B} \Big) + \\ + &\approx - \ln{D} + \ln{c_B(U)} - \frac{U_A(s_A)}{k T} +\end{aligned}$$ + +We now define the **partition function** or **Zustandssumme** $Z$ as follows, +which will act as a normalization factor for the probability: + +$$\begin{aligned} + \boxed{ + Z + \equiv \sum_{s_A}^{} \exp(- \beta U_A(s_A)) + } + = \frac{D}{c_B(U)} +\end{aligned}$$ + +Where $\beta \equiv 1/ (k T)$. +The probability of finding $A$ in a microstate $s_A$ is thus given by: + +$$\begin{aligned} + \boxed{ + p(s_A) = \frac{1}{Z} \exp(- \beta U_A(s_A)) + } +\end{aligned}$$ + +This is the **Boltzmann distribution**, +which, as it turns out, maximizes the entropy $S_A$ +for a fixed value of the average energy $\Expval{U_A}$, +i.e. a fixed $T$ and set of microstates $s_A$. + +Because $A\!+\!B$ is a microcanonical ensemble, +we know that its [thermodynamic potential](/know/concept/thermodynamic-potential/) +is the entropy $S$. +But what about the canonical ensemble, just $A$? + +The solution is a bit backwards. +Note that the partition function $Z$ is not a constant; +it depends on $T$ (via $\beta$), $V$ and $N$ (via $s_A$). +Using the same logic as for the microcanonical ensemble, +we define "equilibrium" as the set of microstates $s_A$ +that $A$ is most likely to occupy, +which must be the set (as a function of $T,V,N$) that maximizes $Z$. + +However, $T$, $V$ and $N$ are fixed, +so how can we maximize $Z$? +Well, as it turns out, +the Boltzmann distribution has already done it for us! +We will return to this point later. + +Still, $Z$ does not have a clear physical interpretation. +To find one, we start by showing that the ensemble averages +of the energy $U_A$, pressure $P_A$ and chemical potential $\mu_A$ +can be calculated by differentiating $Z$. +As preparation, note that: + +$$\begin{aligned} + \pdv{Z}{\beta} = - \sum_{s_A} U_A \exp(- \beta U_A) +\end{aligned}$$ + +With this, we can find the ensemble averages +$\Expval{U_A}$, $\Expval{P_A}$ and $\Expval{\mu_A}$ of the system: + +$$\begin{aligned} + \Expval{U_A} + &= \sum_{s_A} p(s_A) \: U_A + = \frac{1}{Z} \sum_{s_A} U_A \exp(- \beta U_A) + = - \frac{1}{Z} \pdv{Z}{\beta} + \\ + \Expval{P_A} + &= - \sum_{s_A} p(s_A) \pdv{U_A}{V} + = - \frac{1}{Z} \sum_{s_A} \exp(- \beta U_A) \pdv{U_A}{V} + \\ + &= \frac{1}{Z \beta} \pdv{}{V}\sum_{s_A} \exp(- \beta U_A) + = \frac{1}{Z \beta} \pdv{Z}{V} + \\ + \Expval{\mu_A} + &= \sum_{s_A} p(s_A) \pdv{U_A}{N} + = \frac{1}{Z} \sum_{s_A} \exp(- \beta U_A) \pdv{U_A}{N} + \\ + &= - \frac{1}{Z \beta} \pdv{}{N}\sum_{s_A} \exp(- \beta U_A) + = - \frac{1}{Z \beta} \pdv{Z}{N} +\end{aligned}$$ + +It will turn out more convenient to use derivatives of $\ln{Z}$ instead, +in which case: + +$$\begin{aligned} + \Expval{U_A} + = - \pdv{\ln{Z}}{\beta} + \qquad \quad + \Expval{P_A} + = \frac{1}{\beta} \pdv{\ln{Z}}{V} + \qquad \quad + \Expval{\mu_A} + = - \frac{1}{\beta} \pdv{\ln{Z}}{N} +\end{aligned}$$ + +Now, to find a physical interpretation for $Z$. +Consider the quantity $F$, in units of energy, +whose minimum corresponds to a maximum of $Z$: + +$$\begin{aligned} + F \equiv - k T \ln{Z} +\end{aligned}$$ + +We rearrange the equation to $\beta F = - \ln{Z}$ and take its differential element: + +$$\begin{aligned} + \dd{(\beta F)} + = - \dd{(\ln{Z})} + &= - \pdv{\ln{Z}}{\beta} \dd{\beta} - \pdv{\ln{Z}}{V} \dd{V} - \pdv{\ln{Z}}{N} \dd{N} + \\ + &= \Expval{U_A} \dd{\beta} - \beta \Expval{P_A} \dd{V} + \beta \Expval{\mu_A} \dd{N} + \\ + &= \Expval{U_A} \dd{\beta} + \beta \dd{\Expval{U_A}} - \beta \dd{\Expval{U_A}} - \beta \Expval{P_A} \dd{V} + \beta \Expval{\mu_A} \dd{N} + \\ + &= \dd{(\beta \Expval{U_A})} - \beta \: \big( \dd{\Expval{U_A}} + \Expval{P_A} \dd{V} - \Expval{\mu_A} \dd{N} \big) +\end{aligned}$$ + +Rearranging and substituting +the [fundamental thermodynamic relation](/know/concept/fundamental-thermodynamic-relation/) +then gives: + +$$\begin{aligned} + \dd{(\beta F - \beta \Expval{U_A})} + &= - \beta \: \big( \dd{\Expval{U_A}} + \Expval{P_A} \dd{V} - \Expval{\mu_A} \dd{N} \big) + = - \beta T \dd{S_A} +\end{aligned}$$ + +We integrate this and ignore the integration constant, +leading us to the desired result: + +$$\begin{aligned} + - \beta T S_A + &= \beta F - \beta \Expval{U_A} + \quad \implies \quad + F = \Expval{U_A} - T S_A +\end{aligned}$$ + +As was already suggested by our notation, +$F$ turns out to be the **Helmholtz free energy**: + +$$\begin{aligned} + \boxed{ + F + \equiv - k T \ln{Z} + = \Expval{U_A} - T S_A + } +\end{aligned}$$ + +We can therefore reinterpret +the partition function $Z$ and the Boltzmann distribution $p(s_A)$ +in the following "more physical" way: + +$$\begin{aligned} + Z + = \exp(- \beta F) + \qquad \quad + p(s_A) + = \exp\!\Big( \beta \big( F \!-\! U_A(s_A) \big) \Big) +\end{aligned}$$ + +Finally, by rearranging the expressions for $F$, +we find the entropy $S_A$ to be: + +$$\begin{aligned} + S_A + = k \ln{Z} + \frac{\Expval{U_A}}{T} +\end{aligned}$$ + +This is why $Z$ is already maximized: +the Boltzmann distribution maximizes $S_A$ for fixed values of $T$ and $\Expval{U_A}$, +leaving $Z$ as the only "variable". + + + +## References +1. H. Gould, J. Tobochnik, + *Statistical and thermal physics*, 2nd edition, + Princeton. diff --git a/source/know/concept/capillary-action/index.md b/source/know/concept/capillary-action/index.md new file mode 100644 index 0000000..b388389 --- /dev/null +++ b/source/know/concept/capillary-action/index.md @@ -0,0 +1,125 @@ +--- +title: "Capillary action" +date: 2021-03-29 +categories: +- Physics +- Fluid mechanics +- Fluid statics +- Surface tension +layout: "concept" +--- + +**Capillary action** refers to the movement of liquid +through narrow spaces due to surface tension, often against gravity. +It occurs when the [Laplace pressure](/know/concept/young-laplace-law/) +from surface tension is much larger in magnitude than the +[hydrostatic pressure](/know/concept/hydrostatic-pressure/) from gravity. + +Consider a spherical droplet of liquid with radius $R$. +The hydrostatic pressure difference +between the top and bottom of the drop +is much smaller than the Laplace pressure: + +$$\begin{aligned} + 2 R \rho g \ll 2 \frac{\alpha}{R} +\end{aligned}$$ + +Where $\rho$ is the density of the liquid, +$g$ is the acceleration due to gravity, +and $\alpha$ is the energy cost per unit surface area. +Rearranging the inequality yields: + +$$\begin{aligned} + R^2 \ll \frac{\alpha}{\rho g} +\end{aligned}$$ + +From the right-hand side we define the **capillary length** $L_c$, +so gravity is negligible if $R \ll L_c$: + +$$\begin{aligned} + \boxed{ + L_c + \equiv \sqrt{\frac{\alpha}{\rho g}} + } +\end{aligned}$$ + +In general, for a system with characteristic length $L$, +the relative strength of gravity compared to surface tension +is described by the **Bond number** $\mathrm{Bo}$ +or **Eötvös number** $\mathrm{Eo}$: + +$$\begin{aligned} + \boxed{ + \mathrm{Bo} + \equiv \mathrm{Eo} + \equiv \frac{L^2}{L_c^2} + = \frac{m g}{\alpha L} + } +\end{aligned}$$ + +The right-most side gives an alternative way of understanding $\mathrm{Bo}$: +$m$ is the mass of a cube with side $L$, such that the numerator is the weight force, +and the denominator is the tension force of the surface. +In any case, capillary action can be observed when $\mathrm{Bo \ll 1}$. + +The most famous example of capillary action is **capillary rise**, +where a liquid "climbs" upwards in a narrow vertical tube with radius $R$, +apparently defying gravity. +Assuming the liquid-air interface is a spherical cap +with constant [curvature](/know/concept/curvature/) radius $R_c$, +then we know that the liquid is at rest +when the hydrostatic pressure equals the Laplace pressure: + +$$\begin{aligned} + \rho g h + \approx \alpha \frac{2}{R_c} + = 2 \alpha \frac{\cos\theta}{R} +\end{aligned}$$ + +Where $\theta$ is the liquid-tube contact angle, +and we are neglecting variations of the height $h$ due to the curvature +(i.e. the [meniscus](/know/concept/meniscus/)). +By isolating the above equation for $h$, +we arrive at **Jurin's law**, +which predicts the height climbed by a liquid in a tube with radius $R$: + +$$\begin{aligned} + \boxed{ + h + = 2 \frac{L_c^2}{R} \cos\theta + } +\end{aligned}$$ + +Depending on $\theta$, $h$ can be negative, +i.e. the liquid might descend below the ambient level. + + +An alternative derivation of Jurin's law balances the forces instead of the pressures. +On the right, we have the gravitational force +(i.e. the energy-per-distance to lift the liquid), +and on the left, the surface tension force +(i.e. the energy-per-distance of the liquid-tube interface): + +$$\begin{aligned} + \pi R^2 \rho g h + \approx 2 \pi R (\alpha_{sg} - \alpha_{sl}) +\end{aligned}$$ + +Where $\alpha_{sg}$ and $\alpha_{sl}$ are the energy costs +of the solid-gas and solid-liquid interfaces. +Thanks to the [Young-Dupré relation](/know/concept/young-dupre-relation/), +we can rewrite this as follows: + +$$\begin{aligned} + R \rho g h + = 2 \alpha \cos\theta +\end{aligned}$$ + +Isolating this for $h$ simply yields Jurin's law again, as expected. + + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/cauchy-principal-value/index.md b/source/know/concept/cauchy-principal-value/index.md new file mode 100644 index 0000000..fec0826 --- /dev/null +++ b/source/know/concept/cauchy-principal-value/index.md @@ -0,0 +1,52 @@ +--- +title: "Cauchy principal value" +date: 2021-11-01 +categories: +- Mathematics +layout: "concept" +--- + +The **Cauchy principal value** $\mathcal{P}$, +or just **principal value**, +is a method for integrating problematic functions, +i.e. functions with singularities, +whose integrals would otherwise diverge. + +Consider a function $f(x)$ with a singularity at some finite $x = b$, +which is hampering attempts at integrating it. +To resolve this, we define the Cauchy principal value $\mathcal{P}$ as follows: + +$$\begin{aligned} + \boxed{ + \mathcal{P} \int_a^c f(x) \dd{x} + = \lim_{\varepsilon \to 0^{+}} \!\bigg( \int_a^{b - \varepsilon} f(x) \dd{x} + \int_{b + \varepsilon}^c f(x) \dd{x} \bigg) + } +\end{aligned}$$ + +If $f(x)$ instead has a singularity at postive infinity $+\infty$, +then we define $\mathcal{P}$ as follows: + +$$\begin{aligned} + \boxed{ + \mathcal{P} \int_{a}^\infty f(x) \dd{x} + = \lim_{c \to \infty} \!\bigg( \int_{a}^c f(x) \dd{x} \bigg) + } +\end{aligned}$$ + +And analogously for $-\infty$. +If $f(x)$ has singularities both at $+\infty$ and at $b$, +then we simply combine the two previous cases, +such that $\mathcal{P}$ is given by: + +$$\begin{aligned} + \mathcal{P} \int_{a}^\infty f(x) \:dx + = \lim_{c \to \infty} \lim_{\varepsilon \to 0^{+}} + \!\bigg( \int_{a}^{b - \varepsilon} f(x) \:dx + \int_{b + \varepsilon}^{c} f(x) \:dx \bigg) +\end{aligned}$$ + +And so on, until all problematic singularities have been dealt with. + +In some situations, for example involving +the [Sokhotski-Plemelj theorem](/know/concept/sokhotski-plemelj-theorem/), +the symbol $\mathcal{P}$ is written without an integral, +in which case the calculations are implicitly integrated. diff --git a/source/know/concept/cauchy-strain-tensor/index.md b/source/know/concept/cauchy-strain-tensor/index.md new file mode 100644 index 0000000..b5840e7 --- /dev/null +++ b/source/know/concept/cauchy-strain-tensor/index.md @@ -0,0 +1,325 @@ +--- +title: "Cauchy strain tensor" +date: 2021-03-31 +categories: +- Physics +- Continuum physics +layout: "concept" +--- + +**Strain** quantifies the deformation of a solid object. +If the body has been deformed, e.g. by pulling or bending, +its constituent particles have moved a bit. +Let $\va{X}$ be the original location of a particle, +and $\va{x}$ its new location after the deformation. +We can thus define the **displacement field** $\va{u}$: + +$$\begin{aligned} + \va{u} + \equiv \va{x} - \va{X} +\end{aligned}$$ + +We restrict ourselves to **infinitesimal strain**, +where $\va{u}$ is so tiny that the material's properties are unchanged, +and a **slowly-varying strain**, +where the particle's neighbourhood has been distorted, +but not completely changed. + +A key challenge when quantifying deformation +is that we need to somehow exclude movements of the *entire* body: +for example, you can bend a twig in your hands while walking or dancing, +but we are only interested in the twig's shape change, +not in your movements. +The above definition of $\vu{u}$ includes both, +so we should be careful how we extract the strain from it. + + +## Definition + +We use the **Eulerian description** of deformation, +where the new position $\va{x}$ is the reference, +and the old position $\va{X}$ is expressed as a function of $\va{x}$: + +$$\begin{aligned} + \va{u}(\va{x}) + \equiv \va{x} - \va{X}(\va{x}) +\end{aligned}$$ + +Let us choose two nearby points in the deformed solid, +and call them $\va{x}$ and $\va{x} + \va{a}$, +where $\va{a}$ is a tiny vector pointing from one to the other. +Before the displacement, those points respectively had these positions, +where we define $\va{A}$ as the "old" version of $\va{a}$: + +$$\begin{aligned} + \va{X} = \va{X}(\va{x}) + \qquad + \va{X} + \va{A} = \va{X}(\va{x} + \va{a}) +\end{aligned}$$ + +Because the new positions $\va{x}$ are our reference, +we would like to write $\va{A}$ without $\va{X}$. +To do so, we use the definition of $\va{u}(\va{x})$, yielding: + +$$\begin{aligned} + \va{A} + &= \va{X}(\va{x} + \va{a}) - \va{X}(\va{x}) + \\ + &= \big( \va{x} + \va{a} - \va{u}(\va{x} + \va{a}) \big) - \big( \va{x} - \va{u}(\va{x}) \big) + \\ + &= \va{a} - \va{u}(\va{x} + \va{a}) - \va{u}(\va{x}) +\end{aligned}$$ + +Using the fact that $\va{a}$ is tiny by definition, +we expand the middle term to first order in $\va{a}$: + +$$\begin{aligned} + \va{u}(\va{x} + \va{a}) + \approx \va{u}(\va{x}) + a_x \pdv{\va{u}}{x} + a_y \pdv{\va{u}}{y} + a_z \pdv{\va{u}}{z} + = \va{u}(\va{x}) + (\va{a} \cdot \nabla) \va{u}(\va{x}) +\end{aligned}$$ + +With this, we can now define the "shift" $\delta\va{a}$ +as the difference between $\va{a}$ and $\va{A}$ like so: + +$$\begin{aligned} + \delta{\va{a}} + \equiv \va{a} - \va{A} + = (\va{a} \cdot \nabla) \va{u}(\va{x}) +\end{aligned}$$ + +In index notation, we write this expression as follows, +with $\nabla_j \equiv \ipdv{}{x_j}$ simply being the partial derivative +with respect to the $j$th coordinate: + +$$\begin{aligned} + \delta a_i + = \sum_{j} a_j \nabla_j u_i +\end{aligned}$$ + +Where $\nabla_j u_i$ are called the **displacement gradients**, +and are just one step away from the desired definition of strain. +Note that these gradients are dimensionless, +so we can more formally define a *slowly-varying* displacement $\va{u}(\va{x})$ +as one where $|\nabla_j u_i| \ll 1$. + +Now, to solve the problem of macroscopic movements, +we take another tiny vector $\va{b}$ starting in the same point $\va{x}$ as $\va{a}$. +Here is the trick: if the whole body is uniformly translated or rotated, +the scalar product $\va{a} \cdot \va{b}$ is unchanged, +but if there is a non-uniform distortion, it changes. +We thus define the scalar product's difference like so: + +$$\begin{aligned} + \delta(\va{a} \cdot \va{b}) + \equiv \va{a} \cdot \va{b} - \va{A} \cdot \va{B} +\end{aligned}$$ + +Where $\va{B}$ is the old version of $\va{b}$. +Since these vectors are all tiny, we apply the product rule: + +$$\begin{aligned} + \delta(\va{a} \cdot \va{b}) + &= \delta\va{a} \cdot \va{b} + \va{a} \cdot \delta\va{b} +\end{aligned}$$ + +It is more informative to switch to index notation here. +Inserting $\delta\va{a}$ and $\delta\va{b}$ yields: + +$$\begin{aligned} + \delta(\va{a} \cdot \va{b}) + &= \sum_{i} \delta{a}_i \: b_i + \sum_{i} \delta{b}_i \: a_i + \\ + &= \sum_{ij} \nabla_j u_i \: a_j b_i + \sum_{ij} \nabla_j u_i \: a_i b_j + \\ + &= \sum_{ij} \big( \nabla_i u_j + \nabla_j u_i \big) \: a_i b_j +\end{aligned}$$ + +At last, we define the **Cauchy infinitesimal strain tensor** $\hat{u}$ +such that it has $u_{ij}$ as components: + +$$\begin{aligned} + \boxed{ + u_{ij} + \equiv \frac{1}{2} \big( \nabla_j u_i + \nabla_i u_j \big) + } +\end{aligned}$$ + +Which allows us to rewrite the shift of the scalar product in the following compact way: + +$$\begin{aligned} + \delta(\va{a} \cdot \va{b}) + &= 2 \sum_{ij} u_{ij} a_i b_j + = 2 \va{a} \cdot \hat{u} \cdot \va{b} +\end{aligned}$$ + +The Cauchy strain tensor $\hat{u}$ is a second-rank tensor, +and can alternatively be expressed like so: + +$$\begin{aligned} + \boxed{ + \hat{u} + \equiv \frac{1}{2} \big( \nabla \va{u} + (\nabla \va{u})^\top \big) + } +\end{aligned}$$ + +Where $\top$ is the transpose. Being defined from the scalar product, +all macroscopic movements of the body are removed from the tensor, +which turns out to make it symmetric, i.e. $u_{ij} = u_{ji}$. + + +## Geometry + +So far we have used Cartesian coordinates, +but we can choose any three vectors $\va{a}$, $\va{b}$ and $\va{c}$, +and **project** $\hat{u}$ onto this basis. +For example, the component $u_{ab}$ then becomes: + +$$\begin{aligned} + \boxed{ + u_{ab} + = \frac{\va{a} \cdot \hat{u} \cdot \va{b}}{\big|\va{a}\big| \big|\va{b}\big|} + } +\end{aligned}$$ + +And so forth, for the other eight components. +The basis in which $\hat{u}$ is diagonal is the one formed by its eigenvectors, +and their directions are the **principal axes of strain** +at that point in the solid. +Because $\hat{u}$ is symmetric, such a basis always exists. + +Given a vector $\va{a}$, its relative length change +due to the deformation is simply given by: + +$$\begin{aligned} + \boxed{ + \frac{\delta|\va{a}|}{|\va{a}|} + = u_{aa} + } +\end{aligned}$$ + +To find the angle change $\delta\theta$ +between two vectors $\va{a}$ and $\va{b}$, +we start with the product rule: + +$$\begin{aligned} + \delta(\va{a} \cdot \va{b}) + = \delta(\big|\va{a}\big| \big|\va{b}\big| \cos\theta) + = \delta\big|\va{a}\big| \big|\va{b}\big| \cos\theta + + \big|\va{a}\big| \delta\big|\va{b}\big| \cos\theta + - \big|\va{a}\big| \big|\va{b}\big| \sin\theta \: \delta\theta +\end{aligned}$$ + +We isolate this for $\delta\theta$, using the fact that +$\delta(\va{a} \cdot \va{b}) = 2 \big|\va{a}\big| \big|\va{b}\big| u_{ab}$ +thanks to the projection $u_{ab}$: + +$$\begin{aligned} + \delta\theta + = \frac{\delta\big|\va{a}\big| \big|\va{b}\big| \cos\theta + + \big|\va{a}\big| \delta\big|\va{b}\big| \cos\theta + - 2 \big|\va{a}\big| \big|\va{b}\big| u_{ab}} + {\big|\va{a}\big| \big|\va{b}\big| \sin\theta} +\end{aligned}$$ + +By recognizing the length change $\delta|\va{a}|/|\va{a}| = u_{aa}$, +we arrive at the following expression: + +$$\begin{aligned} + \boxed{ + \delta\theta + = \frac{(u_{aa} + u_{bb}) \cos\theta - u_{ab}}{\sin\theta} + } +\end{aligned}$$ + +Now, everything so far has been about tiny vectors, +so the change of the line element $\dd{\va{l}}$ +is easy to express using the displacement field $\va{u}$: + +$$\begin{aligned} + \boxed{ + \delta(\dd{\va{l}}) + = (\dd{\va{l}} \cdot \nabla) \va{u} + } +\end{aligned}$$ + +Next, we calculate the change of the differential volume element $\dd{V}$ +by treating it as the volume of a tiny parallelepiped +spanned by $\va{a}$, $\va{b}$ and $\va{c}$: + +$$\begin{aligned} + \delta(\dd{V}) + = \delta(\va{a} \cross \va{b} \cdot \va{c}) + &= \delta\va{a} \cross \va{b} \cdot \va{c} + \va{a} \cross \delta\va{b} \cdot \va{c} + \va{a} \cross \va{b} \cdot \delta\va{c} + \\ + &= (\va{a} \cdot \nabla) \va{u} \cross \va{b} \cdot \va{c} + + \va{a} \cross (\va{b} \cdot \nabla )\va{u} \cdot \va{c} + + \va{a} \cross \va{b} \cdot (\va{c} \cdot \nabla) \va{u} +\end{aligned}$$ + +We can reorder the factors like so +(write it out in index notation if you are not convinced): + +$$\begin{aligned} + \delta(\dd{V}) + &= (\va{a} \cdot \nabla) \va{u} \cross \va{b} \cdot \va{c} + + (\va{b} \cdot \nabla) \va{a} \cross \va{u} \cdot \va{c} + + (\va{c} \cdot \nabla) \va{a} \cross \va{b} \cdot \va{u} +\end{aligned}$$ + +By applying a couple of vector identities, +we can rewrite this more compactly as follows: + +$$\begin{aligned} + \delta(\dd{V}) + &= \Big( \va{b} \cross \va{c} (\va{a} \cdot \nabla) \cross \va{b} + + \va{c} \cross \va{a} (\va{b} \cdot \nabla) + + \va{a} \cross \va{b} (\va{c} \cdot \nabla) \Big) \cdot \va{u} + \\ + &= (\va{a} \cross \va{b} \cdot \va{c}) (\nabla \cdot \va{u}) +\end{aligned}$$ + +Here, we recognize the definition of $\dd{V}$, +leading to the following infinitesimal volume change: + +$$\begin{aligned} + \boxed{ + \delta(\dd{V}) + = \nabla \cdot \va{u} \dd{V} + } +\end{aligned}$$ + +Finally, for the surface element $\dd{\va{S}} = \va{a} \cross \va{b}$, +we use that the volume element $\dd{V} = \va{c} \cdot \dd{\va{S}}$: + +$$\begin{aligned} + \delta(\dd{V}) + = \delta(\va{c} \cdot \dd{\va{S}}) + = \delta\va{c} \cdot \dd{\va{S}} + \va{c} \cdot \delta(\dd{\va{S}}) + = (\va{c} \cdot \nabla) \va{u} \cdot \dd{\va{S}} + \va{c} \cdot \delta(\dd{\va{S}}) +\end{aligned}$$ + +By comparing this to the previous result for $\delta(\dd{V})$, +we arrive at the following equation: + +$$\begin{aligned} + \nabla \cdot \va{u} (\va{c} \cdot \dd{\va{S}}) + = (\va{c} \cdot \nabla) \va{u} \cdot \dd{\va{S}} + \va{c} \cdot \delta(\dd{\va{S}}) +\end{aligned}$$ + +Since $\va{c}$ is dot-multiplied at the front of each term, +we remove it, and isolate the rest for $\delta(\dd{\va{S}})$: + +$$\begin{aligned} + \boxed{ + \delta(\dd{\va{S}}) + = \big( (\nabla \cdot \va{u}) \hat{1} - \nabla \va{u} \big) \cdot \dd{\va{S}} + } +\end{aligned}$$ + + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/cauchy-stress-tensor/index.md b/source/know/concept/cauchy-stress-tensor/index.md new file mode 100644 index 0000000..c56d997 --- /dev/null +++ b/source/know/concept/cauchy-stress-tensor/index.md @@ -0,0 +1,238 @@ +--- +title: "Cauchy stress tensor" +date: 2021-03-31 +categories: +- Physics +- Continuum physics +layout: "concept" +--- + +Roughly speaking, **stress** is the solid equivalent of fluid pressure: +it describes the net force acting on an imaginary partition surface inside a solid. +However, unlike fluids at rest, +where the pressure is always perpendicular to such a surface, +solid stress is usually much more complicated. + +Formally, the concept of stress can be applied to any continuum +(not just solids), including fluids, +but it is arguably most intuitive for solids. + + +## Definition + +In the solid, imagine an infinitesimal cube +whose sides, $\dd{S}_x$, $\dd{S}_y$ and $\dd{S}_z$, +are orthogonal to the $x$, $y$ and $z$ axes, respectively. +There is a force $\dd{\va{F}}_1$ acting on $\dd{S}_x$, +$\dd{\va{F}}_2$ on $\dd{S}_y$, and $\dd{\va{F}}_3$ on $\dd{S}_z$. +Then we can decompose each of these forces, for example: + +$$\begin{aligned} + \dd{\va{F}}_1 + = \va{e}_x F_{x1} + \va{e}_y F_{y1} + \va{e}_z F_{z1} +\end{aligned}$$ + +Where $\va{e}_x$, $\va{e}_y$ and $\va{e}_z$ are the basis unit vectors. +If we divide each of the force components by the area $\dd{S}_x$ +(like in a fluid, in order to get the pressure), +we find the stresses $\sigma_{xx}$, $\sigma_{yx}$ and $\sigma_{zx}$ +that are being "felt" by the $x$ surface element $\dd{S}_x$: + +$$\begin{aligned} + \dd{\va{F}}_1 + = \big( \va{e}_x \sigma_{xx} + \va{e}_y \sigma_{yx} + \va{e}_z \sigma_{zx} \big) \dd{S}_x +\end{aligned}$$ + +The perpendicular component $\sigma_{xx}$ is called a **tensile stress**, +and its sign is always chosen so that a positive value corresponds to a tension, +i.e. the $x$-side is pulled away from the rest of the cube. +The tangential components $\sigma_{yx}$ and $\sigma_{zx}$ +are called **shear stresses**. + +Evidently, the other two forces $\dd{\va{F}}_2$ and $\dd{\va{F}}_3$ +can be decomposed in the exact same way, +yielding nine stress components in total: + +$$\begin{aligned} + \dd{\va{F}}_2 + &= \va{e}_x F_{x2} + \va{e}_y F_{y2} + \va{e}_z F_{z2} + = \big( \va{e}_x \sigma_{xy} + \va{e}_y \sigma_{yy} + \va{e}_z \sigma_{zy} \big) \dd{S}_y + \\ + \dd{\va{F}}_3 + &= \va{e}_x F_{x3} + \va{e}_y F_{y3} + \va{e}_z F_{z3} + = \big( \va{e}_x \sigma_{xz} + \va{e}_y \sigma_{yz} + \va{e}_z \sigma_{zz} \big) \dd{S}_z +\end{aligned}$$ + +The total force $\dd{\va{F}}$ on the entire infinitesimal cube +is simply the sum of the previous three: + +$$\begin{aligned} + \dd{\va{F}} + = \dd{\va{F}}_1 + \dd{\va{F}}_2 + \dd{\va{F}}_3 +\end{aligned}$$ + +We can then decompose $\dd{\va{F}}$ into its net components +along the $x$, $y$ and $z$ axes: + +$$\begin{aligned} + \dd{\va{F}} + = \va{e}_x \dd{F}_x + \va{e}_y \dd{F}_y + \va{e}_z \dd{F}_z +\end{aligned}$$ + +From the preceding equations, we find that these components are given by: + +$$\begin{aligned} + \dd{F}_x + &= \sigma_{xx} \dd{S}_x + \sigma_{xy} \dd{S}_y + \sigma_{xz} \dd{S}_z + \\ + \dd{F}_y + &= \sigma_{yx} \dd{S}_x + \sigma_{yy} \dd{S}_y + \sigma_{yz} \dd{S}_z + \\ + \dd{F}_z + &= \sigma_{zx} \dd{S}_x + \sigma_{zy} \dd{S}_y + \sigma_{zz} \dd{S}_z +\end{aligned}$$ + +We can write this much more compactly using index notation, +where $i, j \in \{x, y, z\}$: + +$$\begin{aligned} + \boxed{ + \dd{F}_i + = \sum_{j} \sigma_{ij} \dd{S}_j + } +\end{aligned}$$ + +The stress components $\sigma_{ij}$ can be written as a second-rank tensor +(i.e. a matrix that transforms in a certain way), +called the **Cauchy stress tensor** $\hat{\sigma}$: + +$$\begin{aligned} + \boxed{ + \hat{\sigma} \equiv + \{ \sigma_{ij} \} = + \begin{pmatrix} + \sigma_{xx} & \sigma_{xy} & \sigma_{xz} \\ + \sigma_{yx} & \sigma_{yy} & \sigma_{yz} \\ + \sigma_{zx} & \sigma_{zy} & \sigma_{zz} + \end{pmatrix} + } +\end{aligned}$$ + +Then $\dd{\va{F}}$ is written even more compactly +using the dot product, with $\dd{\va{S}} = (\dd{S}_x, \dd{S}_y, \dd{S}_z)$: + +$$\begin{aligned} + \boxed{ + \dd{\va{F}} + = \hat{\sigma} \cdot \dd{\va{S}} + } +\end{aligned}$$ + +All forces on the cube's sides can be written in this form. +**Cauchy's stress theorem** states that the force on *any* +surface element inside the solid can be written like this, +simply by projecting it onto the $x$, $y$ and $z$ zero-planes +to get the areas $\dd{S}_x$, $\dd{S}_y$ and $\dd{S}_z$. + +Note that for fluids, the pressure $p$ was defined +such that $\dd{\va{F}} = - p \dd{\va{S}}$. +If we wanted to define $p$ for solids in the same way, +we would need $\hat{\sigma}$ to be diagonal *and* +all of its diagonal elements to be identical. +Since this is almost never the case, +the scalar pressure is ill-defined in solids. + + +## Equilibrium + +The total force $\va{F}$ acting on a (non-infinitesimal) volume $V$ of the solid +is given by the sum of the total body force $\va{F}_b$ and total surface force $\va{F}_s$, +where $\vec{f}$ is the body force density: + +$$\begin{aligned} + \va{F} + = \va{F}_b + \va{F}_s + = \int_V \va{f} \dd{V} + \oint_S \hat{\sigma} \cdot \dd{\va{S}} +\end{aligned}$$ + +We can rewrite the surface term using the divergence theorem, +where $\top$ is the transpose: + +$$\begin{aligned} + \va{F}_s + = \oint_S \hat{\sigma} \cdot \dd{\va{S}} + = \int_V \nabla \cdot \hat{\sigma}^{\top} \dd{V} +\end{aligned}$$ + +For some people, this equation may be more enlightening in index notation, +where $\nabla_j \equiv \ipdv{}{x_j}$ is the partial derivative with respect to the $j$th coordinate: + +$$\begin{aligned} + F_{s, i} + = \oint_S \sum_j \sigma_{ij} \dd{S_j} + = \int_V \sum_{j} \nabla_{\!j} \sigma_{ij} \dd{V} +\end{aligned}$$ + +In any case, the total force $\va{F}$ can then be expressed +as a single volume integral over $V$: + +$$\begin{aligned} + \va{F} + = \int_V \va{f} \dd{V} + \int_V \nabla \cdot \hat{\sigma}^{\top} \dd{V} + = \int_V \va{f^*} \dd{V} +\end{aligned}$$ + +Where we have defined the **effective force density** $\va{f^*}$ as follows: + +$$\begin{aligned} + \boxed{ + \va{f^*} + = \va{f} + \nabla \cdot \hat{\sigma}^{\top} + } +\end{aligned}$$ + +The volume $V$ is in **mechanical equilibrium** if the net force acting on it amounts to zero: + +$$\begin{aligned} + \va{F} + = 0 +\end{aligned}$$ + +However, because $V$ is abritrary, the equilibrium condition for the whole solid is in fact: + +$$\begin{aligned} + \boxed{ + \va{f^*} + = 0 + } +\end{aligned}$$ + +This is reminiscent of the equilibrium condition of a fluid +(see [hydrostatic pressure](/know/concept/hydrostatic-pressure/)). +Note that it is a set of coupled differential equations, +which needs boundary conditions at the object's surface. +Newton's third law states that the two sides of the boundary +exert opposite forces on each other, +so the boundary condition is continuity of the **stress vector** +$\hat{\sigma} \cdot \va{n}$: + +$$\begin{aligned} + \boxed{ + \hat{\sigma}_{\mathrm{outer}} \cdot \va{n} + = - \hat{\sigma}_{\mathrm{inner}} \cdot \va{n} + } +\end{aligned}$$ + +Where the normal of the outer surface is $\va{n}$, +and the normal of the inner surface is $-\va{n}$. +Note that the above equation does *not* mean +that $-\hat{\sigma}_{\mathrm{inner}}$ equals $\hat{\sigma}_{\mathrm{outer}}$: +the tensors are allowed to be very different, +as long as the stress vector's three components are equal. + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. + diff --git a/source/know/concept/cavitation/index.md b/source/know/concept/cavitation/index.md new file mode 100644 index 0000000..95822ae --- /dev/null +++ b/source/know/concept/cavitation/index.md @@ -0,0 +1,113 @@ +--- +title: "Cavitation" +date: 2021-04-09 +categories: +- Physics +- Fluid mechanics +- Fluid dynamics +layout: "concept" +--- + +In a liquid, **cavitation** is the spontaneous appearance of bubbles, +occurring when the pressure in a part of the liquid drops +below its vapour pressure, e.g. due to the fast movements. +When such a bubble is subjected to a higher pressure +by the surrounding liquid, it quickly implodes. + +To model this case, we use the simple form of +the [Rayleigh-Plesset equation](/know/concept/rayleigh-plesset-equation/) +for an inviscid liquid without surface tension. +Note that the RP equation assumes incompressibility. + +We assume that the whole liquid is at a constant pressure $p_\infty$, +and the bubble is empty, such that the interface pressure $P = 0$, +meaning $\Delta p = - p_\infty$. +At first, the radius is stationary $R'(0) = 0$, +and given by a constant $R(0) = a$. +The simple Rayleigh-Plesset equation is then: + +$$\begin{aligned} + R \dvn{2}{R}{t} + \frac{3}{2} \bigg( \dv{R}{t} \bigg)^2 + = - \frac{p_\infty}{\rho} +\end{aligned}$$ + +To solve it, we multiply both sides by $R^2 R'$ +and rewrite it in the following way: + +$$\begin{aligned} + - 2 \frac{p_\infty}{\rho} R^2 R' + &= 2 R^3 R' R'' + 3 R^2 (R')^3 + \\ + - \frac{2 p_\infty}{3 \rho} \dv{}{t}\Big( R^3 \Big) + &= \dv{}{t}\Big( R^3 (R')^2 \Big) +\end{aligned}$$ + +It is then straightforward to integrate both sides +with respect to time $\tau$, from $0$ to $t$: + +$$\begin{aligned} + - \frac{2 p_\infty}{3 \rho} \int_0^t \dv{}{\tau}\Big( R^3 \Big) \dd{\tau} + &= \int_0^t \dv{}{\tau}\Big( R^3 (R')^2 \Big) \dd{\tau} + \\ + - \frac{2 p_\infty}{3 \rho} \Big[ R^3 \Big]_0^t + &= \Big[ R^3 (R')^2 \Big]_0^t + \\ + - \frac{2 p_\infty}{3 \rho} \Big( R^3(t) - a^3 \Big) + &= \Big( R^3(t) \: \big(R'(t)\big)^2 \Big) +\end{aligned}$$ + +Rearranging this equation yields the following expression +for the derivative $R'$: + +$$\begin{aligned} + (R')^2 + = \frac{2 p_\infty}{3 \rho} \Big( \frac{a^3}{R^3} - 1 \Big) +\end{aligned}$$ + +This equation is nasty to integrate. +The trick is to invert $R(t)$ into $t(R)$, +and, because we are only interested in collapse, +we just need to consider the case $R' < 0$. +The time of a given radius $R$ is then as follows, +where we are using slightly sloppy notation: + +$$\begin{aligned} + t + = \int_0^t \dd{\tau} + = - \int_{a}^{R} \frac{\dd{R}}{R'} + = \int_{R}^{a} \frac{\dd{R}}{R'} +\end{aligned}$$ + +The minus comes from the constraint that $R' < 0$, but $t \ge 0$. +We insert the expression for $R'$: + +$$\begin{aligned} + t + = \sqrt{\frac{3 \rho}{2 p_\infty}} \int_{R}^{a} \Bigg( \sqrt{ \frac{a^3}{R^3} - 1 } \Bigg)^{-1} \dd{R} + = \sqrt{\frac{3 \rho a^2}{2 p_\infty}} \int_{R/a}^{1} \frac{1}{\sqrt{x^{-3} - 1}} \dd{x} +\end{aligned}$$ + +This integral needs to be looked up, +and involves the hypergeometric function ${}_2 F_1$. +However, we only care about *collapse*, which is when $R = 0$. +The time $t_0$ at which this occurs is: + +$$\begin{aligned} + t_0 + = \sqrt{\frac{3 \rho a^2}{2 p_\infty}} \sqrt{\frac{3 \pi}{2}} \frac{\Gamma(5/6)}{\Gamma(1/3)} + \approx \sqrt{\frac{3 \rho a^2}{2 p_\infty}} 0.915 \:\mathrm{s} +\end{aligned}$$ + +With our assumptions, a bubble will always collapse. +However, unsurprisingly, reality turns out to be more complicated: +as $R \to 0$, the interface velocity $R' \to \infty$. +By looking at the derivation of the Rayleigh-Plesset equation, +it can be shown that the pressure just outside the bubble diverges due to $R'$. +This drastically changes the liquid's properties, and breaks our assumptions. + + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/central-limit-theorem/index.md b/source/know/concept/central-limit-theorem/index.md new file mode 100644 index 0000000..126ff3b --- /dev/null +++ b/source/know/concept/central-limit-theorem/index.md @@ -0,0 +1,203 @@ +--- +title: "Central limit theorem" +date: 2021-03-09 +categories: +- Statistics +- Mathematics +layout: "concept" +--- + +In statistics, the **central limit theorem** states that +the sum of many independent variables tends towards a normal distribution, +even if the individual variables $x_n$ follow different distributions. + +For example, by taking $M$ samples of size $N$ from a population, +and calculating $M$ averages $\mu_m$ (which involves summing over $N$), +the resulting means $\mu_m$ are normally distributed +across the $M$ samples if $N$ is sufficiently large. + +More formally, for $N$ independent variables $x_n$ with probability distributions $p(x_n)$, +the central limit theorem states the following, +where we define the sum $S$: + +$$\begin{aligned} + S = \sum_{n = 1}^N x_n + \qquad + \mu_S = \sum_{n = 1}^N \mu_n + \qquad + \sigma_S^2 = \sum_{n = 1}^N \sigma_n^2 +\end{aligned}$$ + +And crucially, it states that the probability distribution $p_N(S)$ of $S$ for $N$ variables +will become a normal distribution when $N$ goes to infinity: + +$$\begin{aligned} + \boxed{ + \lim_{N \to \infty} \!\big(p_N(S)\big) + = \frac{1}{\sigma_S \sqrt{2 \pi}} \exp\!\Big( -\frac{(\mu_S - S)^2}{2 \sigma_S^2} \Big) + } +\end{aligned}$$ + +We prove this below, +but first we need to introduce some tools. +Given a probability density $p(x)$, its [Fourier transform](/know/concept/fourier-transform/) +is called the **characteristic function** $\phi(k)$: + +$$\begin{aligned} + \phi(k) = \int_{-\infty}^\infty p(x) \exp(i k x) \dd{x} +\end{aligned}$$ + +Note that $\phi(k)$ can be interpreted as the average of $\exp(i k x)$. +We take its Taylor expansion in two separate ways, +where an overline denotes the mean: + +$$\begin{aligned} + \phi(k) + = \sum_{n = 0}^\infty \frac{k^n}{n!} \: \phi^{(n)}(0) + \qquad + \phi(k) + = \overline{\exp(i k x)} = \sum_{n = 0}^\infty \frac{(ik)^n}{n!} \overline{x^n} +\end{aligned}$$ + +By comparing the coefficients of these two power series, +we get a useful relation: + +$$\begin{aligned} + \phi^{(n)}(0) = i^n \: \overline{x^n} +\end{aligned}$$ + +Next, the **cumulants** $C^{(n)}$ are defined from the Taylor expansion of $\ln\!\big(\phi(k)\big)$: + +$$\begin{aligned} + \ln\!\big( \phi(k) \big) + = \sum_{n = 1}^\infty \frac{(ik)^n}{n!} C^{(n)} + \quad \mathrm{where} \quad + C^{(n)} = \frac{1}{i^n} \: \dvn{n}{}{k} \Big(\ln\!\big(\phi(k)\big)\Big) \Big|_{k = 0} +\end{aligned}$$ + +The first two cumulants $C^{(1)}$ and $C^{(2)}$ are of particular interest, +since they turn out to be the mean and the variance respectively, +using our earlier relation: + +$$\begin{aligned} + C^{(1)} + &= - i \dv{}{k} \Big(\ln\!\big(\phi(k)\big)\Big) \Big|_{k = 0} + = - i \frac{\phi'(0)}{\exp(0)} + = \overline{x} + \\ + C^{(2)} + &= - \dvn{2}{}{k} \Big(\ln\!\big(\phi(k)\big)\Big) \Big|_{k = 0} + = \frac{\big(\phi'(0)\big)^2}{\exp(0)^2} - \frac{\phi''(0)}{\exp(0)} + = - \overline{x}^2 + \overline{x^2} = \sigma^2 +\end{aligned}$$ + +Let us now define $S$ as the sum of $N$ independent variables $x_n$, in other words: + +$$\begin{aligned} + S = \sum_{n = 1}^N x_n = x_1 + x_2 + ... + x_N +\end{aligned}$$ + +The probability density of $S$ is then as follows, where $p(x_n)$ are +the densities of all the individual variables and $\delta$ is +the [Dirac delta function](/know/concept/dirac-delta-function/): + +$$\begin{aligned} + p(S) + &= \int\cdots\int_{-\infty}^\infty \Big( \prod_{n = 1}^N p(x_n) \Big) \: \delta\Big( S - \sum_{n = 1}^N x_n \Big) \dd{x_1} \cdots \dd{x_N} + \\ + &= \Big( p_1 * \big( p_2 * ( ... * (p_N * \delta))\big)\Big)(S) +\end{aligned}$$ + +In other words, the integrals pick out all combinations of $x_n$ which +add up to the desired $S$-value, and multiply the probabilities +$p(x_1) p(x_2) \cdots p(x_N)$ of each such case. This is a convolution, +so the [convolution theorem](/know/concept/convolution-theorem/) +states that it is a product in the Fourier domain: + +$$\begin{aligned} + \phi_S(k) = \prod_{n = 1}^N \phi_n(k) +\end{aligned}$$ + +By taking the logarithm of both sides, the product becomes a sum, +which we further expand: + +$$\begin{aligned} + \ln\!\big(\phi_S(k)\big) + = \sum_{n = 1}^N \ln\!\big(\phi_n(k)\big) + = \sum_{n = 1}^N \sum_{m = 1}^{\infty} \frac{(ik)^m}{m!} C_n^{(m)} +\end{aligned}$$ + +Consequently, the cumulants $C^{(m)}$ stack additively for the sum $S$ +of independent variables $x_m$, and therefore +the means $C^{(1)}$ and variances $C^{(2)}$ do too: + +$$\begin{aligned} + C_S^{(m)} = \sum_{n = 1}^N C_n^{(m)} = C_1^{(m)} + C_2^{(m)} + ... + C_N^{(m)} +\end{aligned}$$ + +We now introduce the scaled sum $z$ as the new combined variable: + +$$\begin{aligned} + z = \frac{S}{\sqrt{N}} = \frac{1}{\sqrt{N}} (x_1 + x_2 + ... + x_N) +\end{aligned}$$ + +Its characteristic function $\phi_z(k)$ is then as follows, +with $\sqrt{N}$ appearing in the arguments of $\phi_n$: + +$$\begin{aligned} + \phi_z(k) + &= \int\cdots\int + \Big( \prod_{n = 1}^N p(x_n) \Big) \: \delta\Big( z - \frac{1}{\sqrt{N}} \sum_{n = 1}^N x_n \Big) \exp(i k z) + \dd{x_1} \cdots \dd{x_N} + \\ + &= \int\cdots\int + \Big( \prod_{n = 1}^N p(x_n) \Big) \exp\!\Big( i \frac{k}{\sqrt{N}} \sum_{n = 1}^N x_n \Big) + \dd{x_1} \cdots \dd{x_N} + \\ + &= \prod_{n = 1}^N \phi_n\Big(\frac{k}{\sqrt{N}}\Big) +\end{aligned}$$ + +By expanding $\ln\!\big(\phi_z(k)\big)$ in terms of its cumulants $C^{(m)}$ +and introducing $\kappa = k / \sqrt{N}$, we see that the higher-order terms +become smaller for larger $N$: + +$$\begin{gathered} + \ln\!\big( \phi_z(k) \big) + = \sum_{m = 1}^\infty \frac{(ik)^m}{m!} C^{(m)} + \\ + C^{(m)} + = \frac{1}{i^m} \dvn{m}{}{k} \sum_{n = 1}^N \ln\!\bigg( \phi_n\Big(\frac{k}{\sqrt{N}}\Big) \bigg) + = \frac{1}{i^m N^{m/2}} \dvn{m}{}{\kappa} \sum_{n = 1}^N \ln\!\big( \phi_n(\kappa) \big) +\end{gathered}$$ + +For sufficiently large $N$, we can therefore approximate it using just the first two terms: + +$$\begin{aligned} + \ln\!\big( \phi_z(k) \big) + &\approx i k C^{(1)} - \frac{k^2}{2} C^{(2)} + = i k \overline{z} - \frac{k^2}{2} \sigma_z^2 + \\ + \phi_z(k) + &\approx \exp(i k \overline{z}) \exp(- k^2 \sigma_z^2 / 2) +\end{aligned}$$ + +We take its inverse Fourier transform to get the density $p(z)$, +which turns out to be a Gaussian normal distribution, +which is even already normalized: + +$$\begin{aligned} + p(z) + = \hat{\mathcal{F}}^{-1} \{\phi_z(k)\} + &= \frac{1}{2 \pi} \int_{-\infty}^\infty \exp\!\big(\!-\! i k (z - \overline{z})\big) \exp(- k^2 \sigma_z^2 / 2) \dd{k} + \\ + &= \frac{1}{\sqrt{2 \pi \sigma_z^2}} \exp\!\Big(\!-\! \frac{(z - \overline{z})^2}{2 \sigma_z^2} \Big) +\end{aligned}$$ + +Therefore, the sum of many independent variables tends to a normal distribution, +regardless of the densities of the individual variables. + + +## References +1. H. Gould, J. Tobochnik, + *Statistical and thermal physics*, 2nd edition, + Princeton. diff --git a/source/know/concept/conditional-expectation/index.md b/source/know/concept/conditional-expectation/index.md new file mode 100644 index 0000000..c545cef --- /dev/null +++ b/source/know/concept/conditional-expectation/index.md @@ -0,0 +1,172 @@ +--- +title: "Conditional expectation" +date: 2021-10-23 +categories: +- Mathematics +- Statistics +- Measure theory +- Stochastic analysis +layout: "concept" +--- + +Recall that the expectation value $\mathbf{E}[X]$ +of a [random variable](/know/concept/random-variable/) $X$ +is a function of the probability space $(\Omega, \mathcal{F}, P)$ +on which $X$ is defined, and the definition of $X$ itself. + +The **conditional expectation** $\mathbf{E}[X|A]$ +is the expectation value of $X$ given that an event $A$ has occurred, +i.e. only the outcomes $\omega \in \Omega$ +satisfying $\omega \in A$ should be considered. +If $A$ is obtained by observing a variable, +then $\mathbf{E}[X|A]$ is a random variable in its own right. + +Consider two random variables $X$ and $Y$ +on the same probability space $(\Omega, \mathcal{F}, P)$, +and suppose that $\Omega$ is discrete. +If $Y = y$ has been observed, +then the conditional expectation of $X$ +given the event $Y = y$ is as follows: + +$$\begin{aligned} + \mathbf{E}[X | Y \!=\! y] + = \sum_{x} x \: Q(X \!=\! x) + \qquad \quad + Q(X \!=\! x) + = \frac{P(X \!=\! x \cap Y \!=\! y)}{P(Y \!=\! y)} +\end{aligned}$$ + +Where $Q$ is a renormalized probability function, +which assigns zero to all events incompatible with $Y = y$. +If we allow $\Omega$ to be continuous, +then from the definition $\mathbf{E}[X]$, +we know that the following Lebesgue integral can be used, +which we call $f(y)$: + +$$\begin{aligned} + \mathbf{E}[X | Y \!=\! y] + = f(y) + = \int_\Omega X(\omega) \dd{Q(\omega)} +\end{aligned}$$ + +However, this is only valid if $P(Y \!=\! y) > 0$, +which is a problem for continuous sample spaces $\Omega$. +Sticking with the assumption $P(Y \!=\! y) > 0$, notice that: + +$$\begin{aligned} + f(y) + = \frac{1}{P(Y \!=\! y)} \int_\Omega X(\omega) \dd{P(\omega \cap Y \!=\! y)} + = \frac{\mathbf{E}[X \cdot I(Y \!=\! y)]}{P(Y \!=\! y)} +\end{aligned}$$ + +Where $I$ is the indicator function, +equal to $1$ if its argument is true, and $0$ if not. +Multiplying the definition of $f(y)$ by $P(Y \!=\! y)$ then leads us to: + +$$\begin{aligned} + \mathbf{E}[X \cdot I(Y \!=\! y)] + &= f(y) \cdot P(Y \!=\! y) + \\ + &= \mathbf{E}[f(Y) \cdot I(Y \!=\! y)] +\end{aligned}$$ + +Recall that because $Y$ is a random variable, +$\mathbf{E}[X|Y] = f(Y)$ is too. +In other words, $f$ maps $Y$ to another random variable, +which, thanks to the *Doob-Dynkin lemma* +(see [random variable](/know/concept/random-variable/)), +means that $\mathbf{E}[X|Y]$ is measurable with respect to $\sigma(Y)$. +Intuitively, this makes sense: +$\mathbf{E}[X|Y]$ cannot contain more information about events +than the $Y$ it was calculated from. + +This suggests a straightforward generalization of the above: +instead of a specific value $Y = y$, +we can condition on *any* information from $Y$. +If $\mathcal{H} = \sigma(Y)$ is the information generated by $Y$, +then the conditional expectation $\mathbf{E}[X|\mathcal{H}] = Z$ +is $\mathcal{H}$-measurable, and given by a $Z$ satisfying: + +$$\begin{aligned} + \boxed{ + \mathbf{E}\big[X \cdot I(H)\big] + = \mathbf{E}\big[Z \cdot I(H)\big] + } +\end{aligned}$$ + +For any $H \in \mathcal{H}$. Note that $Z$ is almost surely unique: +*almost* because it could take any value +for an event $A$ with zero probability $P(A) = 0$. +Fortunately, if there exists a continuous $f$ +such that $\mathbf{E}[X | \sigma(Y)] = f(Y)$, +then $Z = \mathbf{E}[X | \sigma(Y)]$ is unique. + + +## Properties + +A conditional expectation defined in this way has many useful properties, +most notably linearity: +$\mathbf{E}[aX \!+\! bY | \mathcal{H}] = a \mathbf{E}[X|\mathcal{H}] + b \mathbf{E}[Y|\mathcal{H}]$ +for any $a, b \in \mathbb{R}$. + +The **tower property** states that if $\mathcal{F} \supset \mathcal{G} \supset \mathcal{H}$, +then $\mathbf{E}[\mathbf{E}[X|\mathcal{G}]|\mathcal{H}] = \mathbf{E}[X|\mathcal{H}]$. +Intuitively, this works as follows: +suppose person $G$ knows more about $X$ than person $H$, +then $\mathbf{E}[X | \mathcal{H}]$ is $H$'s expectation, +$\mathbf{E}[X | \mathcal{G}]$ is $G$'s "better" expectation, +and then $\mathbf{E}[\mathbf{E}[X|\mathcal{G}]|\mathcal{H}]$ +is $H$'s prediction about what $G$'s expectation will be. +However, $H$ does not have access to $G$'s extra information, +so $H$'s best prediction is simply $\mathbf{E}[X | \mathcal{H}]$. + +The **law of total expectation** says that +$\mathbf{E}[\mathbf{E}[X | \mathcal{G}]] = \mathbf{E}[X]$, +and follows from the above tower property +by choosing $\mathcal{H}$ to contain no information: +$\mathcal{H} = \{ \varnothing, \Omega \}$. + +Another useful property is that $\mathbf{E}[X | \mathcal{H}] = X$ +if $X$ is $\mathcal{H}$-measurable. +In other words, if $\mathcal{H}$ already contains +all the information extractable from $X$, +then we know $X$'s exact value. +Conveniently, this can easily be generalized to products: +$\mathbf{E}[XY | \mathcal{H}] = X \mathbf{E}[Y | \mathcal{H}]$ +if $X$ is $\mathcal{H}$-measurable: +since $X$'s value is known, it can simply be factored out. + +Armed with this definition of conditional expectation, +we can define other conditional quantities, +such as the **conditional variance** $\mathbf{V}[X | \mathcal{H}]$: + +$$\begin{aligned} + \mathbf{V}[X | \mathcal{H}] + = \mathbf{E}[X^2 | \mathcal{H}] - \big[\mathbf{E}[X | \mathcal{H}]\big]^2 +\end{aligned}$$ + +The **law of total variance** then states that +$\mathbf{V}[X] = \mathbf{E}[\mathbf{V}[X | \mathcal{H}]] + \mathbf{V}[\mathbf{E}[X | \mathcal{H}]]$. + +Likewise, we can define the **conditional probability** $P$, +**conditional distribution function** $F_{X|\mathcal{H}}$, +and **conditional density function** $f_{X|\mathcal{H}}$ +like their non-conditional counterparts: + +$$\begin{aligned} + P(A | \mathcal{H}) + = \mathbf{E}[I(A) | \mathcal{H}] + \qquad + F_{X|\mathcal{H}}(x) + = P(X \le x | \mathcal{H}) + \qquad + f_{X|\mathcal{H}}(x) + = \dv{F_{X|\mathcal{H}}}{x} +\end{aligned}$$ + + + +## References +1. U.H. Thygesen, + *Lecture notes on diffusions and stochastic differential equations*, + 2021, Polyteknisk Kompendie. diff --git a/source/know/concept/convolution-theorem/index.md b/source/know/concept/convolution-theorem/index.md new file mode 100644 index 0000000..d6c578b --- /dev/null +++ b/source/know/concept/convolution-theorem/index.md @@ -0,0 +1,116 @@ +--- +title: "Convolution theorem" +date: 2021-02-22 +categories: +- Mathematics +layout: "concept" +--- + +The **convolution theorem** states that a convolution in the direct domain +is equal to a product in the frequency domain. This is especially useful +for computation, replacing an $\mathcal{O}(n^2)$ convolution with an +$\mathcal{O}(n \log(n))$ transform and product. + +## Fourier transform + +The convolution theorem is usually expressed as follows, where +$\hat{\mathcal{F}}$ is the [Fourier transform](/know/concept/fourier-transform/), +and $A$ and $B$ are constants from its definition: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + A \cdot (f * g)(x) &= \hat{\mathcal{F}}{}^{-1}\{\tilde{f}(k) \: \tilde{g}(k)\} \\ + B \cdot (\tilde{f} * \tilde{g})(k) &= \hat{\mathcal{F}}\{f(x) \: g(x)\} + \end{aligned} + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-fourier"/> +<label for="proof-fourier">Proof</label> +<div class="hidden"> +<label for="proof-fourier">Proof.</label> +We expand the right-hand side of the theorem and +rearrange the integrals: + +$$\begin{aligned} + \hat{\mathcal{F}}{}^{-1}\{\tilde{f}(k) \: \tilde{g}(k)\} + &= B \int_{-\infty}^\infty \tilde{f}(k) \Big( A \int_{-\infty}^\infty g(x') \exp(i s k x') \dd{x'} \Big) \exp(-i s k x) \dd{k} + \\ + &= A \int_{-\infty}^\infty g(x') \Big( B \int_{-\infty}^\infty \tilde{f}(k) \exp(- i s k (x - x')) \dd{k} \Big) \dd{x'} + \\ + &= A \int_{-\infty}^\infty g(x') \: f(x - x') \dd{x'} + = A \cdot (f * g)(x) +\end{aligned}$$ + +Then we do the same again, +this time starting from a product in the $x$-domain: + +$$\begin{aligned} + \hat{\mathcal{F}}\{f(x) \: g(x)\} + &= A \int_{-\infty}^\infty f(x) \Big( B \int_{-\infty}^\infty \tilde{g}(k') \exp(- i s x k') \dd{k'} \Big) \exp(i s k x) \dd{x} + \\ + &= B \int_{-\infty}^\infty \tilde{g}(k') \Big( A \int_{-\infty}^\infty f(x) \exp(i s x (k - k')) \dd{x} \Big) \dd{k'} + \\ + &= B \int_{-\infty}^\infty \tilde{g}(k') \: \tilde{f}(k - k') \dd{k'} + = B \cdot (\tilde{f} * \tilde{g})(k) +\end{aligned}$$ +</div> +</div> + + +## Laplace transform + +For functions $f(t)$ and $g(t)$ which are only defined for $t \ge 0$, +the convolution theorem can also be stated using +the [Laplace transform](/know/concept/laplace-transform/): + +$$\begin{aligned} + \boxed{(f * g)(t) = \hat{\mathcal{L}}{}^{-1}\{\tilde{f}(s) \: \tilde{g}(s)\}} +\end{aligned}$$ + +Because the inverse Laplace transform $\hat{\mathcal{L}}{}^{-1}$ is +unpleasant, the theorem is often stated using the forward transform +instead: + +$$\begin{aligned} + \boxed{\hat{\mathcal{L}}\{(f * g)(t)\} = \tilde{f}(s) \: \tilde{g}(s)} +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-laplace"/> +<label for="proof-laplace">Proof</label> +<div class="hidden"> +<label for="proof-laplace">Proof.</label> +We expand the left-hand side. +Note that the lower integration limit is 0 instead of $-\infty$, +because we set both $f(t)$ and $g(t)$ to zero for $t < 0$: + +$$\begin{aligned} + \hat{\mathcal{L}}\{(f * g)(t)\} + &= \int_0^\infty \Big( \int_0^\infty g(t') f(t - t') \dd{t'} \Big) \exp(- s t) \dd{t} + \\ + &= \int_0^\infty \Big( \int_0^\infty f(t - t') \exp(- s t) \dd{t} \Big) g(t') \dd{t'} +\end{aligned}$$ + +Then we define a new integration variable $\tau = t - t'$, yielding: + +$$\begin{aligned} + \hat{\mathcal{L}}\{(f * g)(t)\} + &= \int_0^\infty \Big( \int_0^\infty f(\tau) \exp(- s (\tau + t')) \dd{\tau} \Big) g(t') \dd{t'} + \\ + &= \int_0^\infty \Big( \int_0^\infty f(\tau) \exp(- s \tau) \dd{\tau} \Big) g(t') \exp(- s t') \dd{t'} + \\ + &= \int_0^\infty \tilde{f}(s) \: g(t') \exp(- s t') \dd{t'} + = \tilde{f}(s) \: \tilde{g}(s) +\end{aligned}$$ +</div> +</div> + + + +## References +1. O. Bang, + *Applied mathematics for physicists: lecture notes*, 2019, + unpublished. diff --git a/source/know/concept/coulomb-logarithm/index.md b/source/know/concept/coulomb-logarithm/index.md new file mode 100644 index 0000000..3bed159 --- /dev/null +++ b/source/know/concept/coulomb-logarithm/index.md @@ -0,0 +1,197 @@ +--- +title: "Coulomb logarithm" +date: 2021-10-03 +categories: +- Physics +- Plasma physics +layout: "concept" +--- + +In a plasma, particles often appear to collide, +although actually it is caused by Coulomb forces, +i.e. the "collision" is in fact [Rutherford scattering](/know/concept/rutherford-scattering/). +In any case, the particles' paths are deflected, +and it would be nice to know +whether those deflections are usually large or small. + +Let us choose $\pi/2$ as an example of a large deflection angle. +Then Rutherford predicts: + +$$\begin{aligned} + \frac{q_1 q_2}{4 \pi \varepsilon_0 |\vb{v}|^2 \mu b_\mathrm{large}} + = \tan\!\Big( \frac{\pi}{4} \Big) + = 1 +\end{aligned}$$ + +Isolating this for the impact parameter $b_\mathrm{large}$ +then yields an effective radius of a particle: + +$$\begin{aligned} + b_\mathrm{large} + = \frac{q_1 q_2}{4 \pi \varepsilon_0 |\vb{v}|^2 \mu} +\end{aligned}$$ + +Therefore, the collision cross-section $\sigma_\mathrm{large}$ +for large deflections can be roughly estimated as +the area of a disc with radius $b_\mathrm{large}$: + +$$\begin{aligned} + \sigma_\mathrm{large} + = \pi b_\mathrm{large}^2 + = \frac{q_1^2 q_2^2}{16 \pi \varepsilon_0^2 |\vb{v}|^4 \mu^2} +\end{aligned}$$ + +Next, we want to find the cross-section for small deflections. +For sufficiently small angles $\theta$, +we can Taylor-expand the Rutherford scattering formula to first order: + +$$\begin{aligned} + \frac{q_1 q_2}{4 \pi \varepsilon_0 |\vb{v}|^2 \mu b} + = \tan\!\Big( \frac{\theta}{2} \Big) + \approx \frac{\theta}{2} + \quad \implies \quad + \theta + \approx \frac{q_1 q_2}{2 \pi \varepsilon_0 |\vb{v}|^2 \mu b} +\end{aligned}$$ + +Clearly, $\theta$ is inversely proportional to $b$. +Intuitively, we know that a given particle in a uniform plasma +always has more "distant" neighbours than "close" neighbours, +so we expect that small deflections (large $b$) +are more common than large deflections. + +That said, many small deflections can add up to a large total. +They can also add up to zero, +so we should use random walk statistics. +We now ask: how many $N$ small deflections $\theta_n$ +are needed to get a large total of, say, $1$ radian? + +$$\begin{aligned} + \sum_{n = 1}^N \theta_n^2 \approx 1 +\end{aligned}$$ + +Traditionally, $1$ is chosen instead of $\pi/2$ for convenience. +We are only making rough estimates, +so those two angles are close enough for our purposes. +Furthermore, the end result will turn out to be logarithmic, +and is thus barely affected by this inconsistency. + +You can easily convince yourself +that the average time $\tau$ between "collisions" +is related like so to the cross-section $\sigma$, +the total density $n$ of charged particles, +and the relative velocity $|\vb{v}|$: + +$$\begin{aligned} + \frac{1}{\tau} + = n |\vb{v}| \sigma + \qquad \implies \qquad + 1 + = n |\vb{v}| \tau \sigma +\end{aligned}$$ + +Therefore, in a given time interval $t$, +the expected number of collision $N_b$ +for impact parameters between $b$ and $b\!+\!\dd{b}$ +(imagine a ring with these inner and outer radii) +is given by: + +$$\begin{aligned} + N_b + = n |\vb{v}| t \: \sigma_b + = n |\vb{v}| t \:(2 \pi b \dd{b}) +\end{aligned}$$ + +In this time interval $t$, +we can thus turn our earlier sum +into an integral of $N_b$ over $b$: + +$$\begin{aligned} + 1 + \approx \sum_{n = 1}^N \theta_n^2 + = \int N_b \:\theta^2 \dd{b} + = n |\vb{v}| t \int 2 \pi \theta^2 b \dd{b} +\end{aligned}$$ + +Using the formula $n |\vb{v}| \tau \sigma = 1$, +we thus define $\sigma_{small}$ as the effective cross-section +needed to get a large deflection (of $1$ radian), +with an average period $t$: + +$$\begin{aligned} + \sigma_\mathrm{small} + = \int 2 \pi \theta^2 b \dd{b} + = \int \frac{2 \pi q_1^2 q_2^2}{4 \pi^2 \varepsilon_0^2 |\vb{v}|^4 \mu^2 b^2} b \dd{b} +\end{aligned}$$ + +Where we have replaced $\theta$ with our earlier Taylor expansion. +Here, we recognize $\sigma_\mathrm{large}$: + +$$\begin{aligned} + \sigma_\mathrm{small} + = \frac{q_1^2 q_2^2}{2 \pi \varepsilon_0^2 |\vb{v}|^4 \mu^2} \int \frac{1}{b} \dd{b} + = 8 \sigma_\mathrm{large} \int \frac{1}{b} \dd{b} +\end{aligned}$$ + +But what are the integration limits? +We know that the deflection grows for smaller $b$, +so it would be reasonable to choose $b_\mathrm{large}$ as the lower limit. +For very large $b$, the plasma shields the particles from each other, +thereby nullifying the deflection, +so as upper limit we choose +the [Debye length](/know/concept/debye-length/) $\lambda_D$, +i.e. the plasma's self-shielding length. +We thus find: + +$$\begin{aligned} + \boxed{ + \sigma_\mathrm{small} + = 8 \ln(\Lambda) \sigma_\mathrm{large} + = \frac{q_1^2 q_2^2 \ln\!(\Lambda)}{2 \pi \varepsilon_0^2 |\vb{v}|^4 \mu^2} + } +\end{aligned}$$ + +Here, $\ln\!(\Lambda)$ is known as the **Coulomb logarithm**, +with the **plasma parameter** $\Lambda$ defined below, +equal to $9/2$ times the number of particles +in a sphere with radius $\lambda_D$: + +$$\begin{aligned} + \boxed{ + \Lambda + \equiv \frac{\lambda_D}{b_\mathrm{large}} + = 6 \pi n \lambda_D^3 + } +\end{aligned}$$ + +The above relation between $\sigma_\mathrm{small}$ and $\sigma_\mathrm{large}$ +gives us an estimate of how much more often +small deflections occur, compared to large ones. +In a typical plasma, $\ln\!(\Lambda)$ is between 6 and 25, +such that $\sigma_\mathrm{small}$ is 2-3 orders of magnitude larger than $\sigma_\mathrm{large}$. + +Note that $t$ is now fixed as the period +for small deflections to add up to $1$ radian. +In more useful words, it is the time scale +for significant energy transfer between partices: + +$$\begin{aligned} + \frac{1}{t} + = n |\vb{v}| \sigma_\mathrm{small} + = \frac{q_1^2 q_2^2 \ln\!(\Lambda) \: n}{2 \pi \varepsilon_0^2 \mu^2 |\vb{v}|^3} + \sim \frac{n}{T^{3/2}} +\end{aligned}$$ + +Where we have used that $|\vb{v}| \propto \sqrt{T}$, for some temperature $T$. +Consequently, in hotter plasmas, there is less energy transfer, +meaning that a hot plasma is hard to heat up further. + + + +## References +1. P.M. Bellan, + *Fundamentals of plasma physics*, + 1st edition, Cambridge. +2. M. Salewski, A.H. Nielsen, + *Plasma physics: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/coupled-mode-theory/index.md b/source/know/concept/coupled-mode-theory/index.md new file mode 100644 index 0000000..acb4710 --- /dev/null +++ b/source/know/concept/coupled-mode-theory/index.md @@ -0,0 +1,230 @@ +--- +title: "Coupled mode theory" +date: 2022-03-31 +categories: +- Physics +- Optics +layout: "concept" +--- + +Given an optical resonator (e.g. a photonic crystal cavity), +consider one of its quasinormal modes +with frequency $\omega_0$ and decay rate $1 / \tau_0$. +Its complex amplitude $A$ is governed by: + +$$\begin{aligned} + \dv{A}{t} + &= \bigg( \!-\! i \omega_0 - \frac{1}{\tau_0} \bigg) A +\end{aligned}$$ + +We choose to normalize $A$ so that $|A(t)|^2$ +is the total energy inside the resonator at time $t$. + +Suppose that $N$ waveguides are now "connected" to this resonator, +meaning that the resonator mode $A$ and the outgoing waveguide mode $S_\ell^\mathrm{out}$ +overlap sufficiently for $A$ to leak into $S_\ell^\mathrm{out}$ at a rate $1 / \tau_\ell$. +Conversely, the incoming mode $S_\ell^\mathrm{in}$ brings energy to $A$. +Therefore, we can write up the following general set of equations: + +$$\begin{aligned} + \dv{A}{t} + &= \bigg( \!-\! i \omega_0 - \frac{1}{\tau_0} \bigg) A + - \sum_{\ell = 1}^N \frac{1}{\tau_\ell} A + \sum_{\ell = 1}^N \alpha_\ell S_\ell^\mathrm{in} + \\ + S_\ell^\mathrm{out} + &= \beta_\ell S_\ell^\mathrm{in} + \gamma_\ell A +\end{aligned}$$ + +Where $\alpha_\ell$ and $\gamma_\ell$ are unknown coupling constants, +and $\beta_\ell$ represents reflection. +We normalize $S_\ell^\mathrm{in}$ +so that $|S_\ell^\mathrm{in}(t)|^2$ is the power flowing towards $A$ at time $t$, +and likewise for $S_\ell^\mathrm{out}$. + +Note that we have made a subtle approximation here: +by adding new damping mechanisms, +we are in fact modifying $\omega_0$; +see the [harmonic oscillator](/know/concept/harmonic-oscillator/) for a demonstration. +However, the frequency shift is second-order in the decay rate, +so by assuming that all $\tau_\ell$ are large, +we only need to keep the first-order terms, as we did. +This is called **weak coupling**. + +If we also assume that $\tau_0$ is large +(its effect is already included in $\omega_0$), +then we can treat the decay mechanisms separately: +to analyze the decay into a certain waveguide $\ell$, +it is first-order accurate to neglect all other waveguides and $\tau_0$: + +$$\begin{aligned} + \dv{A}{t} + \approx \bigg( \!-\! i \omega_0 - \frac{1}{\tau_\ell} \bigg) A + \sum_{\ell' = 1}^N \alpha_\ell S_{\ell'}^\mathrm{in} +\end{aligned}$$ + +To determine $\gamma_\ell$, we use energy conservation. +If all $S_{\ell'}^\mathrm{in} = 0$, +then the energy in $A$ decays as: + +$$\begin{aligned} + \dv{|A|^2}{t} + &= \dv{A}{t} A^* + A \dv{A^*}{t} + \\ + &= \bigg( \!-\! i \omega_0 - \frac{1}{\tau_\ell} \bigg) |A|^2 + + \bigg( i \omega_0 - \frac{1}{\tau_\ell} \bigg) |A|^2 + \\ + &= - \frac{2}{\tau_\ell} |A|^2 +\end{aligned}$$ + +Since all other mechanisms are neglected, +all this energy must go into $S_\ell^\mathrm{out}$, meaning: + +$$\begin{aligned} + |S_\ell^\mathrm{out}|^2 + = - \dv{|A|^2}{t} + = \frac{2}{\tau_\ell} |A|^2 +\end{aligned}$$ + +Taking the square root, we clearly see that $|\gamma_\ell| = \sqrt{2 / \tau_\ell}$. +Because the phase of $S_\ell^\mathrm{out}$ is arbitrarily defined, +$\gamma_\ell$ need not be complex, so we choose $\gamma_\ell = \sqrt{2 / \tau_\ell}$. + +Next, to find $\alpha_\ell$, we exploit the time-reversal symmetry +of [Maxwell's equations](/know/concept/maxwells-equations/), +which govern the light in the resonator and the waveguides. +In the above calculation of $\gamma_\ell$, $A$ evolved as follows, +with the lost energy ending up in $S_\ell^\mathrm{out}$: + +$$\begin{aligned} + A(t) + = A e^{-i \omega_0 t - t / \tau_\ell} +\end{aligned}$$ + +After reversing time, $A$ evolves like so, +where we have taken the complex conjugate +to preserve the meanings of the symbols +$A$, $S_\ell^\mathrm{out}$, and $S_\ell^\mathrm{in}$: + +$$\begin{aligned} + A(t) + = A e^{-i \omega_0 t + t / \tau_\ell} +\end{aligned}$$ + +We insert this expression for $A(t)$ into its original differential equation, yielding: + +$$\begin{aligned} + \dv{A}{t} + = \bigg( \!-\! i \omega_0 + \frac{1}{\tau_\ell} \bigg) A + = \bigg( \!-\! i \omega_0 - \frac{1}{\tau_\ell} \bigg) A + \alpha_\ell S_\ell^\mathrm{in} +\end{aligned}$$ + +Isolating this for $A$ leads us to the following power balance equation: + +$$\begin{aligned} + A + = \frac{\alpha_\ell \tau_\ell}{2} S_\ell^\mathrm{in} + \qquad \implies \qquad + |\alpha_\ell|^2 |S_\ell^\mathrm{in}|^2 + = \frac{4}{\tau_\ell^2} |A|^2 +\end{aligned}$$ + +But thanks to energy conservation, +all power delivered by $S_\ell^\mathrm{in}$ ends up in $A$, so we know: + +$$\begin{aligned} + |S_\ell^\mathrm{in}|^2 + = \dv{|A|^2}{t} + = \frac{2}{\tau_\ell} |A|^2 +\end{aligned}$$ + +To reconcile the two equations above, +we need $|\alpha_\ell| = \sqrt{2 / \tau_\ell}$. +Discarding the phase thanks to our choice of $\gamma_\ell$, +we conclude that $\alpha_\ell = \sqrt{2 / \tau_\ell} = \gamma_\ell$. + +Finally, $\beta_\ell$ can also be determined using energy conservation. +Again using our weak coupling assumption, +if energy is only entering and leaving $A$ through waveguide $\ell$, we have: + +$$\begin{aligned} + |S_\ell^\mathrm{in}|^2 - |S_\ell^\mathrm{out}|^2 + = \dv{|A|^2}{t} +\end{aligned}$$ + +Meanwhile, using the differential equation for $A$, +we find the following relation: + +$$\begin{aligned} + \dv{|A|^2}{t} + &= \dv{A}{t} A^* + A \dv{A^*}{t} + \\ + &= - \frac{2}{\tau_\ell} |A|^2 + \alpha_\ell \Big( S_\ell^\mathrm{in} A^* + (S_\ell^\mathrm{in})^* A \Big) +\end{aligned}$$ + +By isolating both of the above relations for $\idv{|A|^2}{t}$ +and equating them, we arrive at: + +$$\begin{aligned} + |S_\ell^\mathrm{in}|^2 - |S_\ell^\mathrm{out}|^2 + &= - \frac{2}{\tau_\ell} |A|^2 + \alpha_\ell \Big( S_\ell^\mathrm{in} A^* + (S_\ell^\mathrm{in})^* A \Big) +\end{aligned}$$ + +We insert the definition of $\gamma_\ell$ and $\beta_\ell$, +namely $\gamma_\ell A = S_\ell^\mathrm{out} - \beta_\ell S_\ell^\mathrm{in}$, +and use $\alpha_\ell = \gamma_\ell$: + +$$\begin{aligned} + |S_\ell^\mathrm{in}|^2 - |S_\ell^\mathrm{out}|^2 + &= - \Big( S_\ell^\mathrm{out} - \beta_\ell S_\ell^\mathrm{in} \Big) \Big( (S_\ell^\mathrm{out})^* - \beta_\ell^* (S_\ell^\mathrm{in})^* \Big) + \\ + &\quad\; + S_\ell^\mathrm{in} \Big( (S_\ell^\mathrm{out})^* - \beta_\ell^* (S_\ell^\mathrm{in})^* \Big) + + (S_\ell^\mathrm{in})^* \Big( S_\ell^\mathrm{out} - \beta_\ell S_\ell^\mathrm{in} \Big) + \\ + &= - |\beta_\ell|^2 |S_\ell^\mathrm{in}|^2 - |S_\ell^\mathrm{out}|^2 + + \beta_\ell S_\ell^\mathrm{in} (S_\ell^\mathrm{out})^* + \beta_\ell^* (S_\ell^\mathrm{in})^* S_\ell^\mathrm{out} + \\ + &\quad\; + S_\ell^\mathrm{in} (S_\ell^\mathrm{out})^* - \beta_\ell^* |S_\ell^\mathrm{in}|^2 + + (S_\ell^\mathrm{in})^* S_\ell^\mathrm{out} - \beta_\ell |S_\ell^\mathrm{in}|^2 + \\ + &= - (|\beta_\ell|^2 + \beta_\ell + \beta_\ell^*) |S_\ell^\mathrm{in}|^2 - |S_\ell^\mathrm{out}|^2 + \\ + &\quad\; + (1 - \beta_\ell) S_\ell^\mathrm{in} (S_\ell^\mathrm{out})^* + (1 - \beta_\ell^*) (S_\ell^\mathrm{in})^* S_\ell^\mathrm{out} +\end{aligned}$$ + +This equation is only satisfied if $\beta_\ell = -1$. +Combined with $\alpha_\ell = \gamma_\ell = \sqrt{2 / \tau_\ell}$, +the **coupled-mode equations** take the following form: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \dv{A}{t} + &= \bigg( \!-\! i \omega_0 - \frac{1}{\tau_0} \bigg) A + - \sum_{\ell = 1}^N \frac{1}{\tau_\ell} A + + \sum_{\ell = 1}^N \sqrt{\frac{2}{\tau_\ell}} S_\ell^\mathrm{in} + \\ + S_\ell^\mathrm{out} + &= - S_\ell^\mathrm{in} + \sqrt{\frac{2}{\tau_\ell}} A + \end{aligned} + } +\end{aligned}$$ + +By connecting multiple resonators with waveguides, +optical networks can be created, +whose dynamics are described by these equations. + +The coupled-mode equations are extremely general, +since we have only used weak coupling, +conservation of energy, and time-reversal symmetry. +Even if the decay rates are quite large, +coupled mode theory still tends to give qualitatively correct answers. + + + +## References +1. H.A. Haus, + *Waves and fields in optoelectronics*, + 1984, Prentice-Hall. +2. J.D. Joannopoulos, S.G. Johnson, J.N. Winn, R.D. Meade, + *Photonic crystals: molding the flow of light*, + 2nd edition, Princeton. + diff --git a/source/know/concept/curvature/index.md b/source/know/concept/curvature/index.md new file mode 100644 index 0000000..40bd106 --- /dev/null +++ b/source/know/concept/curvature/index.md @@ -0,0 +1,389 @@ +--- +title: "Curvature" +date: 2021-03-07 +categories: +- Mathematics +layout: "concept" +--- + +Given a curve or surface, its **curvature** $\kappa$ +describes how sharply it is bending at a given point. +It is defined as the inverse of the **radius of curvature** $R$, +which is the radius of the tangent circle +that **osculates** (i.e. best approximates) +the curve/surface at that point: + +$$\begin{aligned} + \kappa = \frac{1}{R} +\end{aligned}$$ + +Typically, $\kappa$ is positive for convex curves/surfaces, +and negative for concave ones, although this distinction is somewhat arbitrary. +Below, we calculate the curvature in several general cases. + + +## 2D height functions + +We start with a specialized case: height functions, +where one coordinate is a function of the other one (2D) or two (3D). +In this case, we can use the +[calculus of variations](/know/concept/calculus-of-variations/) +to find the curvature. + +This approach relies on the fact that a circle +has the highest area-perimeter ratio of any 2D shape, +and a sphere has the highest volume-surface ratio of any 3D body. +By the definition of curvature, these shapes have constant $\kappa$. + +We will thus minimize the perimeter/surface while keeping the area/volume fixed, +which will give us a shape with constant curvature, +and from that we can extrapolate an expression for $\kappa$. + +In 2D, for a single-variable height function $h(x)$, +the length of a small segment of the curve is: + +$$\begin{aligned} + \sqrt{\dd{x}^2 + \dd{h}^2} + = \dd{x} \sqrt{\Big( \dv{x}{x} \Big)^2 + \Big( \dv{h}{x} \Big)^2} + = \dd{x} \sqrt{1 + h_x^2} +\end{aligned}$$ + +Which leads us to define the following Lagrangian $\mathcal{L}$ +describing the "energy cost" of the curve: + +$$\begin{aligned} + \mathcal{L} + = \sqrt{1 + h_x^2} +\end{aligned}$$ + +Furthermore, +we demand that the area under the curve (i.e. the "volume") is constant: + +$$\begin{aligned} + V + = \int_{x_0}^{x_1} h(x) \dd{x} +\end{aligned}$$ + +By putting these things together, +we arrive at the following energy functional $E[h]$, +where $\kappa$ is an ominously-named [Lagrange multiplier](/know/concept/lagrange-multiplier/): + +$$\begin{aligned} + E[h] + = \int (\mathcal{L} + \kappa h) \dd{x} +\end{aligned}$$ + +Minimizing this functional leads to the following +Lagrange equation of the first kind: + +$$\begin{aligned} + 0 + = \pdv{\mathcal{L}}{h} - \dv{}{x}\Big( \pdv{\mathcal{L}}{h_x} \Big) + \kappa +\end{aligned}$$ + +We evaluate the terms of this equation +to arrive at an expression for the curvature $\kappa$: + +$$\begin{aligned} + \boxed{ + \kappa + = \frac{h_{xx}}{\big(1 + h_x^2\big)^{3/2}} + } +\end{aligned}$$ + +In this optimization problem, $\kappa$ is a constant, +but in fact the statement above is valid for variable curvatures too, +in which case $\kappa$ is a function of $x$. + + +## 2D in general + +We can parametrically describe an arbitrary plane curve +as a function of the arc length $s$: + +$$\begin{aligned} + \big( x(s), y(s) \big) + \qquad \mathrm{where} \qquad + \dd{s}^2 = \dd{x}^2 + \dd{y}^2 +\end{aligned}$$ + +If we choose the horizontal $x$-axis as a reference, +we can furthermore define the **elevation angle** $\theta(s)$ +as the angle between the reference and the curve's tangent vector $\vu{t}$: + +$$\begin{aligned} + \vu{t} + = \big( x_s(s), y_s(s) \big) + = \big( \cos\theta(s), \sin\theta(s) \big) +\end{aligned}$$ + +Where $x_s(s) = \idv{x}{s}$. +The curvature $\kappa$ is defined as +the $s$-derivative of this elevation angle: + +$$\begin{aligned} + \kappa + = \dv{\theta}{s} + = \theta_s(s) +\end{aligned}$$ + +We have two ways of writing $\vu{t}$: +using the derivatives $x_s$ and $y_s$, +or the elevation angle $\theta$. +Now, let us take the $s$-derivative of both expressions, +and equate them: + +$$\begin{aligned} + \big( x_{ss}, y_{ss} \big) + = \dv{\vu{t}}{s} + = \theta_s \: \big( \!-\!\sin\theta, \cos\theta \big) + = \kappa \big( \!-\!y_s, x_s \big) +\end{aligned}$$ + +$$\begin{aligned} + x_{ss} = - \kappa y_s + \qquad + y_{ss} = \kappa x_s +\end{aligned}$$ + +We multiply these equation by $y_s$ and $x_s$, respectively, +and subtract the first from the last: + +$$\begin{aligned} + y_{ss} x_s - x_{ss} y_s = \kappa x_s^2 + \kappa y_s^2 +\end{aligned}$$ + +Isolating this for $\kappa$ and using the fact that $x_s^2 + y_s^2 = 1$ +thanks to $s$ being the arc length: + +$$\begin{aligned} + \kappa + = \frac{y_{ss} x_s - x_{ss} y_s}{x_s^2 + y_s^2} + = y_{ss} x_s - x_{ss} y_s +\end{aligned}$$ + +While this result is correct, +we would like to generalize it to cases where the curve +is parametrized by some other $t$, not necessarily the arc length. +Let prime denote the $t$-derivative: + +$$\begin{aligned} + x_s + = x' t_s + \qquad + x_{ss} + = x'' t_s^2 + x' t_{ss} + \\ + y_s + = y' t_s + \qquad \: + y_{ss} + = y'' t_s^2 + x' t_{ss} +\end{aligned}$$ + +By inserting these expression into the earlier formula for $\kappa$, we find: + +$$\begin{aligned} + \kappa + = y_{ss} x_s - x_{ss} y_s + &= x' t_s (y'' t_s^2 + y' t_{ss}) - y' t_s (x'' t_s^2 + x' t_{ss}) + \\ + &= t_s t_{ss} (x' y' - y' x') + t_s^3 (x' y'' - y' x'') + \\ + &= t_s^3 (x' y'' - y' x'') +\end{aligned}$$ + +Since $x_s^2 + y_s^2 = 1$, we know that $(x')^2 + (y')^2 = 1 / t_s^2$, +which leads us to the following general expression for +the curvature $\kappa$ of a plane curve: + +$$\begin{aligned} + \boxed{ + \kappa + = \frac{y'' x' - x'' y'}{\big((x')^2 + (y')^2\big)^{3/2}} + } +\end{aligned}$$ + +If the curve happens to be a height function, i.e. $y(x)$, +then $x' = 1$ and $x'' = 0$, and we arrive at our previous result again. + + +## 3D height functions + +The generalization to a 3D height function $h(x, y)$ is straightforward: +the cost of an infinitesimal portion of the surface is as follows, +using the same reasoning as before: + +$$\begin{aligned} + \mathcal{L} + = \sqrt{1 + h_x^2 + h_y^2} +\end{aligned}$$ + +Keeping the volume $V$ constant, +we get the following energy functional $E$ to minimize: + +$$\begin{aligned} + E[h] + = \iint (\mathcal{L} + \lambda h) \dd{x} \dd{y} +\end{aligned}$$ + +Which gives us an Euler-Lagrange equation +involving the Lagrange multiplier $\lambda$: + +$$\begin{aligned} + 0 + = \pdv{\mathcal{L}}{h} - \dv{}{x}\Big( \pdv{\mathcal{L}}{h_x} \Big) - \dv{}{y}\Big( \pdv{\mathcal{L}}{h_y} \Big) + \lambda +\end{aligned}$$ + +Inserting $\mathcal{L}$ into this and evaluating all the derivatives +yields a result for the (variable) curvature: + +$$\begin{aligned} + \boxed{ + \lambda + = \kappa_1 + \kappa_2 + = \frac{(1 + h_y^2) h_{xx} - 2 h_x h_y h_{xy} + (1 + h_x^2) h_{yy}}{\big(1 + h_x^2 + h_y^2\big)^{3/2}} + } +\end{aligned}$$ + +What are $\kappa_1$ and $\kappa_2$? +Well, the problem in 3D is that the curvature of an osculating circle +depends on the orientation of that circle. +The **principal curvatures** $\kappa_1$ and $\kappa_2$ +are the largest and smallest curvatures at a given point, +but finding their values and the corresponding **principal directions** is not so easy. +Fortunately, in practice, we are often only interested in their sum: + +$$\begin{aligned} + \lambda + = \kappa_1 + \kappa_2 + = \frac{1}{R_1} + \frac{1}{R_2} +\end{aligned}$$ + +These **principal radii** $R_1$ and $R_2$ are important +for e.g. the [Young-Laplace law](/know/concept/young-laplace-law/). + + +## 3D in general + +To find a general expression for the mean curvature of an arbitrary surface, +we "cut off" a small part of the surface that we can regard as a height function. +We call the "cutting" reference plane $(x, y)$, +and the surface it describes $h(x, y)$. +We then define the unit tangent vectors $\vu{t}_x$ and $\vu{t}_y$ +to be parallel to the $x$-axis and $y$-axis, respectively: + +$$\begin{aligned} + \vu{t}_x + = \frac{1}{\sqrt{1 + (h_x)^2}} + \begin{bmatrix} + 1 \\ 0 \\ h_x + \end{bmatrix} + \qquad + \vu{t}_y + = \frac{1}{\sqrt{1 + (h_y)^2}} + \begin{bmatrix} + 0 \\ 1 \\ h_y + \end{bmatrix} +\end{aligned}$$ + +Since they were chosen to lie along the axes, +these vectors are not necessarily orthogonal, +so we need to normalize the resulting normal vector $\vu{n}$: + +$$\begin{aligned} + \vu{n} + = \vu{t}_x \cross \vu{t}_y + = \frac{1}{\sqrt{1 + (h_x)^2 + (h_y)^2}} + \begin{bmatrix} + - h_x \\ - h_y \\ 1 + \end{bmatrix} +\end{aligned}$$ + +Let us take a look at the divergence of $\vu{n}$, +or to be precise, its *projection* onto the reference plane +(although this distinction is not really important for our purposes): + +$$\begin{aligned} + \nabla \cdot \vu{n} + = - \dv{}{x}\bigg( \frac{h_x}{\sqrt{1 + (h_x)^2 + (h_y)^2}} \bigg) - \dv{}{y}\bigg( \frac{h_y}{\sqrt{1 + (h_x)^2 + (h_y)^2}} \bigg) +\end{aligned}$$ + +Compare this with the expression for $\lambda$ we found earlier, +with the help of variational calculus: + +$$\begin{aligned} + \lambda + &= \dv{}{x}\Big( \pdv{\mathcal{L}}{h_x} \Big) + \dv{}{y}\Big( \pdv{\mathcal{L}}{h_y} \Big) + \\ + &= \dv{}{x}\bigg( \frac{h_x}{\sqrt{1 + (h_x)^2 + (h_y)^2}} \bigg) + \dv{}{y}\bigg( \frac{h_y}{\sqrt{1 + (h_x)^2 + (h_y)^2}} \bigg) +\end{aligned}$$ + +The similarity is clearly visible. +This leads us to the following general expression: + +$$\begin{aligned} + \boxed{ + \kappa_1 + \kappa_2 + = - \nabla \cdot \vu{n} + } +\end{aligned}$$ + +A useful property is that +the principal directions of curvature are always orthogonal. +To show this, consider the most general second-order approximating surface, +in polar coordinates: + +$$\begin{aligned} + h(x, y) + &= \frac{1}{2} a x^2 + \frac{1}{2} b y^2 + c x y + \\ + &= \frac{1}{2} a r^2 \cos^2\varphi + \frac{1}{2} b r^2 \sin^2\varphi + c r^2 \cos\varphi \sin\varphi +\end{aligned}$$ + +Sufficiently close to the extremum, where $h_x$ and $h_y$ are negligible, +the curvature along a certain direction $\varphi$ is given by +our earlier formula for a 2D height function: + +$$\begin{aligned} + \kappa(\varphi) + \approx \pdvn{2}{h}{r} + = a \cos^2\varphi + b \sin^2\varphi + c \sin(2 \varphi) +\end{aligned}$$ + +To find the extremes of $\kappa$, +we differentiate with respect to $\varphi$ and demand that it is zero: + +$$\begin{aligned} + 0 + &= - 2 a \cos\varphi \sin\varphi + 2 b \sin\varphi \cos\varphi + 2 c \cos(2 \varphi) + \\ + &= - a \sin(2 \varphi) + b \sin(2 \varphi) + 2 c \cos(2 \varphi) +\end{aligned}$$ + +After rearranging this a bit, we arrive at the following transcendental equation: + +$$\begin{aligned} + \frac{2 c}{a - b} + = \frac{\sin(2 \varphi)}{\cos(2 \varphi)} + = \tan(2 \varphi) +\end{aligned}$$ + +Since the $\tan$ function is $\pi$-periodic, +this has two solutions, $\varphi_0$ and $\varphi_0 + \pi/2$, +which are clearly orthogonal, +hence the principal directions are at an angle of $\pi/2$. + +Finally, it is also worth mentioning that +the principal directions always lie in planes +containing the normal of the surface. + + + +## References +1. T. Bohr, + *Curvature of plane curves and surfaces*, + 2020, unpublished. +2. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/curvilinear-coordinates/index.md b/source/know/concept/curvilinear-coordinates/index.md new file mode 100644 index 0000000..9cae643 --- /dev/null +++ b/source/know/concept/curvilinear-coordinates/index.md @@ -0,0 +1,380 @@ +--- +title: "Curvilinear coordinates" +date: 2021-03-03 +categories: +- Mathematics +- Physics +layout: "concept" +--- + +In a 3D coordinate system, the isosurface of a coordinate +(i.e. the surface where that coordinate is constant while the others vary) +is known as a **coordinate surface**, and the intersections of +the surfaces of different coordinates are called **coordinate lines**. + +A **curvilinear** coordinate system is one where at least one of the coordinate surfaces is curved, +e.g. in cylindrical coordinates the line between $r$ and $z$ is a circle. +If the coordinate surfaces are mutually perpendicular, +it is an **orthogonal** system, which is generally desirable. + +A useful attribute of a coordinate system is its **line element** $\dd{\ell}$, +which represents the differential element of a line in any direction. +For an orthogonal system, its square $\dd{\ell}^2$ is calculated +by taking the differential elements of the old Cartesian $(x, y, z)$ system +and writing them out in the new $(x_1, x_2, x_3)$ system. +The resulting expression will be of the form: + +$$\begin{aligned} + \boxed{ + \dd{\ell}^2 + = \dd{x}^2 + \dd{y}^2 + \dd{z}^2 + = h_1^2 \dd{x_1}^2 + h_2^2 \dd{x_2}^2 + h_3^2 \dd{x_3}^2 + } +\end{aligned}$$ + +Where $h_1$, $h_2$, and $h_3$ are called **scale factors**, +and need not be constants. +The equation above only contains quadratic terms +because the coordinate system is orthogonal by assumption. + +Examples of orthogonal curvilinear coordinate systems include +[spherical coordinates](/know/concept/spherical-coordinates/), +[cylindrical polar coordinates](/know/concept/cylindrical-polar-coordinates/), +and [cylindrical parabolic coordinates](/know/concept/cylindrical-parabolic-coordinates/). + +In the following subsections, +we derive general formulae to convert expressions +from Cartesian coordinates to the new orthogonal system $(x_1, x_2, x_3)$. + + +## Basis vectors + +Consider the the vector form of the line element $\dd{\ell}$, +denoted by $\dd{\vu{\ell}}$ and expressed as: + +$$\begin{aligned} + \dd{\vu{\ell}} + = \vu{e}_x \dd{x} + \vu{e}_y \dd{y} + \vu{e}_z \dd{z} +\end{aligned}$$ + +We can expand the Cartesian differential elements, e.g. $\dd{y}$, +in the new basis as follows: + +$$\begin{aligned} + \dd{y} + = \pdv{y}{x_1} \dd{x_1} + \pdv{y}{x_2} \dd{x_2} + \pdv{y}{x_3} \dd{x_3} +\end{aligned}$$ + +If we write this out for $\dd{x}$, $\dd{y}$ and $\dd{z}$, +and group the terms according to $\dd{x}_1$, $\dd{x}_2$ and $\dd{x}_3$, +we can compare it the alternative form of $\dd{\vu{\ell}}$: + +$$\begin{aligned} + \dd{\vu{\ell}} + = \vu{e}_1 \:h_1 \dd{x_1} + \vu{e}_2 \:h_2 \dd{x_2} + \vu{e}_3 \:h_3 \dd{x_4} +\end{aligned}$$ + +From this, we can read off $\vu{e}_1$, $\vu{e}_2$ and $\vu{e}_3$. +Here we only give $\vu{e}_1$, since $\vu{e}_2$ and $\vu{e}_3$ are analogous: + +$$\begin{aligned} + \boxed{ + h_1 \vu{e}_1 + = \vu{e}_x \pdv{x}{x_1} + \vu{e}_y \pdv{y}{x_1} + \vu{e}_z \pdv{y}{x_1} + } +\end{aligned}$$ + + +## Gradient + +In an orthogonal coordinate system, +the gradient $\nabla f$ of a scalar $f$ is as follows, +where $\vu{e}_1$, $\vu{e}_2$ and $\vu{e}_3$ +are the basis unit vectors respectively corresponding to $x_1$, $x_2$ and $x_3$: + +$$\begin{gathered} + \boxed{ + \nabla f + = \vu{e}_1 \frac{1}{h_1} \pdv{f}{x_1} + + \vu{e}_2 \frac{1}{h_2} \pdv{f}{x_2} + + \vu{e}_3 \frac{1}{h_3} \pdv{f}{x_3} + } +\end{gathered}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-grad"/> +<label for="proof-grad">Proof</label> +<div class="hidden"> +<label for="proof-grad">Proof.</label> +For a direction $\dd{\ell}$, we know that +$\idv{f}{\ell}$ is the component of $\nabla f$ in that direction: + +$$\begin{aligned} + \dv{f}{\ell} + = \pdv{f}{x} \dv{x}{\ell} + \pdv{f}{y} \dv{y}{\ell} + \pdv{f}{z} \dv{z}{\ell} + = \nabla f \cdot \bigg( \dv{x}{\ell}, \dv{y}{\ell}, \dv{z}{\ell} \bigg) + = \nabla f \cdot \vu{u} +\end{aligned}$$ + +Where $\vu{u}$ is simply a unit vector in the direction of $\dd{\ell}$. +We thus find the expression for the gradient $\nabla f$ +by choosing $\dd{\ell}$ to be $h_1 \dd{x_1}$, $h_2 \dd{x_2}$ and $h_3 \dd{x_3}$ in turn: + +$$\begin{gathered} + \nabla f + = \vu{e}_1 \dv{x_1}{\ell} \pdv{f}{x_1} + + \vu{e}_2 \dv{x_2}{\ell} \pdv{f}{x_2} + + \vu{e}_3 \dv{x_3}{\ell} \pdv{f}{x_3} +\end{gathered}$$ +</div> +</div> + + +## Divergence + +The divergence of a vector $\vb{V} = \vu{e}_1 V_1 + \vu{e}_2 V_2 + \vu{e}_3 V_3$ +in an orthogonal system is given by: + +$$\begin{aligned} + \boxed{ + \nabla \cdot \vb{V} + = \frac{1}{h_1 h_2 h_3} + \Big( \pdv{(h_2 h_3 V_1)}{x_1} + \pdv{(h_1 h_3 V_2)}{x_2} + \pdv{(h_1 h_2 V_3)}{x_3} \Big) + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-div"/> +<label for="proof-div">Proof</label> +<div class="hidden"> +<label for="proof-div">Proof.</label> +As preparation, we rewrite $\vb{V}$ as follows +to introduce the scale factors: + +$$\begin{aligned} + \vb{V} + &= \vu{e}_1 \frac{1}{h_2 h_3} (h_2 h_3 V_1) + + \vu{e}_2 \frac{1}{h_1 h_3} (h_1 h_3 V_2) + + \vu{e}_3 \frac{1}{h_1 h_2} (h_1 h_2 V_3) +\end{aligned}$$ + +We start by taking only the $\vu{e}_1$-component of this vector, +and expand its divergence using the following vector identity: + +$$\begin{gathered} + \nabla \cdot (\vb{U} \: f) + = \vb{U} \cdot (\nabla f) + (\nabla \cdot \vb{U}) f +\end{gathered}$$ + +Inserting the scalar $f = h_2 h_3 V_1$ +the vector $\vb{U} = \vu{e}_1 / (h_2 h_3)$, +we arrive at: + +$$\begin{gathered} + \nabla \cdot \Big( \frac{\vu{e}_1}{h_2 h_3} (h_2 h_3 V_1) \Big) + = \frac{\vu{e}_1}{h_2 h_3} \cdot \Big( \nabla (h_2 h_3 V_1) \Big) + + \Big( \nabla \cdot \frac{\vu{e}_1}{h_2 h_3} \Big) (h_2 h_3 V_1) +\end{gathered}$$ + +The first right-hand term is easy to calculate +thanks to our expression for the gradient $\nabla f$. +Only the $\vu{e}_1$-component survives due to the dot product: + +$$\begin{aligned} + \frac{\vu{e}_1}{h_2 h_3} \cdot \Big( \nabla (h_2 h_3 V_1) \Big) + = \frac{\vu{e}_1}{h_1 h_2 h_3} \pdv{(h_2 h_3 V_1)}{x_1} +\end{aligned}$$ + +The second term is more involved. +First, we use the gradient formula to observe that: + +$$\begin{aligned} + \nabla x_1 + = \frac{\vu{e}_1}{h_1} + \qquad \quad + \nabla x_2 + = \frac{\vu{e}_2}{h_2} + \qquad \quad + \nabla x_3 + = \frac{\vu{e}_3}{h_3} +\end{aligned}$$ + +Because $\vu{e}_2 \cross \vu{e}_3 = \vu{e}_1$ in an orthogonal basis, +these gradients can be used to express the vector whose divergence we want: + +$$\begin{aligned} + \nabla x_2 \cross \nabla x_3 + = \frac{\vu{e}_2}{h_2} \cross \frac{\vu{e}_3}{h_3} + = \frac{\vu{e}_1}{h_2 h_3} +\end{aligned}$$ + +We then apply the divergence and expand the expression using a vector identity. +In all cases, the curl of a gradient $\nabla \cross \nabla f$ is zero, so: + +$$\begin{aligned} + \nabla \cdot \frac{\vu{e}_1}{h_2 h_3} + = \nabla \cdot \big( \nabla x_2 \cross \nabla x_3 \big) + = \nabla x_3 \cdot (\nabla \cross \nabla x_2) - \nabla x_2 \cdot (\nabla \cross \nabla x_3) + = 0 +\end{aligned}$$ + +After repeating this procedure for the other components of $\vb{V}$, +we get the desired general expression for the divergence. +</div> +</div> + + +## Laplacian + +The Laplacian $\nabla^2 f$ is simply $\nabla \cdot \nabla f$, +so we can find the general formula +by combining the two preceding results +for the gradient and the divergence: + +$$\begin{aligned} + \boxed{ + \nabla^2 f + = \frac{1}{h_1 h_2 h_3} + \bigg( + \pdv{}{x_1}\Big(\! \frac{h_2 h_3}{h_1} \pdv{f}{x_1} \!\Big) + + \pdv{}{x_2}\Big(\! \frac{h_1 h_3}{h_2} \pdv{f}{x_2} \!\Big) + + \pdv{}{x_3}\Big(\! \frac{h_1 h_2}{h_3} \pdv{f}{x_3} \!\Big) + \bigg) + } +\end{aligned}$$ + + +## Curl + +The curl of a vector $\vb{V}$ is as follows +in a general orthogonal curvilinear system: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \nabla \times \vb{V} + &= \frac{\vu{e}_1}{h_2 h_3} \Big( \pdv{(h_3 V_3)}{x_2} - \pdv{(h_2 V_2)}{x_3} \Big) + \\ + &+ \frac{\vu{e}_2}{h_1 h_3} \Big( \pdv{(h_1 V_1)}{x_3} - \pdv{(h_3 V_3)}{x_1} \Big) + \\ + &+ \frac{\vu{e}_3}{h_1 h_2} \Big( \pdv{(h_2 V_2)}{x_1} - \pdv{(h_1 V_1)}{x_2} \Big) + \end{aligned} + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-curl"/> +<label for="proof-curl">Proof</label> +<div class="hidden"> +<label for="proof-curl">Proof.</label> +The curl is found in a similar way as the divergence. +We rewrite $\vb{V}$ like so: + +$$\begin{aligned} + \vb{V} + = \frac{\vu{e}_1}{h_1} (h_1 V_1) + \frac{\vu{e}_2}{h_2} (h_2 V_2) + \frac{\vu{e}_3}{h_3} (h_3 V_3) +\end{aligned}$$ + +We expand the curl of its $\vu{e}_1$-component using the following vector identity: + +$$\begin{gathered} + \nabla \cross (\vb{U} \: f) + = (\nabla \cross \vb{U}) f - \vb{U} \cross (\nabla f) +\end{gathered}$$ + +Inserting the scalar $f = h_1 V_1$ +and the vector $\vb{U} = \vu{e}_1 / h_1$, we arrive at: + +$$\begin{gathered} + \nabla \cross \Big( \frac{\vu{e}_1}{h_1} (h_1 V_1) \Big) + = \Big( \nabla \cross \frac{\vu{e}_1}{h_1} \Big) (h_1 V_1) - \frac{\vu{e}_1}{h_1} \cross \Big( \nabla (h_1 V_1) \Big) +\end{gathered}$$ + +Previously, when proving the divergence, +we already showed that $\vu{e}_1 / h_1 = \nabla x_1$. +Because the curl of a gradient is zero, +the first term disappears, leaving only the second, +which contains a gradient that turns out to be: + +$$\begin{aligned} + \nabla (h_1 V_1) + = \vu{e}_1 \frac{1}{h_1} \pdv{(h_1 V_1)}{x_1} + + \vu{e}_2 \frac{1}{h_2} \pdv{(h_1 V_1)}{x_2} + + \vu{e}_3 \frac{1}{h_3} \pdv{(h_1 V_1)}{x_3} +\end{aligned}$$ + +Consequently, the curl of the first component of $\vb{V}$ is as follows, +using the fact that $\vu{e}_1$, $\vu{e}_2$ and $\vu{e}_3$ +are related to each other by cross products: + +$$\begin{aligned} + \nabla \cross \Big( \frac{\vu{e}_1}{h_1} (h_1 V_1) \Big) + = - \frac{\vu{e}_1}{h_1} \cross \Big( \nabla (h_1 V_1) \Big) + = - \frac{\vu{e}_3}{h_1 h_2} \pdv{(h_1 V_1)}{x_2} + \frac{\vu{e}_2}{h_1 h_3} \pdv{(h_1 V_1)}{x_3} +\end{aligned}$$ + +If we go through the same process for the other components of $\vb{V}$ +and add up the results, we get the desired expression for the curl. +</div> +</div> + + +## Differential elements + +The point of the scale factors $h_1$, $h_2$ and $h_3$, as can seen from their derivation, +is to correct for "distortions" of the coordinates compared to the Cartesian system, +such that the line element $\dd{\ell}$ retains its length. +This property extends to the surface $\dd{S}$ and volume $\dd{V}$. + +When handling a differential volume in curvilinear coordinates, +e.g. for a volume integral, +the size of the box $\dd{V}$ must be corrected by the scale factors: + +$$\begin{aligned} + \boxed{ + \dd{V} + = \dd{x}\dd{y}\dd{z} + = h_1 h_2 h_3 \dd{x_1} \dd{x_2} \dd{x_3} + } +\end{aligned}$$ + +The same is true for the isosurfaces $\dd{S_1}$, $\dd{S_2}$ and $\dd{S_3}$ +where the coordinates $x_1$, $x_2$ and $x_3$ are respectively kept constant: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \dd{S_1} &= h_2 h_3 \dd{x_2} \dd{x_3} + \\ + \dd{S_2} &= h_1 h_3 \dd{x_1} \dd{x_3} + \\ + \dd{S_3} &= h_1 h_2 \dd{x_1} \dd{x_2} + \end{aligned} + } +\end{aligned}$$ + +Using the same logic, the normal vector element $\dd{\vu{S}}$ +of an arbitrary surface is given by: + +$$\begin{aligned} + \boxed{ + \dd{\vu{S}} + = \vu{e}_1 h_2 h_3 \dd{x_2} \dd{x_3} + \vu{e}_2 h_1 h_3 \dd{x_1} \dd{x_3} + \vu{e}_3 h_1 h_2 \dd{x_1} \dd{x_2} + } +\end{aligned}$$ + +Finally, the tangent vector element $\dd{\vu{\ell}}$ takes the following form: + +$$\begin{aligned} + \boxed{ + \dd{\vu{\ell}} + = \vu{e}_1 h_1 \dd{x_1} + \vu{e}_2 h_2 \dd{x_2} + \vu{e}_3 h_3 \dd{x_3} + } +\end{aligned}$$ + + + +## References +1. M.L. Boas, + *Mathematical methods in the physical sciences*, 2nd edition, + Wiley. diff --git a/source/know/concept/cylindrical-parabolic-coordinates/index.md b/source/know/concept/cylindrical-parabolic-coordinates/index.md new file mode 100644 index 0000000..f9d0475 --- /dev/null +++ b/source/know/concept/cylindrical-parabolic-coordinates/index.md @@ -0,0 +1,182 @@ +--- +title: "Cylindrical parabolic coordinates" +date: 2021-03-04 +categories: +- Mathematics +- Physics +layout: "concept" +--- + +**Cylindrical parabolic coordinates** are a coordinate system +that describes a point in space using three coordinates $(\sigma, \tau, z)$. +The $z$-axis is unchanged from the Cartesian system, +hence it is called a *cylindrical* system. +In the $z$-isoplane, however, confocal parabolas are used. +These coordinates can be converted to the Cartesian $(x, y, z)$ as follows: + +$$\begin{aligned} + \boxed{ + x = \frac{1}{2} (\tau^2 - \sigma^2 ) + \qquad + y = \sigma \tau + \qquad + z = z + } +\end{aligned}$$ + +Converting the other way is a bit trickier. +It can be done by solving the following equations, +and potentially involves some fiddling with signs: + +$$\begin{aligned} + 2 x + = \frac{y^2}{\sigma^2} - \sigma^2 + \qquad \qquad + 2 x + = - \frac{y^2}{\tau^2} + \tau^2 +\end{aligned}$$ + +Cylindrical parabolic coordinates form an orthogonal +[curvilinear system](/know/concept/curvilinear-coordinates/), +so we would like to find its scale factors $h_\sigma$, $h_\tau$ and $h_z$. +The differentials of the Cartesian coordinates are as follows: + +$$\begin{aligned} + \dd{x} = - \sigma \dd{\sigma} + \tau \dd{\tau} + \qquad + \dd{y} = \tau \dd{\sigma} + \sigma \dd{\tau} + \qquad + \dd{z} = \dd{z} +\end{aligned}$$ + +We calculate the line segment $\dd{\ell}^2$, +skipping many terms thanks to orthogonality: + +$$\begin{aligned} + \dd{\ell}^2 + &= (\sigma^2 + \tau^2) \:\dd{\sigma}^2 + (\tau^2 + \sigma^2) \:\dd{\tau}^2 + \dd{z}^2 +\end{aligned}$$ + +From this, we can directly read off the scale factors $h_\sigma^2$, $h_\tau^2$ and $h_z^2$, +which turn out to be: + +$$\begin{aligned} + \boxed{ + h_\sigma = \sqrt{\sigma^2 + \tau^2} + \qquad + h_\tau = \sqrt{\sigma^2 + \tau^2} + \qquad + h_z = 1 + } +\end{aligned}$$ + +With these scale factors, we can use +the general formulae for orthogonal curvilinear coordinates +to easily to convert things from the Cartesian system. +The basis vectors are: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \vu{e}_\sigma + &= \frac{- \sigma}{\sqrt{\sigma^2 + \tau^2}} \vu{e}_x + \frac{\tau}{\sqrt{\sigma^2 + \tau^2}} \vu{e}_y + \\ + \vu{e}_\tau + &= \frac{\tau}{\sqrt{\sigma^2 + \tau^2}} \vu{e}_x + \frac{\sigma}{\sqrt{\sigma^2 + \tau^2}} \vu{e}_y + \\ + \vu{e}_z + &= \vu{e}_z + \end{aligned} + } +\end{aligned}$$ + +The basic vector operations (gradient, divergence, Laplacian and curl) are given by: + +$$\begin{aligned} + \boxed{ + \nabla f + = \frac{\vu{e}_\sigma}{\sqrt{\sigma^2 + \tau^2}} \pdv{f}{\sigma} + + \frac{\vu{e}_\tau}{\sqrt{\sigma^2 + \tau^2}} \pdv{f}{\tau} + + \vu{e}_z \pdv{f}{z} + } +\end{aligned}$$ + +$$\begin{aligned} + \boxed{ + \nabla \cdot \vb{V} + = \frac{1}{\sigma^2 + \tau^2} + \Big( \pdv{(V_\sigma \sqrt{\sigma^2 + \tau^2})}{\sigma} + \pdv{(V_\tau \sqrt{\sigma^2 + \tau^2})}{\tau} \Big) + \pdv{V_z}{z} + } +\end{aligned}$$ + +$$\begin{aligned} + \boxed{ + \nabla^2 f + = \frac{1}{\sigma^2 + \tau^2} \Big( \pdvn{2}{f}{\sigma} + \pdvn{2}{f}{\tau} \Big) + \pdvn{2}{f}{z} + } +\end{aligned}$$ + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \nabla \times \vb{V} + &= \vu{e}_\sigma \Big( \frac{\vu{e}_1}{\sqrt{\sigma^2 + \tau^2}} \pdv{V_z}{\tau} - \pdv{V_\tau}{z} \Big) + \\ + &+ \vu{e}_\tau \Big( \pdv{V_\sigma}{z} - \frac{1}{\sqrt{\sigma^2 + \tau^2}} \pdv{V_z}{\sigma} \Big) + \\ + &+ \frac{\vu{e}_z}{\sigma^2 + \tau^2} + \Big( \pdv{(V_\tau \sqrt{\sigma^2 + \tau^2})}{\sigma} - \pdv{(V_\sigma \sqrt{\sigma^2 + \tau^2})}{\tau} \Big) + \end{aligned} + } +\end{aligned}$$ + +The differential element of volume $\dd{V}$ +in cylindrical parabolic coordinates is given by: + +$$\begin{aligned} + \boxed{ + \dd{V} = (\sigma^2 + \tau^2) \dd{\sigma} \dd{\tau} \dd{z} + } +\end{aligned}$$ + +The differential elements of the isosurfaces are as follows, +where $\dd{S_\sigma}$ is the $\sigma$-isosurface, etc.: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \dd{S_\sigma} &= \sqrt{\sigma^2 + \tau^2} \dd{\tau} \dd{z} + \\ + \dd{S_\tau} &= \sqrt{\sigma^2 + \tau^2} \dd{\sigma} \dd{z} + \\ + \dd{S_z} &= (\sigma^2 + \tau^2) \dd{\sigma} \dd{\tau} + \end{aligned} + } +\end{aligned}$$ + +The normal element $\dd{\vu{S}}$ of a surface and +the tangent element $\dd{\vu{\ell}}$ of a curve are respectively: + +$$\begin{aligned} + \boxed{ + \dd{\vu{S}} + = \vu{e}_\sigma \sqrt{\sigma^2 + \tau^2} \dd{\tau} \dd{z} + + \vu{e}_\tau \sqrt{\sigma^2 + \tau^2} \dd{\sigma} \dd{z} + + \vu{e}_z (\sigma^2 + \tau^2) \dd{\sigma} \dd{\tau} + } +\end{aligned}$$ + +$$\begin{aligned} + \boxed{ + \dd{\vu{\ell}} + = \vu{e}_\sigma \sqrt{\sigma^2 + \tau^2} \dd{\sigma} + + \vu{e}_\tau \sqrt{\sigma^2 + \tau^2} \dd{\tau} + + \vu{e}_z \dd{z} + } +\end{aligned}$$ + + +## References +1. M.L. Boas, + *Mathematical methods in the physical sciences*, 2nd edition, + Wiley. diff --git a/source/know/concept/cylindrical-polar-coordinates/index.md b/source/know/concept/cylindrical-polar-coordinates/index.md new file mode 100644 index 0000000..a91e53e --- /dev/null +++ b/source/know/concept/cylindrical-polar-coordinates/index.md @@ -0,0 +1,200 @@ +--- +title: "Cylindrical polar coordinates" +date: 2021-07-26 +categories: +- Mathematics +- Physics +layout: "concept" +--- + +**Cylindrical polar coordinates** are an extension of polar coordinates to 3D, +which describes the location of a point in space +using the coordinates $(r, \varphi, z)$. +The $z$-axis is unchanged from Cartesian coordinates, +hence it is called a *cylindrical* system. + +Cartesian coordinates $(x, y, z)$ +and the cylindrical system $(r, \varphi, z)$ are related by: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + x &= r \cos\varphi \\ + y &= r \sin\varphi \\ + z &= z + \end{aligned} + } +\end{aligned}$$ + +Conversely, a point given in $(x, y, z)$ +can be converted to $(r, \varphi, z)$ +using these formulae: + +$$\begin{aligned} + \boxed{ + r = \sqrt{x^2 + y^2} + \qquad + \varphi = \mathtt{atan2}(y, x) + \qquad + z = z + } +\end{aligned}$$ + +The cylindrical polar coordinates form an orthogonal +[curvilinear system](/know/concept/curvilinear-coordinates/), +whose scale factors $h_r$, $h_\varphi$ and $h_z$ we want to find. +To do so, we calculate the differentials of the Cartesian coordinates: + +$$\begin{aligned} + \dd{x} = \dd{r} \cos\varphi - \dd{\varphi} r \sin\varphi + \qquad + \dd{y} = \dd{r} \sin\varphi + \dd{\varphi} r \cos\varphi + \qquad + \dd{z} = \dd{z} +\end{aligned}$$ + +And then we calculate the line element $\dd{\ell}^2$, +skipping many terms thanks to orthogonality, + +$$\begin{aligned} + \dd{\ell}^2 + &= \dd{r}^2 \big( \cos^2(\varphi) + \sin^2(\varphi) \big) + + \dd{\varphi}^2 \big( r^2 \sin^2(\varphi) + r^2 \cos^2(\varphi) \big) + + \dd{z}^2 + \\ + &= \dd{r}^2 + r^2 \: \dd{\varphi}^2 + \dd{z}^2 +\end{aligned}$$ + +Finally, we can simply read off +the squares of the desired scale factors +$h_r^2$, $h_\varphi^2$ and $h_z^2$: + +$$\begin{aligned} + \boxed{ + h_r = 1 + \qquad + h_\varphi = r + \qquad + h_z = 1 + } +\end{aligned}$$ + +With these factors, we can easily convert things from the Cartesian system +using the standard formulae for orthogonal curvilinear coordinates. +The basis vectors are: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \vu{e}_r + &= \cos\varphi \:\vu{e}_x + \sin\varphi \:\vu{e}_y + \\ + \vu{e}_\varphi + &= - \sin\varphi \:\vu{e}_x + \cos\varphi \:\vu{e}_y + \\ + \vu{e}_z + &= \vu{e}_z + \end{aligned} + } +\end{aligned}$$ + +The basic vector operations (gradient, divergence, Laplacian and curl) are given by: + +$$\begin{aligned} + \boxed{ + \nabla f + = \vu{e}_r \pdv{f}{r} + + \vu{e}_\varphi \frac{1}{r} \pdv{f}{\varphi} + + \mathbf{e}_z \pdv{f}{z} + } +\end{aligned}$$ + +$$\begin{aligned} + \boxed{ + \nabla \cdot \vb{V} + = \frac{1}{r} \pdv{(r V_r)}{r} + + \frac{1}{r} \pdv{V_\varphi}{\varphi} + + \pdv{V_z}{z} + } +\end{aligned}$$ + +$$\begin{aligned} + \boxed{ + \nabla^2 f + = \frac{1}{r} \pdv{}{r}\Big( r \pdv{f}{r} \Big) + + \frac{1}{r^2} \pdvn{2}{f}{\varphi} + + \pdvn{2}{f}{z} + } +\end{aligned}$$ + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \nabla \times \vb{V} + &= \vu{e}_r \Big( \frac{1}{r} \pdv{V_z}{\varphi} - \pdv{V_\varphi}{z} \Big) + \\ + &+ \vu{e}_\varphi \Big( \pdv{V_r}{z} - \pdv{V_z}{r} \Big) + \\ + &+ \frac{\vu{e}_z}{r} \Big( \pdv{(r V_\varphi)}{r} - \pdv{V_r}{\varphi} \Big) + \end{aligned} + } +\end{aligned}$$ + +The differential element of volume $\dd{V}$ +takes the following form: + +$$\begin{aligned} + \boxed{ + \dd{V} + = r \dd{r} \dd{\varphi} \dd{z} + } +\end{aligned}$$ + +So, for example, an integral over all of space is converted like so: + +$$\begin{aligned} + \iiint_{-\infty}^\infty f(x, y, z) \dd{V} + = \int_{-\infty}^{\infty} \int_0^{2\pi} \int_0^\infty f(r, \varphi, z) \: r \dd{r} \dd{\varphi} \dd{z} +\end{aligned}$$ + +The isosurface elements are as follows, where $S_r$ is a surface at constant $r$, etc.: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \dd{S}_r = r \dd{\varphi} \dd{z} + \qquad + \dd{S}_\varphi = \dd{r} \dd{z} + \qquad + \dd{S}_z = r \dd{r} \dd{\varphi} + \end{aligned} + } +\end{aligned}$$ + +Similarly, the normal vector element $\dd{\vu{S}}$ for an arbitrary surface is given by: + +$$\begin{aligned} + \boxed{ + \dd{\vu{S}} + = \vu{e}_r \: r \dd{\varphi} \dd{z} + + \vu{e}_\varphi \dd{r} \dd{z} + + \vu{e}_z \: r \dd{r} \dd{\varphi} + } +\end{aligned}$$ + +And finally, the tangent vector element $\dd{\vu{\ell}}$ of a given curve is as follows: + +$$\begin{aligned} + \boxed{ + \dd{\vu{\ell}} + = \vu{e}_r \dd{r} + + \vu{e}_\varphi \: r \dd{\varphi} + + \vu{e}_z \dd{z} + } +\end{aligned}$$ + + +## References +1. M.L. Boas, + *Mathematical methods in the physical sciences*, 2nd edition, + Wiley. diff --git a/source/know/concept/debye-length/index.md b/source/know/concept/debye-length/index.md new file mode 100644 index 0000000..9b87585 --- /dev/null +++ b/source/know/concept/debye-length/index.md @@ -0,0 +1,150 @@ +--- +title: "Debye length" +date: 2021-10-18 +categories: +- Physics +- Plasma physics +layout: "concept" +--- + +If a charged object is put in a plasma, +it repels like charges and attracts opposite charges, +leading to a **Debye sheath** around the object's surface +with a net opposite charge. +This has the effect of **shielding** the object's presence +from the rest of the plasma. + +We start from [Gauss' law](/know/concept/maxwells-equations/) +for the [electric field](/know/concept/electric-field/) $\vb{E}$, +expressing $\vb{E}$ as the gradient of a potential $\phi$, +i.e. $\vb{E} = -\nabla \phi$, +and splitting the charge density into ions $n_i$ and electrons $n_e$: + +$$\begin{aligned} + \nabla^2 \phi(\vb{r}) + = - \frac{1}{\varepsilon_0} \Big( q_i n_i(\vb{r}) + q_e n_e(\vb{r}) + q_t \delta(\vb{r}) \Big) +\end{aligned}$$ + +The last term represents a *test particle*, +which will be shielded. +This particle is a point charge $q_t$, +whose density is simply a [Dirac delta function](/know/concept/dirac-delta-function/) $\delta(\vb{r})$, +and is not included in $n_i$ or $n_e$. + +For a plasma in thermal equilibrium, +we have the [Boltzmann relations](/know/concept/boltzmann-relation/) +for the densities: + +$$\begin{aligned} + n_i(\vb{r}) + = n_{i0} \exp\!\bigg( \!-\! \frac{q_i \phi(\vb{r})}{k_B T_i} \bigg) + \qquad \quad + n_e(\vb{r}) + = n_{e0} \exp\!\bigg( \!-\! \frac{q_e \phi(\vb{r})}{k_B T_e} \bigg) +\end{aligned}$$ + +We assume that electrical interactions are weak compared to thermal effects, +i.e. $k_B T \gg q \phi$ in both cases. +Then we Taylor-expand the Boltzmann relations to first order: + +$$\begin{aligned} + n_i(\vb{r}) + \approx n_{i0} \bigg( 1 - \frac{q_i \phi(\vb{r})}{k_B T_i} \bigg) + \qquad \quad + n_e(\vb{r}) + \approx n_{e0} \bigg( 1 - \frac{q_e \phi(\vb{r})}{k_B T_e} \bigg) +\end{aligned}$$ + +Inserting this back into Gauss' law, +we arrive at the following equation for $\phi(\vb{r})$, +where we have assumed quasi-neutrality such that $q_i n_{i0} = q_e n_{e0}$: + +$$\begin{aligned} + \nabla^2 \phi + &= - \frac{1}{\varepsilon_0} + \bigg( q_i n_{i0} - n_{i0} \frac{q_i^2 \phi}{k_B T_i} + q_e n_{e0} - n_{e0} \frac{q_e^2 \phi}{k_B T_e} + q_t \delta(\vb{r}) \bigg) + \\ + &= \bigg( \frac{n_{i0} q_i^2}{\varepsilon_0 k_B T_i} + \frac{n_{e0} q_e^2}{\varepsilon_0 k_B T_e} \bigg) \phi + - \frac{q_t}{\varepsilon_0} \delta(\vb{r}) +\end{aligned}$$ + +We now define the **ion** and **electron Debye lengths** +$\lambda_{Di}$ and $\lambda_{De}$ as follows: + +$$\begin{aligned} + \boxed{ + \frac{1}{\lambda_{Di}^2} + \equiv \frac{n_{i0} q_i^2}{\varepsilon_0 k_B T_i} + } + \qquad \quad + \boxed{ + \frac{1}{\lambda_{De}^2} + \equiv \frac{n_{e0} q_e^2}{\varepsilon_0 k_B T_e} + } +\end{aligned}$$ + +And then the **total Debye length** $\lambda_D$ is defined as the sum of their inverses, +and gives the rough thickness of the Debye sheath: + +$$\begin{aligned} + \boxed{ + \frac{1}{\lambda_D^2} + \equiv \frac{1}{\lambda_{Di}^2} + \frac{1}{\lambda_{De}^2} + = \frac{n_{i0} q_i^2 T_e + n_{e0} q_e^2 T_i}{\varepsilon_0 k_B T_i T_e} + } +\end{aligned}$$ + +With this, the equation can be put in the form below, +suggesting exponential decay: + +$$\begin{aligned} + \nabla^2 \phi(\vb{r}) + &= \frac{1}{\lambda_D^2} \phi(\vb{r}) + - \frac{q_t}{\varepsilon_0} \delta(\vb{r}) +\end{aligned}$$ + +This has the following solution, +known as the **Yukawa potential**, +which decays exponentially, +representing the plasma's **self-shielding** +over a characteristic distance $\lambda_D$: + +$$\begin{aligned} + \boxed{ + \phi(r) + = \frac{q_t}{4 \pi \varepsilon_0 r} \exp\!\Big( \!-\!\frac{r}{\lambda_D} \Big) + } +\end{aligned}$$ + +Note that $r$ is a scalar, +i.e. the potential depends only on the radial distance to $q_t$. +This treatment only makes sense +if the plasma is sufficiently dense, +such that there is a large number of particles +in a sphere with radius $\lambda_D$. +This corresponds to a large [Coulomb logarithm](/know/concept/coulomb-logarithm/) $\ln\!(\Lambda)$: + +$$\begin{aligned} + 1 \ll \frac{4 \pi}{3} n_0 \lambda_D^3 = \frac{2}{9} \Lambda +\end{aligned}$$ + +The name *Yukawa potential* originates from particle physics, +but can in general be used to refer to any potential (electric or energetic) +of the following form: + +$$\begin{aligned} + V(r) + = \frac{A}{r} \exp(-B r) +\end{aligned}$$ + +Where $A$ and $B$ are scaling constants that depend on the problem at hand. + + + +## References +1. P.M. Bellan, + *Fundamentals of plasma physics*, + 1st edition, Cambridge. +2. M. Salewski, A.H. Nielsen, + *Plasma physics: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/density-of-states/index.md b/source/know/concept/density-of-states/index.md new file mode 100644 index 0000000..5b18537 --- /dev/null +++ b/source/know/concept/density-of-states/index.md @@ -0,0 +1,153 @@ +--- +title: "Density of states" +date: 2021-05-08 +categories: +- Physics +- Statistics +layout: "concept" +--- + +The **density of states** $g(E)$ of a physical system is defined such that +$g(E) \dd{E}$ is the number of states which could be occupied +with an energy in the interval $[E, E + \dd{E}]$. +In fact, $E$ need not be an energy; +it should just be something that effectively identifies the state. + +In its simplest form, the density of states is as follows, +where $\Gamma(E)$ is the number of states with energy +less than or equal to the argument $E$: + +$$\begin{aligned} + g(E) + = \dv{\Gamma}{E} +\end{aligned}$$ + +If the states can be treated as waves, +which is often the case, +then we can calculate the density of states $g(k)$ in +$k$-space, i.e. as a function of the wavenumber $k = |\vb{k}|$. +Once we have $g(k)$, we use the dispersion relation $E(k)$ to find $g(E)$, +by demanding that: + +$$\begin{aligned} + g(k) \dd{k} = g(E) \dd{E} + \quad \implies \quad + g(E) + = g(k) \dv{k}{E} +\end{aligned}$$ + +Inverting the dispersion relation $E(k)$ to get $k(E)$ might be difficult, +in which case the left-hand equation can be satisfied numerically. + + +Define $\Omega_n(k)$ as the number of states with +a $k$-value less than or equal to the argument, +or in other words, the volume of a hypersphere with radius $k$. +Then the $n$-dimensional density of states $g_n(k)$ +has the following general form: + +$$\begin{aligned} + \boxed{ + g_n(k) + = \frac{D}{2^n k_{\mathrm{min}}^n} \: \dv{\Omega_n}{k} + } +\end{aligned}$$ + +Where $D$ is each state's degeneracy (e.g. due to spin), +and $k_{\mathrm{min}}$ is the smallest allowed $k$-value, +according to the characteristic length $L$ of the system. +We divide by $2^n$ to limit ourselves to the sector where all axes are positive, +because we are only considering the magnitude of $k$. + +In one dimension $n = 1$, the number of states within a distance $k$ from the +origin is the distance from $k$ to $-k$ +(we let it run negative, since its meaning does not matter here), given by: + +$$\begin{aligned} + \Omega_1(k) + = 2 k +\end{aligned}$$ + +To get $k_{\mathrm{min}}$, we choose to look at a rod of length $L$, +across which the function is a standing wave, meaning that +the allowed values of $k$ must be as follows, where $m \in \mathbb{N}$: + +$$\begin{aligned} + \lambda = \frac{2 L}{m} + \quad \implies \quad + k = \frac{2 \pi}{\lambda} = \frac{m \pi}{L} +\end{aligned}$$ + +Take the smallest option $m = 1$, +such that $k_{\mathrm{min}} = \pi / L$, +the 1D density of states $g_1(k)$ is: + +$$\begin{aligned} + \boxed{ + g_1(k) + = \frac{D L}{2 \pi} \: 2 + = \frac{D L}{\pi} + } +\end{aligned}$$ + +In 2D, the number of states within a range $k$ of the +origin is the area of a circle with radius $k$: + +$$\begin{aligned} + \Omega_2(k) + = \pi k^2 +\end{aligned}$$ + +Analogously to the 1D case, +we take the system to be a square of side $L$, +so $k_{\mathrm{min}} = \pi / L$ again. +The density of states then becomes: + +$$\begin{aligned} + \boxed{ + g_2(k) + = \frac{D L^2}{4 \pi^2} \:2 \pi k + = \frac{D L^2 k}{2 \pi} + } +\end{aligned}$$ + +In 3D, the number of states is the volume of a sphere with radius $k$: + +$$\begin{aligned} + \Omega_3(k) + = \frac{4 \pi}{3} k^3 +\end{aligned}$$ + +For a cube with side $L$, we once again find $k_{\mathrm{min}} = \pi / L$. +We thus get: + +$$\begin{aligned} + \boxed{ + g_3(k) + = \frac{D L^3}{8 \pi^3} \:4 \pi k^2 + = \frac{D L^3 k^2}{2 \pi^2} + } +\end{aligned}$$ + +All these expressions contain the characteristic length/area/volume $L^n$, +and therefore give the number of states in that region only. +Keep in mind that $L$ is free to choose; +it need not be the physical size of the system. +In fact, we typically want the density of states +per unit length/area/volume, +so we can just set $L = 1$ in our preferred unit of distance. + +If the system is infinitely large, or if it has periodic boundaries, +then $k$ becomes a continuous variable and $k_\mathrm{min} \to 0$. +But again, $L$ is arbitrary, +so a finite value can be chosen. + + + +## References +1. H. Gould, J. Tobochnik, + *Statistical and thermal physics*, 2nd edition, + Princeton. +2. B. Van Zeghbroeck, + [Principles of semiconductor devices](https://ecee.colorado.edu/~bart/book/book/chapter2/ch2_4.htm), 2011, + University of Colorado. diff --git a/source/know/concept/density-operator/index.md b/source/know/concept/density-operator/index.md new file mode 100644 index 0000000..ece712c --- /dev/null +++ b/source/know/concept/density-operator/index.md @@ -0,0 +1,131 @@ +--- +title: "Density operator" +date: 2021-03-03 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +In quantum mechanics, the expectation value of an observable +$\expval{\hat{L}}$ represents the average result from measuring +$\hat{L}$ on a large number of systems (an **ensemble**) +prepared in the same state $\Ket{\Psi}$, +known as a **pure ensemble** or (somewhat confusingly) **pure state**. + +But what if the systems of the ensemble are not all in the same state? +To work with such a **mixed ensemble** or **mixed state**, +the **density operator** $\hat{\rho}$ or **density matrix** (in a basis) is useful. +It is defined as follows, where $p_n$ is the probability +that the system is in state $\Ket{\Psi_n}$, +i.e. the proportion of systems in the ensemble that are +in state $\Ket{\Psi_n}$: + +$$\begin{aligned} + \boxed{ + \hat{\rho} + = \sum_{n} p_n \Ket{\Psi_n} \Bra{\Psi_n} + } +\end{aligned}$$ + +Do not let is this form fool you into thinking that $\hat{\rho}$ is diagonal: +$\Ket{\Psi_n}$ need not be basis vectors. +Instead, the matrix elements of $\hat{\rho}$ are found as usual, +where $\Ket{j}$ and $\Ket{k}$ are basis vectors: + +$$\begin{aligned} + \matrixel{j}{\hat{\rho}}{k} + = \sum_{n} p_n \Inprod{j}{\Psi_n} \Inprod{\Psi_n}{k} +\end{aligned}$$ + +However, from the special case where $\Ket{\Psi_n}$ are indeed basis vectors, +we can conclude that $\hat{\rho}$ is positive semidefinite and Hermitian, +and that its trace (i.e. the total probability) is 100%: + +$$\begin{gathered} + \boxed{ + \hat{\rho} \ge 0 + } + \qquad \qquad + \boxed{ + \hat{\rho}^\dagger = \hat{\rho} + } + \qquad \qquad + \boxed{ + \mathrm{Tr}(\hat{\rho}) = 1 + } +\end{gathered}$$ + +These properties are preserved by all changes of basis. +If the ensemble is purely $\Ket{\Psi}$, +then $\hat{\rho}$ is given by a single state vector: + +$$\begin{aligned} + \hat{\rho} = \Ket{\Psi} \Bra{\Psi} +\end{aligned}$$ + +From the special case where $\Ket{\Psi}$ is a basis vector, +we can conclude that for a pure ensemble, +$\hat{\rho}$ is idempotent, which means that: + +$$\begin{aligned} + \hat{\rho}^2 = \hat{\rho} +\end{aligned}$$ + +This can be used to find out whether a given $\hat{\rho}$ +represents a pure or mixed ensemble. + +Next, we define the ensemble average $\expval{\hat{O}}$ +as the mean of the expectation values of $\hat{O}$ for states in the ensemble. +We use the same notation as for the pure expectation value, +since this is only a small extension of the concept to mixed ensembles. +It is calculated like so: + +$$\begin{aligned} + \boxed{ + \expval{\hat{O}} + = \sum_{n} p_n \matrixel{\Psi_n}{\hat{O}}{\Psi_n} + = \mathrm{Tr}(\hat{\rho} \hat{O}) + } +\end{aligned}$$ + +To prove the latter, +we write out the trace $\mathrm{Tr}$ as the sum of the diagonal elements, so: + +$$\begin{aligned} + \mathrm{Tr}(\hat{\rho} \hat{O}) + &= \sum_{j} \matrixel{j}{\hat{\rho} \hat{O}}{j} + = \sum_{j} \sum_{n} p_n \Inprod{j}{\Psi_n} \matrixel{\Psi_n}{\hat{O}}{j} + \\ + &= \sum_{n} \sum_{j} p_n\matrixel{\Psi_n}{\hat{O}}{j} \Inprod{j}{\Psi_n} + = \sum_{n} p_n \matrixel{\Psi_n}{\hat{O} \hat{I}}{\Psi_n} + = \expval{\hat{O}} +\end{aligned}$$ + +In both the pure and mixed cases, +if the state probabilities $p_n$ are constant with respect to time, +then the evolution of the ensemble obeys the **Von Neumann equation**: + +$$\begin{aligned} + \boxed{ + i \hbar \dv{\hat{\rho}}{t} = \comm{\hat{H}}{\hat{\rho}} + } +\end{aligned}$$ + +This equivalent to the Schrödinger equation: +one can be derived from the other. +We differentiate $\hat{\rho}$ with the product rule, +and then substitute the opposite side of the Schrödinger equation: + +$$\begin{aligned} + i \hbar \dv{\hat{\rho}}{t} + &= i \hbar \dv{}{t}\sum_n p_n \Ket{\Psi_n} \Bra{\Psi_n} + \\ + &= \sum_n p_n \Big( i \hbar \dv{}{t}\Ket{\Psi_n} \Big) \Bra{\Psi_n} + \sum_n p_n \Ket{\Psi_n} \Big( i \hbar \dv{}{t}\Bra{\Psi_n} \Big) + \\ + &= \sum_n p_n \ket{\hat{H} n} \Bra{n} - \sum_n p_n \Ket{n} \bra{\hat{H} n} + = \hat{H} \hat{\rho} - \hat{\rho} \hat{H} + = \comm{\hat{H}}{\hat{\rho}} +\end{aligned}$$ + + diff --git a/source/know/concept/detailed-balance/index.md b/source/know/concept/detailed-balance/index.md new file mode 100644 index 0000000..b7d5386 --- /dev/null +++ b/source/know/concept/detailed-balance/index.md @@ -0,0 +1,232 @@ +--- +title: "Detailed balance" +date: 2021-11-27 +categories: +- Physics +- Mathematics +- Stochastic analysis +layout: "concept" +--- + +Consider a system that can be regarded as a +[Markov process](/know/concept/markov-process/), +which means that its components (e.g. particles) are transitioning +between a known set of states, +with no history-dependence and no appreciable influence from interactions. + +At equilibrium, the principle of **detailed balance** then says that +for all states, the rate of leaving that state is exactly equal to +the rate of entering it, for every possible transition. +In effect, such a system looks "frozen" to an outside observer, +since all net transition rates are zero. + +We will focus on the case where both time and the state space are continuous. +Given some initial conditions, +assume that a component's trajectory can be described +as an [Itō diffusion](/know/concept/ito-calculus/) $X_t$ +with a time-independent drift $f$ and intensity $g$, +and with a probability density $\phi(t, x)$ governed by the +[forward Kolmogorov equation](/know/concept/kolmogorov-equations/) +(in 3D): + +$$\begin{aligned} + \pdv{\phi}{t} + = - \nabla \cdot \big( \vb{u} \phi - D \nabla \phi \big) +\end{aligned}$$ + +We start by demanding **stationarity**, +which is a weaker condition than detailed balance. +We want the probability $P$ of being in an arbitrary state volume $V$ +to be constant in time: + +$$\begin{aligned} + 0 + = \pdv{}{t}P(X_t \in V) + = \pdv{}{t}\int_V \phi \dd{V} + = \int_V \pdv{\phi}{t} \dd{V} +\end{aligned}$$ + +We substitute the forward Kolmogorov equation, +and apply the divergence theorem: + +$$\begin{aligned} + 0 + = - \int_V \nabla \cdot \big( \vb{u} \phi - D \nabla \phi \big) \dd{V} + = - \oint_{\partial V} \big( \vb{u} \phi - D \nabla \phi \big) \cdot \dd{\vb{S}} +\end{aligned}$$ + +In other words, the "flow" of probability *into* the volume $V$ +is equal to the flow *out of* $V$. +If such a probability density exists, +it is called a **stationary distribution** $\phi(t, x) = \pi(x)$. +Because $V$ was arbitrary, $\pi$ can be found by solving: + +$$\begin{aligned} + 0 + = - \nabla \cdot \big( \vb{u} \pi - D \nabla \pi \big) +\end{aligned}$$ + +Therefore, stationarity means that the state transition rates are constant. +To get detailed balance, however, we demand that +the transition rates are zero everywhere: +the probability flux through an arbitrary surface $S$ must vanish +(compare to closed surface integral above): + +$$\begin{aligned} + 0 + = - \int_{S} \big( \vb{u} \phi - D \nabla \phi \big) \cdot \dd{\vb{S}} +\end{aligned}$$ + +And since $S$ is arbitrary, this is only satisfied if the flux is trivially zero +(the above justification can easily be repeated in 1D, 2D, 4D, etc.): + +$$\begin{aligned} + \boxed{ + 0 = \vb{u} \phi - D \nabla \phi + } +\end{aligned}$$ + +This is a stronger condition that stationarity, +but fortunately often satisfied in practice. + +The fact that a system in detailed balance appears "frozen" +implies it is **time-reversible**, +meaning its statistics are the same for both directions of time. +Formally, given two arbitrary functions $h(x)$ and $k(x)$, +we have the property: + +$$\begin{aligned} + \boxed{ + \mathbf{E}\big[ h(X_0) \: k(X_t) \big] + = \mathbf{E}\big[ h(X_t) \: k(X_0) \big] + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-reversibility"/> +<label for="proof-reversibility">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-reversibility">Proof.</label> +Consider the following weighted inner product, +whose weight function is a stationary distribution $\pi$ +satisfying detailed balance, +where $\hat{L}$ is the Kolmogorov operator: + +$$\begin{aligned} + \inprod{\hat{L} h}{k}_\pi + \equiv \int_{-\infty}^\infty \hat{L}\{h(x)\} \: \pi(x) \: k(x) \dd{x} + = \int_{-\infty}^\infty h(x) \: \hat{L}{}^\dagger\{\pi(x) k(x)\} \dd{x} +\end{aligned}$$ + +Where we have used the definition of an adjoint operator. +We would like to rewrite this: + +$$\begin{aligned} + \hat{L}{}^\dagger \{\pi k\} + = -\nabla \cdot \big( \vb{u} \pi k - D \nabla(\pi k) \big) + = -\nabla \cdot (\vb{u} \pi k - D k \nabla \pi - D \pi \nabla k) +\end{aligned}$$ + +Since $\pi$ is stationary by definition, +we know that $\nabla \cdot (\vb{u} \pi - D \nabla \pi) = 0$, +meaning: + +$$\begin{aligned} + \hat{L}{}^\dagger \{\pi k\} + = \nabla \cdot (D \pi \nabla k) + = \nabla \pi \cdot (D \nabla k) + \pi \nabla \cdot (D \nabla k) +\end{aligned}$$ + +Detailed balance demands that $\vb{u} \pi = D \nabla \pi$, +leading to the following: + +$$\begin{aligned} + \hat{L}{}^\dagger \{\pi k\} + &= D \nabla \pi \cdot \nabla k + \pi \nabla \cdot (D \nabla k) + = \pi \vb{u} \cdot \nabla k + \pi \nabla \cdot (D \nabla k) + \\ + &= \pi \big( \vb{u} \cdot \nabla k + \nabla \cdot (D \nabla k) \big) + = \pi \hat{L}\{k\} +\end{aligned}$$ + +Where we recognized the definition of $\hat{L}$ +from the backward Kolmogorov equation. +Now that we have established that $\hat{L}{}^\dagger\{\pi k\} = \pi \hat{L}\{k\}$, +we return to the inner product: + +$$\begin{aligned} + \inprod{\hat{L} h}{k}_\pi + = \int_{-\infty}^\infty h(x) \: \pi(x) \: \hat{L}\{k(x)\} \dd{x} + = \inprod{h}{\hat{L} k}_\pi +\end{aligned}$$ + +Consequently, the following weighted inner products must also be equivalent: + +$$\begin{aligned} + \Inprod{\exp(t \hat{L}) h}{k}_\pi + = \Inprod{h}{\exp(t \hat{L}) k}_\pi +\end{aligned}$$ + +Now, consider the time evolution of the +[conditional expectation](/know/concept/conditional-expectation/) +$\mathbf{E}\big[ k(X_t) | X_0 \big]$: + +$$\begin{aligned} + \pdv{}{t}\mathbf{E}\big[ k(X_t) | X_0 \big] + &= \pdv{}{t}\int_{-\infty}^\infty k(x) \: \phi(t, x) \dd{x} + = \int_{-\infty}^\infty k \pdv{\phi}{t} \dd{x} + \\ + &= \int_{-\infty}^\infty k \: \hat{L}{}^\dagger\{\phi\} \dd{x} + = \int_{-\infty}^\infty \hat{L}\{k\} \: \phi \dd{x} + = \mathbf{E}\big[ \hat{L}\{k(X_t)\} | X_0 \big] +\end{aligned}$$ + +Where we used the forward Kolmogorov equation +and the definition of an adjoint operator. +Therefore, since the expectation $\mathbf{E}$ +does not explicitly depend on $t$ (only implicitly via $X_t$), +we can naively move the differentiation inside +(only valid within $\mathbf{E}$): + +$$\begin{aligned} + \pdv{}{t}\mathbf{E}\big[ k(X_t) | X_0 \big] + = \mathbf{E}\bigg[ \pdv{k(X_t)}{t} \bigg| X_0 \bigg] + = \mathbf{E}\bigg[ \hat{L}\{k(X_0)\} \bigg| X_0 \bigg] +\end{aligned}$$ + +A differential equation of the form $\ipdv{k}{t} = \hat{L}\{k(t, x)\}$ +for a time-independent operator $\hat{L}$ +has a general solution $k(t, x) = \exp(t \hat{L})\{k(0,x)\}$, +therefore: + +$$\begin{aligned} + \mathbf{E}\big[ k(X_t) \big| X_0 \big] + = \mathbf{E}\big[ \exp(t \hat{L})\{k(X_0)\} \big| X_0 \big] + = \exp(t \hat{L})\{k(X_0)\} +\end{aligned}$$ + +With this, we can evaluate the two weighted inner products from earlier, +which we know are equal to each other. +Using the *tower property* of the conditional expectation: + +$$\begin{aligned} + \Inprod{h}{\exp(t \hat{L}) k}_\pi + &= \mathbf{E}\big[ h(X_0) \: \mathbf{E}[k(X_t) | X_0] \big] + = \mathbf{E}\big[ h(X_0) \: k(X_t) \big] + \\ + = \Inprod{\exp(t \hat{L}) h}{k}_\pi + &= \mathbf{E}\big[ \mathbf{E}[h(X_t) | X_0] \: k(X_0) \big] + = \mathbf{E}\big[ h(X_t) \: k(X_0) \big] +\end{aligned}$$ + +Where the integral gave the expectation value at $X_0$, +since $\pi$ does not change in time. +</div> +</div> + + + +## References +1. U.H. Thygesen, + *Lecture notes on diffusions and stochastic differential equations*, + 2021, Polyteknisk Kompendie. diff --git a/source/know/concept/deutsch-jozsa-algorithm/deutsch-circuit.png b/source/know/concept/deutsch-jozsa-algorithm/deutsch-circuit.png Binary files differnew file mode 100644 index 0000000..0c6c7b2 --- /dev/null +++ b/source/know/concept/deutsch-jozsa-algorithm/deutsch-circuit.png diff --git a/source/know/concept/deutsch-jozsa-algorithm/deutsch-jozsa-circuit.png b/source/know/concept/deutsch-jozsa-algorithm/deutsch-jozsa-circuit.png Binary files differnew file mode 100644 index 0000000..335a624 --- /dev/null +++ b/source/know/concept/deutsch-jozsa-algorithm/deutsch-jozsa-circuit.png diff --git a/source/know/concept/deutsch-jozsa-algorithm/index.md b/source/know/concept/deutsch-jozsa-algorithm/index.md new file mode 100644 index 0000000..080b290 --- /dev/null +++ b/source/know/concept/deutsch-jozsa-algorithm/index.md @@ -0,0 +1,229 @@ +--- +title: "Deutsch-Jozsa algorithm" +date: 2021-04-08 +categories: +- Quantum information +- Algorithms +layout: "concept" +--- + +The **Deutsch algorithm** and its extension, the **Deutsch-Jozsa algorithm**, +were first to prove that quantum computers can +solve certain problems more efficiently +than any classical system. + +Given an unknown "black box" binary function $f(x)$ of one or more bits $x$, +the goal is determine whether $f$ is +**constant** (i.e. $f(x)$ is the same for all $x$) +or **balanced** (i.e. exactly 50% of all $x$-values yield $f(x) = 0$, +and the other 50% yield $f(x) = 1$). +We can query $f$ as many times as we want with inputs of our choice, +but we want to solve the problem using as few queries as possible. + +The problem is extremely artificial and of no practical use, +but quantum computers can solve it with a single query, +while classical computers need up to $2^{N - 1} + 1$ queries +for an $N$-bit $x$. + + +## Deutsch algorithm + +The Deutsch algorithm handles the simplest case, +where $x$ is only a single bit. +Only four $f$ exist: + ++ **Constant**: $(f(0) = f(1) = 0)$ or $(f(0) = f(1) = 1)$. ++ **Balanced**: $(f(0) = 0, f(1) = 1)$, or $(f(0) = 1, f(1) = 0)$. + +In other words, we only need to determine if $f(0) = f(1)$ or $f(0) \neq f(1)$. +To do this, we use the following quantum circuit, +where $U_f$ is the oracle we query: + +<a href="deutsch-circuit.png"> +<img src="deutsch-circuit.png" style="width:48%"> +</a> + +Due to unitarity constraints, +the action of $U_f$ is defined to be as follows, +with $\oplus$ meaning XOR: + +$$\begin{aligned} + \Ket{x} \Ket{y} + \quad \to \boxed{U_f} \to \quad + \Ket{x} \Ket{y \oplus f(x)} +\end{aligned}$$ + +Starting on the left from two qubits $\Ket{0}$ and $\Ket{1}$, +we apply the [Hadamard gate](/know/concept/quantum-gate/) $H$ to both: + +$$\begin{aligned} + \Ket{0} \Ket{1} + \quad \to \boxed{H^{\otimes 2}} \to \quad + \Ket{+} \Ket{-} + = \frac{1}{2} \Big( \Ket{0} + \Ket{1} \Big) \Big( \Ket{0} - \Ket{1} \Big) +\end{aligned}$$ + +Feeding this result into the oracle $U_f$ then leads us to: + +$$\begin{aligned} + \to \boxed{U_f} \to \quad + \frac{1}{2} \Ket{0} \Big( \Ket{0 \oplus f(0)} - \Ket{1 \oplus f(0)} \Big) + + \frac{1}{2} \Ket{1} \Big( \Ket{0 \oplus f(1)} - \Ket{1 \oplus f(1)} \Big) +\end{aligned}$$ + +The parenthesized superpositions can be reduced. +Assuming that $f(b) = 0$, we notice: + +$$\begin{aligned} + \Ket{0 \oplus f(b)} - \Ket{1 \oplus f(b)} + = \Ket{0 \oplus 0} - \Ket{1 \oplus 0} + = \Ket{0} - \Ket{1} +\end{aligned}$$ + +On the other hand, if we assume that $f(b) = 1$, +we get the opposite result: + +$$\begin{aligned} + \Ket{0 \oplus f(b)} - \Ket{1 \oplus f(b)} + = \Ket{0 \oplus 1} - \Ket{1 \oplus 1} + = - \big(\Ket{0} - \Ket{1}\big) +\end{aligned}$$ + +We can thus combine both cases, $f(b) = 0$ or $f(b) = 1$, +into the following single expression: + +$$\begin{aligned} + \Ket{0 \oplus f(b)} - \Ket{1 \oplus f(b)} + = (-1)^{f(b)} \big(\Ket{0} - \Ket{1}\big) +\end{aligned}$$ + +Using this, we rewrite the intermediate state of the quantum circuit like so: + +$$\begin{aligned} + \Ket{0} \Ket{1} + \quad \to \boxed{H^{\otimes 2}} \to \boxed{U_f} \to \quad + \frac{1}{2} \Big( (-1)^{f(0)} \Ket{0} + (-1)^{f(1)} \Ket{1} \Big) \Big( \Ket{0} - \Ket{1} \Big) +\end{aligned}$$ + +The second qubit in state $\Ket{-}$ is garbage; it is no longer of interest. +The first qubit is given by: + +$$\begin{aligned} + \frac{1}{\sqrt{2}} \Big( (-1)^{f(0)} \Ket{0} + (-1)^{f(1)} \Ket{1} \Big) + = \frac{(-1)^{f(0)}}{\sqrt{2}} \Big( \Ket{0} + (-1)^{f(0) \oplus f(1)} \Ket{1} \Big) +\end{aligned}$$ + +If $f$ is constant, then $f(0) \oplus f(1) = 0$, +meaning this state is $(-1)^{f(0)} \Ket{+}$. +On the other hand, if $f$ is balanced, then $f(0) \oplus f(1) = 1$, +meaning this state is $(-1)^{f(0)} \Ket{-}$. +Taking the Hadamard transform of this qubit therefore yields: + +$$\begin{aligned} + \to \boxed{H} \to \quad + (-1)^{f(0)} \Ket{f(0) \oplus f(1)} +\end{aligned}$$ + +Depending on whether $f$ is constant or balanced, +the mearurement outcome of this state will be $\Ket{0}$ or $\Ket{1}$ +with 100\% probability. We have solved the problem! + +Note that we only consulted the oracle (i.e. applied $U_f$) once. +A classical computer would need to query it twice, +once with input $x = 0$, and again with $x = 1$. + + +## Full Deutsch-Jozsa algorithm + +The Deutsch-Jozsa algorithm generalizes the above to $N$-bit inputs $x$. +We are promised that $f(x)$ is either constant or balanced; +other possibilities are assumed to be impossible. +This algorithm is then implemented by the following quantum circuit: + +<a href="deutsch-jozsa-circuit.png"> +<img src="deutsch-jozsa-circuit.png" style="width:52%"> +</a> + +There are $N$ qubits in initial state $\Ket{0}$, and one in $\Ket{1}$. +For clarity, the oracle $U_f$ works like so: + +$$\begin{aligned} + \Ket{x_1} \Ket{x_2} \cdots \Ket{x_N} \Ket{y} + \quad \to \boxed{U_f} \to \quad + \Ket{x_1} \cdots \Ket{x_N} \Ket{y \oplus f(x_1, ..., x_N)} +\end{aligned}$$ + +Applying the $N + 1$ Hadamard gates to the initial state +yields the following superposition: + +$$\begin{aligned} + \Ket{0}^{\otimes N} \Ket{1} + \quad \to \boxed{H^{\otimes N + 1}} \to \quad + \Ket{+}^{\otimes N} \Ket{-} + = \frac{1}{\sqrt{2^N}} \sum_{x = 0}^{2^N - 1} \Ket{x} \Ket{-} +\end{aligned}$$ + +Where $\Ket{x} = \Ket{x_1} \cdots \Ket{x_N}$ denotes a classical binary state. +For example, if $x = 5 = 2^0 + 2^2$ in the summation, +then $\Ket{x} = \Ket{1} \Ket{0} \Ket{1} \Ket{0}^{\otimes N-3}$ +(from least to most significant). + +We give this state to the oracle, +and, by the same logic as for the Deutsch algorithm, +get back: + +$$\begin{aligned} + \to \boxed{U_f} \to \quad + \frac{1}{\sqrt{2^N}} \sum_{x = 0}^{2^N - 1} (-1)^{f(x)} \Ket{x} \Ket{-} +\end{aligned}$$ + +The last qubit $\Ket{-}$ is garbage. +Next, applying the Hadamard transform to the other $N$ gives: + +$$\begin{aligned} + \to \boxed{H^{\otimes N}} \to \quad + \frac{1}{\sqrt{2^N}} \sum_{x = 0}^{2^N - 1} (-1)^{f(x)} + \bigg( \frac{1}{\sqrt{2^N}} \sum_{y = 0}^{2^N - 1} (-1)^{x \cdot y} \Ket{y} \bigg) +\end{aligned}$$ + +Where $x \cdot y$ is the bitwise dot product of the binary representations of $x$ and $y$, +so, for example, if $N = 2$, then $x \cdot y = x_1 y_1 + x_2 y_2$. +Note that the above expression has not been reduced at all; +it follows from the definition of the Hadamard transform. +We can rewrite it like so: + +$$\begin{aligned} + \frac{1}{2^N} \sum_{x = 0}^{2^N - 1} \sum_{y = 0}^{2^N - 1} (-1)^{f(x) + x \cdot y} \Ket{y} + = \sum_{y = 0}^{2^N - 1} \bigg( \frac{1}{2^N} \sum_{x = 0}^{2^N - 1} (-1)^{f(x) + x \cdot y} \bigg) \Ket{y} + = \sum_{y = 0}^{2^N - 1} c_y \Ket{y} +\end{aligned}$$ + +The parenthesized expression can be interpreted as the coefficients +of a superposition of several $y$-values. +Therefore, the probability that a measurement yields $y = 0$, +i.e. $\Ket{y} = \Ket{0}^{\otimes N}$, is: + +$$\begin{aligned} + |c_0|^2 + = \bigg| \frac{1}{2^N} \sum_{x = 0}^{2^N - 1} (-1)^{f(x)} \bigg|^2 +\end{aligned}$$ + +The summation always contains an even number of terms, for all values of $N$. +Consequently, if $f$ is constant, then $|c_0|^2 = |\!\pm\! 2^N / 2^N|^2 = 1$. +Otherwise, if $f$ is balanced, all the terms cancel out, so we are left with $|c_0|^2 = 0$. +In other words, we reach the same result as the Deutsch algorithm: +we only need to measure the $N$ qubits once; +$f$ is constant if and only if all are zero. + +The Deutsch-Jozsa algorithm needs only one oracle query to give an error-free result, +whereas a classical computer needs $2^{N-1} + 1$ queries in the worst case; +a revolutionary discovery. + + +## References +1. J.S. Neergaard-Nielsen, + *Quantum information: lectures notes*, + 2021, unpublished. +2. S. Aaronson, + *Introduction to quantum information science: lecture notes*, + 2018, unpublished. diff --git a/source/know/concept/dielectric-function/index.md b/source/know/concept/dielectric-function/index.md new file mode 100644 index 0000000..7bee0cf --- /dev/null +++ b/source/know/concept/dielectric-function/index.md @@ -0,0 +1,138 @@ +--- +title: "Dielectric function" +date: 2022-01-24 +categories: +- Physics +- Electromagnetism +- Quantum mechanics +layout: "concept" +--- + +The **dielectric function** or **relative permittivity** $\varepsilon_r$ +is a measure of how strongly a given medium counteracts +[electric fields](/know/concept/electric-field/) compared to a vacuum. +Let $\vb{D}$ be the applied external field, +and $\vb{E}$ the effective field inside the material: + +$$\begin{aligned} + \boxed{ + \vb{D} = \varepsilon_0 \varepsilon_r \vb{E} + } +\end{aligned}$$ + +If $\varepsilon_r$ is large, then $\vb{D}$ is strongly suppressed, +because the material's electrons and nuclei move to create an opposing field. +In order for $\varepsilon_r$ to be well defined, we only consider linear media, +where the induced polarization $\vb{P}$ is proportional to $\vb{E}$. + +We would like to find an alternative definition of $\varepsilon_r$. +Consider that the usual electric fields $\vb{E}$, $\vb{D}$, and $\vb{P}$ +can each be written as the gradient of an electrostatic potential like so, +where $\Phi_\mathrm{tot}$, $\Phi_\mathrm{ext}$ and $\Phi_\mathrm{ind}$ +are the total, external and induced potentials, respectively: + +$$\begin{aligned} + \vb{E} + = -\nabla \Phi_\mathrm{tot} + \qquad \qquad + \vb{D} + = - \varepsilon_0 \nabla \Phi_\mathrm{ext} + \qquad \qquad + \vb{P} + = \varepsilon_0 \nabla \Phi_\mathrm{ind} +\end{aligned}$$ + +Such that $\Phi_\mathrm{tot} = \Phi_\mathrm{ext} + \Phi_\mathrm{ind}$. +Inserting this into $\vb{D} = \varepsilon_0 \varepsilon_r \vb{E}$ +then suggests defining: + +$$\begin{aligned} + \boxed{ + \varepsilon_r + \equiv \frac{\Phi_\mathrm{ext}}{\Phi_\mathrm{tot}} + } +\end{aligned}$$ + + +## From induced charge density + +A common way to calculate $\varepsilon_r$ is from +the induced charge density $\rho_\mathrm{ind}$, +i.e. the offset caused by the material's particles responding to the field. +We start from [Gauss' law](/know/concept/maxwells-equations/) for $\vb{P}$: + +$$\begin{aligned} + \nabla \cdot \vb{P} + = \varepsilon_0 \nabla^2 \Phi_\mathrm{ind}(\vb{r}) + = - \rho_\mathrm{ind}(\vb{r}) +\end{aligned}$$ + +This is Poisson's equation, which has the following well-known +[Fourier transform](/know/concept/fourier-transform/): + +$$\begin{aligned} + \Phi_\mathrm{ind}(\vb{q}) + = \frac{\rho_\mathrm{ind}(\vb{q})}{\varepsilon_0 |\vb{q}|^2} + = V(\vb{q}) \: \rho_\mathrm{ind}(\vb{q}) +\end{aligned}$$ + +Where $V(\vb{q})$ represents Coulomb interactions, +and $V(0) = 0$ to ensure overall neutrality: + +$$\begin{aligned} + V(\vb{q}) + = \frac{1}{\varepsilon_0 |\vb{q}|^2} + \qquad \implies \qquad + V(\vb{r} - \vb{r}') + = \frac{1}{4 \pi \varepsilon_0 |\vb{r} - \vb{r}'|} +\end{aligned}$$ + +The [convolution theorem](/know/concept/convolution-theorem/) +then gives us the solution $\Phi_\mathrm{ind}$ in the $\vb{r}$-domain: + +$$\begin{aligned} + \Phi_\mathrm{ind}(\vb{r}) + = (V * \rho_\mathrm{ind})(\vb{r}) + = \int_{-\infty}^\infty V(\vb{r} - \vb{r}') \: \rho_\mathrm{ind}(\vb{r}') \dd{\vb{r}'} +\end{aligned}$$ + +To proceed, we need to find an expression for $\rho_\mathrm{ind}$ +that is proportional to $\Phi_\mathrm{tot}$ or $\Phi_\mathrm{ext}$, +or some linear combination thereof. +Such an expression must exist for a linear material. + +Suppose we can show that $\rho_\mathrm{ind} = C_\mathrm{ext} \Phi_\mathrm{ext}$, +for some $C_\mathrm{ext}$, which may depend on $\vb{q}$. Then: + +$$\begin{aligned} + \Phi_\mathrm{tot} + = (1 + C_\mathrm{ext} V) \Phi_\mathrm{ext} + \quad \implies \quad + \boxed{ + \varepsilon_r(\vb{q}) + = \frac{1}{1 + C_\mathrm{ext}(\vb{q}) V(\vb{q})} + } +\end{aligned}$$ + +Similarly, suppose we can show that $\rho_\mathrm{ind} = C_\mathrm{tot} \Phi_\mathrm{tot}$, +for some quantity $C_\mathrm{tot}$, then: + +$$\begin{aligned} + \Phi_\mathrm{ext} + = (1 - C_\mathrm{tot} V) \Phi_\mathrm{tot} + \quad \implies \quad + \boxed{ + \varepsilon_r(\vb{q}) + = 1 - C_\mathrm{tot}(\vb{q}) V(\vb{q}) + } +\end{aligned}$$ + + + +## References +1. H. Bruus, K. Flensberg, + *Many-body quantum theory in condensed matter physics*, + 2016, Oxford. +2. M. Fox, + *Optical properties of solids*, 2nd edition, + Oxford. diff --git a/source/know/concept/diffie-hellman-key-exchange/index.md b/source/know/concept/diffie-hellman-key-exchange/index.md new file mode 100644 index 0000000..0947e29 --- /dev/null +++ b/source/know/concept/diffie-hellman-key-exchange/index.md @@ -0,0 +1,75 @@ +--- +title: "Diffie-Hellman key exchange" +date: 2021-03-06 +categories: +- Cryptography +layout: "concept" +--- + +In cryptography, the **Diffie-Hellman key exchange** is a method +for two parties to securely agree on an encryption key, +when they can only communicate over an insecure channel. + +The fundamental assumption of the Diffie-Hellman scheme, +upon which its security rests, +is that the following function $f(n)$ is a **trapdoor function**, +which means that calculating $f$ is easy, +but its inverse $f^{-1}$ is extremely hard to find: + +$$\begin{aligned} + f(n) = g^n \bmod p +\end{aligned}$$ + +Where $n$ is a natural number, and $p$ is a prime. +The natural number $g$ is a so-called *primitive root modulo* $p$. +Importantly, $g$ and $p$ have been specifically chosen +such that $f(n)$ can take any value in $\{1, ..., p \!-\! 1\}$ +for $n$ in $\{0, ..., p \!-\! 2\}$. +The trapdoor assumption is that, given $g$, $p$ and $f(n)$, +there is no efficient algorithm to recover $n$. + +Suppose that Alice and Bob want to exchange encrypted data in the future, +so they need to agree on an encryption key to use. +However, they can only exchange messages with each other over +an insecure channel, which is being eavesdropped. + +After they publicly agree on the values of $g$ and $p$, +Alice and Bob each choose a secret number from $\{0, ..., p \!-\! 2\}$, respectively $a$ and $b$, +and then privately calculate $A$ and $B$ as follows: + +$$\begin{aligned} + A = g^a \bmod p + \qquad \quad + B = g^b \bmod p +\end{aligned}$$ + +Finally, they transmit these numbers $A$ and $B$ +to each other over the insecure connection, +and then each side calculates $k$, which is the desired secret key: + +$$\begin{aligned} + \boxed{ + k = A^b \bmod p = B^a \bmod p = g^{ab} \bmod p + } +\end{aligned}$$ + +The point is that $k$ includes both $a$ *and* $b$, +but each side only needs to know *either* $a$ *or* $b$. +And, due to the trapdoor assumption, +the eavesdropper knows $A$ and $B$, +but cannot recover $a$ or $b$. + +This assumption is just that: an assumption. +So far, nobody has been able to prove or disprove it +for classical computation. +However, for quantum computers, +it has already been *dis*proven! +In this case, another method must be used, +for example the [BB84 protocol](/know/concept/bb84-protocol/). + + + +## References +1. J.B. Brask, + *Quantum information: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/dirac-delta-function/index.md b/source/know/concept/dirac-delta-function/index.md new file mode 100644 index 0000000..63edd81 --- /dev/null +++ b/source/know/concept/dirac-delta-function/index.md @@ -0,0 +1,119 @@ +--- +title: "Dirac delta function" +date: 2021-02-22 +categories: +- Mathematics +- Physics +layout: "concept" +--- + +The **Dirac delta function** $\delta(x)$, often just the **delta function**, +is a function (or, more accurately, a [Schwartz distribution](/know/concept/schwartz-distribution/)) +that is commonly used in physics. +It is an infinitely narrow discontinuous "spike" at $x = 0$ whose area is +defined to be 1: + +$$\begin{aligned} + \boxed{ + \delta(x) \equiv + \begin{cases} + +\infty & \mathrm{if}\: x = 0 \\ + 0 & \mathrm{if}\: x \neq 0 + \end{cases} + \quad \mathrm{and} \quad + \int_{-\varepsilon}^\varepsilon \delta(x) \dd{x} = 1 + } +\end{aligned}$$ + +It is sometimes also called the **sampling function**, thanks to its most +important property: the so-called **sampling property**: + +$$\begin{aligned} + \boxed{ + \int f(x) \: \delta(x - x_0) \: dx = \int f(x) \: \delta(x_0 - x) \: dx = f(x_0) + } +\end{aligned}$$ + +$\delta(x)$ is thus quite an effective weapon against integrals. This may not seem very +useful due to its "unnatural" definition, but in fact it appears as the +limit of several reasonable functions: + +$$\begin{aligned} + \delta(x) + = \lim_{n \to +\infty} \!\Big\{ \frac{n}{\sqrt{\pi}} \exp(- n^2 x^2) \Big\} + = \lim_{n \to +\infty} \!\Big\{ \frac{n}{\pi} \frac{1}{1 + n^2 x^2} \Big\} + = \lim_{n \to +\infty} \!\Big\{ \frac{\sin(n x)}{\pi x} \Big\} +\end{aligned}$$ + +The last one is especially important, since it is equivalent to the +following integral, which appears very often in the context of +[Fourier transforms](/know/concept/fourier-transform/): + +$$\begin{aligned} + \delta(x) + = \lim_{n \to +\infty} \!\Big\{\frac{\sin(n x)}{\pi x}\Big\} + = \frac{1}{2\pi} \int_{-\infty}^\infty \exp(i k x) \dd{k} + \:\:\propto\:\: \hat{\mathcal{F}}\{1\} +\end{aligned}$$ + +When the argument of $\delta(x)$ is scaled, the delta function is itself scaled: + +$$\begin{aligned} + \boxed{ + \delta(s x) = \frac{1}{|s|} \delta(x) + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-scale"/> +<label for="proof-scale">Proof</label> +<div class="hidden"> +<label for="proof-scale">Proof.</label> +Because it is symmetric, $\delta(s x) = \delta(|s| x)$. +Then by substituting $\sigma = |s| x$: + +$$\begin{aligned} + \int \delta(|s| x) \dd{x} + &= \frac{1}{|s|} \int \delta(\sigma) \dd{\sigma} = \frac{1}{|s|} +\end{aligned}$$ +</div> +</div> + +An even more impressive property is the behaviour of the derivative of $\delta(x)$: + +$$\begin{aligned} + \boxed{ + \int f(\xi) \: \delta'(x - \xi) \dd{\xi} = f'(x) + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-dv1"/> +<label for="proof-dv1">Proof</label> +<div class="hidden"> +<label for="proof-dv1">Proof.</label> +Note which variable is used for the +differentiation, and that $\delta'(x - \xi) = - \delta'(\xi - x)$: + +$$\begin{aligned} + \int f(\xi) \: \dv{\delta(x - \xi)}{x} \dd{\xi} + &= \dv{}{x}\int f(\xi) \: \delta(x - \xi) \dd{x} + = f'(x) +\end{aligned}$$ +</div> +</div> + +This property also generalizes nicely for the higher-order derivatives: + +$$\begin{aligned} + \boxed{ + \int f(\xi) \: \dvn{n}{\delta(x - \xi)}{x} \dd{\xi} = \dvn{n}{f(x)}{x} + } +\end{aligned}$$ + + + +## References +1. O. Bang, + *Applied mathematics for physicists: lecture notes*, 2019, + unpublished. diff --git a/source/know/concept/dirac-notation/index.md b/source/know/concept/dirac-notation/index.md new file mode 100644 index 0000000..414b903 --- /dev/null +++ b/source/know/concept/dirac-notation/index.md @@ -0,0 +1,130 @@ +--- +title: "Dirac notation" +date: 2021-02-22 +categories: +- Quantum mechanics +- Physics +layout: "concept" +--- + +**Dirac notation** is a notation to do calculations in a [Hilbert space](/know/concept/hilbert-space/) +without needing to worry about the space's representation. It is +basically the *lingua franca* of quantum mechanics. + +In Dirac notation there are **kets** $\Ket{V}$ from the Hilbert space +$\mathbb{H}$ and **bras** $\Bra{V}$ from a dual $\mathbb{H}'$ of the +former. Crucially, the bras and kets are from different Hilbert spaces +and therefore cannot be added, but every bra has a corresponding ket and +vice versa. + +Bras and kets can be combined in two ways: the **inner product** +$\Inprod{V}{W}$, which returns a scalar, and the **outer product** +$\Ket{V} \Bra{W}$, which returns a mapping $\hat{L}$ from kets $\Ket{V}$ +to other kets $\Ket{V'}$, i.e. a linear operator. Recall that the +Hilbert inner product must satisfy: + +$$\begin{aligned} + \Inprod{V}{W} = \Inprod{W}{V}^* +\end{aligned}$$ + +So far, nothing has been said about the actual representation of bras or +kets. If we represent kets as $N$-dimensional columns vectors, the +corresponding bras are given by the kets' adjoints, i.e. their transpose +conjugates: + +$$\begin{aligned} + \Ket{V} = + \begin{bmatrix} + v_1 \\ \vdots \\ v_N + \end{bmatrix} + \quad \implies \quad + \Bra{V} = + \begin{bmatrix} + v_1^* & \cdots & v_N^* + \end{bmatrix} +\end{aligned}$$ + +The inner product $\Inprod{V}{W}$ is then just the familiar dot product $V \cdot W$: + +$$\begin{gathered} + \Inprod{V}{W} + = + \begin{bmatrix} + v_1^* & \cdots & v_N^* + \end{bmatrix} + \cdot + \begin{bmatrix} + w_1 \\ \vdots \\ w_N + \end{bmatrix} + = v_1^* w_1 + ... + v_N^* w_N +\end{gathered}$$ + +Meanwhile, the outer product $\Ket{V} \Bra{W}$ creates an $N \cross N$ matrix: + +$$\begin{gathered} + \Ket{V} \Bra{W} + = + \begin{bmatrix} + v_1 \\ \vdots \\ v_N + \end{bmatrix} + \cdot + \begin{bmatrix} + w_1^* & \cdots & w_N^* + \end{bmatrix} + = + \begin{bmatrix} + v_1 w_1^* & \cdots & v_1 w_N^* \\ + \vdots & \ddots & \vdots \\ + v_N w_1^* & \cdots & v_N w_N^* + \end{bmatrix} +\end{gathered}$$ + +If the kets are instead represented by functions $f(x)$ of +$x \in [a, b]$, then the bras represent *functionals* $F[u(x)]$ which +take an unknown function $u(x)$ as an argument and turn it into a scalar +using integration: + +$$\begin{aligned} + \Ket{f} = f(x) + \quad \implies \quad + \Bra{f} + = F[u(x)] + = \int_a^b f^*(x) \: u(x) \dd{x} +\end{aligned}$$ + +Consequently, the inner product is simply the following familiar integral: + +$$\begin{gathered} + \Inprod{f}{g} + = F[g(x)] + = \int_a^b f^*(x) \: g(x) \dd{x} +\end{gathered}$$ + +However, the outer product becomes something rather abstract: + +$$\begin{gathered} + \Ket{f} \Bra{g} + = f(x) \: G[u(x)] + = f(x) \int_a^b g^*(\xi) \: u(\xi) \dd{\xi} +\end{gathered}$$ + +This result makes more sense if we surround it by a bra and a ket: + +$$\begin{aligned} + \Bra{u} \!\Big(\!\Ket{f} \Bra{g}\!\Big)\! \Ket{w} + &= U\big[f(x) \: G[w(x)]\big] + = U\Big[ f(x) \int_a^b g^*(\xi) \: w(\xi) \dd{\xi} \Big] + \\ + &= \int_a^b u^*(x) \: f(x) \: \Big(\int_a^b g^*(\xi) \: w(\xi) \dd{\xi} \Big) \dd{x} + \\ + &= \Big( \int_a^b u^*(x) \: f(x) \dd{x} \Big) \Big( \int_a^b g^*(\xi) \: w(\xi) \dd{\xi} \Big) + \\ + &= \Inprod{u}{f} \Inprod{g}{w} +\end{aligned}$$ + + + +## References +1. R. Shankar, + *Principles of quantum mechanics*, 2nd edition, + Springer. diff --git a/source/know/concept/dispersive-broadening/index.md b/source/know/concept/dispersive-broadening/index.md new file mode 100644 index 0000000..64c251a --- /dev/null +++ b/source/know/concept/dispersive-broadening/index.md @@ -0,0 +1,96 @@ +--- +title: "Dispersive broadening" +date: 2021-02-27 +categories: +- Physics +- Optics +- Fiber optics +layout: "concept" +--- + +In optical fibers, **dispersive broadening** is a (linear) effect +where group velocity dispersion (GVD) "smears out" a pulse in the time domain +due to the different group velocities of its frequencies, +since pulses always have a non-zero width in the $\omega$-domain. +No new frequencies are created. + +A pulse envelope $A(z, t)$ inside a fiber must obey the nonlinear Schrödinger equation, +where the parameters $\beta_2$ and $\gamma$ respectively +control dispersion and nonlinearity: + +$$\begin{aligned} + 0 + = i \pdv{A}{z} - \frac{\beta_2}{2} \pdvn{2}{A}{t} + \gamma |A|^2 A +\end{aligned}$$ + +We set $\gamma = 0$ to ignore all nonlinear effects, +and consider a Gaussian initial condition: + +$$\begin{aligned} + A(0, t) + = \sqrt{P_0} \exp\!\Big(\!-\!\frac{t^2}{2 T_0^2}\Big) +\end{aligned}$$ + +By [Fourier transforming](/know/concept/fourier-transform/) in $t$, +the full analytical solution $A(z, t)$ is found to be as follows, +where it can be seen that the amplitude +decreases and the width increases with $z$: + +$$\begin{aligned} + A(z,t) = \sqrt{\frac{P_0}{1 - i \beta_2 z / T_0^2}} + \exp\!\bigg(\! -\!\frac{t^2 / (2 T_0^2)}{1 + \beta_2^2 z^2 / T_0^4} \big( 1 + i \beta_2 z / T_0^2 \big) \bigg) +\end{aligned}$$ + +To quantify the strength of dispersive effects, +we define the dispersion length $L_D$ +as the distance over which the half-width at $1/e$ of maximum power +(initially $T_0$) increases by a factor of $\sqrt{2}$: + +$$\begin{aligned} + T_0 \sqrt{1 + \beta_2^2 L_D^2 / T_0^4} = T_0 \sqrt{2} + \qquad \implies \qquad + \boxed{ + L_D = \frac{T_0^2}{|\beta_2|} + } +\end{aligned}$$ + +This phenomenon is illustrated below for our example of a Gaussian pulse +with parameter values $T_0 = 1\:\mathrm{ps}$, $P_0 = 1\:\mathrm{kW}$, +$\beta_2 = -10 \:\mathrm{ps}^2/\mathrm{m}$ and $\gamma = 0$: + +<a href="pheno-disp.jpg"> +<img src="pheno-disp-small.jpg" style="width:100%"> +</a> + +The **instantaneous frequency** $\omega_\mathrm{GVD}(z, t)$, +which describes the dominant angular frequency at a given point in the time domain, +is found to be as follows for the Gaussian pulse, +where $\phi(z, t)$ is the phase of $A(z, t) = \sqrt{P(z, t)} \exp(i \phi(z, t))$: + +$$\begin{aligned} + \omega_{\mathrm{GVD}}(z,t) + = \pdv{}{t}\Big( \frac{\beta_2 z t^2 / (2 T_0^4)}{1 + \beta_2^2 z^2 / T_0^4} \Big) + = \frac{\beta_2 z / T_0^2}{1 + \beta_2^2 z^2 / T_0^4} \frac{t}{T_0^2} +\end{aligned}$$ + +This expression is linear in time, and depending on the sign of $\beta_2$, +frequencies on one side of the pulse arrive first, +and those on the other side arrive last. +The effect is stronger for smaller $T_0$: +this makes sense, since short pulses are spectrally wider. + +The interaction between dispersion and [self-phase modulation](/know/concept/self-phase-modulation/) +leads to many interesting effects, +such as [modulational instability](/know/concept/modulational-instability/) +and [optical wave breaking](/know/concept/optical-wave-breaking/). +Of great importance is the sign of $\beta_2$: +in the **anomalous dispersion regime** ($\beta_2 < 0$), +lower frequencies travel more slowly than higher ones, +and vice versa in the **normal dispersion regime** ($\beta_2 > 0$). + + + +## References +1. O. Bang, + *Numerical methods in photonics: lecture notes*, 2019, + unpublished. diff --git a/source/know/concept/dispersive-broadening/pheno-disp-small.jpg b/source/know/concept/dispersive-broadening/pheno-disp-small.jpg Binary files differnew file mode 100644 index 0000000..8c70eac --- /dev/null +++ b/source/know/concept/dispersive-broadening/pheno-disp-small.jpg diff --git a/source/know/concept/dispersive-broadening/pheno-disp.jpg b/source/know/concept/dispersive-broadening/pheno-disp.jpg Binary files differnew file mode 100644 index 0000000..a97312b --- /dev/null +++ b/source/know/concept/dispersive-broadening/pheno-disp.jpg diff --git a/source/know/concept/drude-model/index.md b/source/know/concept/drude-model/index.md new file mode 100644 index 0000000..7f62ae5 --- /dev/null +++ b/source/know/concept/drude-model/index.md @@ -0,0 +1,228 @@ +--- +title: "Drude model" +date: 2021-09-23 +categories: +- Physics +- Electromagnetism +- Optics +layout: "concept" +--- + +The **Drude model** classically predicts +the dielectric function and electric conductivity of a gas of free charge carriers, +as found in metals and doped semiconductors. + + +## Metals + +An [electromagnetic wave](/know/concept/electromagnetic-wave-equation/) +has an oscillating [electric field](/know/concept/electric-field/) +$E(t) = E_0 \exp(- i \omega t)$ +that exerts a force on the charge carriers, +which have mass $m$ and charge $q$. +They thus obey the following equation of motion, +where $\gamma$ is a frictional damping coefficient: + +$$\begin{aligned} + m \dvn{2}{x}{t} + m \gamma \dv{x}{t} + = q E_0 \exp(- i \omega t) +\end{aligned}$$ + +Inserting the ansatz $x(t) = x_0 \exp(- i \omega t)$ +and isolating for the displacement $x_0$ yields: + +$$\begin{aligned} + - x_0 m \omega^2 - i x_0 m \gamma \omega + = q E_0 + \quad \implies \quad + x_0 + = - \frac{q E_0}{m (\omega^2 + i \gamma \omega)} +\end{aligned}$$ + +The polarization density $P(t)$ is therefore as shown below. +Note that the dipole moment $p$ goes from negative to positive, +and the electric field $E$ from positive to negative. +Let $N$ be the density of carriers in the gas, then: + +$$\begin{aligned} + P(t) + = N p(t) + = N q x(t) + = - \frac{N q^2}{m (\omega^2 + i \gamma \omega)} E(t) +\end{aligned}$$ + +The electric displacement field $D$ is thus as follows, +where $\varepsilon_r$ is the unknown relative permittivity of the gas, +which we will find shortly: + +$$\begin{aligned} + D + = \varepsilon_0 \varepsilon_r E + = \varepsilon_0 E + P + = \varepsilon_0 \bigg( 1 - \frac{N q^2}{\varepsilon_0 m} \frac{1}{\omega^2 + i \gamma \omega} \bigg) E +\end{aligned}$$ + +The parenthesized expression is the desired dielectric function $\varepsilon_r$, +which depends on $\omega$: + +$$\begin{aligned} + \boxed{ + \varepsilon_r(\omega) + = 1 - \frac{\omega_p^2}{\omega^2 + i \gamma \omega} + } +\end{aligned}$$ + +Where we have defined the important so-called **plasma frequency** like so: + +$$\begin{aligned} + \boxed{ + \omega_p + \equiv \sqrt{\frac{N q^2}{\varepsilon_0 m}} + } +\end{aligned}$$ + +If $\gamma = 0$, then $\varepsilon_r$ is +negative $\omega < \omega_p$, +positive for $\omega > \omega_p$, +and zero for $\omega = \omega_p$. +Respectively, this leads to +an imaginary index $\sqrt{\varepsilon_r}$ (high absorption), +a real index tending to $1$ (transparency), +and the possibility of self-sustained plasma oscillations. +For metals, $\omega_p$ lies in the UV. + +We can refine this result for $\varepsilon_r$, +by recognizing the (mean) velocity $v = \idv{x}{t}$, +and rewriting the equation of motion accordingly: + +$$\begin{aligned} + m \dv{v}{t} + m \gamma v = q E(t) +\end{aligned}$$ + +Note that $m v$ is simply the momentum $p$. +We define the **momentum scattering time** $\tau \equiv 1 / \gamma$, +which represents the average time between collisions, +where each collision resets the involved particles' momentums to zero. +Or, more formally: + +$$\begin{aligned} + \dv{p}{t} + = - \frac{p}{\tau} + q E +\end{aligned}$$ + +Returning to the equation for the mean velocity $v$, +we insert the ansatz $v(t) = v_0 \exp(- i \omega t)$, +for the same electric field $E(t) = E_0 \exp(-i \omega t)$ as before: + +$$\begin{aligned} + - i m \omega v_0 + \frac{m}{\tau} v_0 = q E_0 + \quad \implies \quad + v_0 = \frac{q \tau}{m (1 - i \omega \tau)} E_0 +\end{aligned}$$ + +From $v(t)$, we find the resulting average current density $J(t)$ to be as follows: + +$$\begin{aligned} + J(t) + = - N q v(t) + = \sigma E(t) +\end{aligned}$$ + +Where $\sigma(\omega)$ is the **AC conductivity**, +which depends on the **DC conductivity** $\sigma_0$: + +$$\begin{aligned} + \boxed{ + \sigma + = \frac{\sigma_0}{1 - i \omega \tau} + } + \qquad \quad + \boxed{ + \sigma_0 + = \frac{N q^2 \tau}{m} + } +\end{aligned}$$ + +We can use these quantities to rewrite +the dielectric function $\varepsilon_r$ from earlier: + +$$\begin{aligned} + \boxed{ + \varepsilon_r(\omega) + = 1 + \frac{i \sigma(\omega)}{\varepsilon_0 \omega} + } +\end{aligned}$$ + + +## Doped semiconductors + +Doping a semiconductor introduces +free electrons (n-type) +or free holes (p-type), +which can be treated as free particles +moving in the bands of the material. + +The Drude model can also be used in this case, +by replacing the actual carrier mass $m$ +by the effective mass $m^*$. +Furthermore, semiconductors already have +a high intrinsic permittivity $\varepsilon_{\mathrm{int}}$ +before the dopant is added, +so the diplacement field $D$ is: + +$$\begin{aligned} + D + = \varepsilon_0 E + P_{\mathrm{int}} + P_{\mathrm{free}} + = \varepsilon_{\mathrm{int}} \varepsilon_0 E - \frac{N q^2}{m^* (\omega^2 + i \gamma \omega)} E +\end{aligned}$$ + +Where $P_{\mathrm{int}}$ is the intrinsic undoped polarization, +and $P_{\mathrm{free}}$ is the contribution of the free carriers. +The dielectric function $\varepsilon_r(\omega)$ is therefore given by: + +$$\begin{aligned} + \boxed{ + \varepsilon_r(\omega) + = \varepsilon_{\mathrm{int}} \Big( 1 - \frac{\omega_p^2}{\omega^2 + i \gamma \omega} \Big) + } +\end{aligned}$$ + +Where the plasma frequency $\omega_p$ has been redefined as follows +to include $\varepsilon_\mathrm{int}$: + +$$\begin{aligned} + \boxed{ + \omega_p + = \sqrt{\frac{N q^2}{\varepsilon_{\mathrm{int}} \varepsilon_0 m^*}} + } +\end{aligned}$$ + +The meaning of $\omega_p$ is the same as for metals, +with high absorption for $\omega < \omega_p$. +However, due to the lower carrier density $N$ in a semiconductor, +$\omega_p$ lies in the IR rather than UV. + +However, instead of asymptotically going to $1$ for $\omega > \omega_p$ like a metal, +$\varepsilon_r$ tends to $\varepsilon_\mathrm{int}$ instead, +and crosses $1$ along the way, +at which point the reflectivity is zero. +This occurs at: + +$$\begin{aligned} + \omega^2 + = \frac{\varepsilon_{\mathrm{int}}}{\varepsilon_{\mathrm{int}} - 1} \omega_p^2 +\end{aligned}$$ + +This is used to experimentally determine the effective mass $m^*$ +of the doped semiconductor, +by finding which value of $m^*$ gives the measured $\omega$. + + + +## References +1. M. Fox, + *Optical properties of solids*, 2nd edition, + Oxford. +2. S.H. Simon, + *The Oxford solid state basics*, + Oxford. diff --git a/source/know/concept/dynkins-formula/index.md b/source/know/concept/dynkins-formula/index.md new file mode 100644 index 0000000..be7fa17 --- /dev/null +++ b/source/know/concept/dynkins-formula/index.md @@ -0,0 +1,193 @@ +--- +title: "Dynkin's formula" +date: 2021-11-28 +categories: +- Mathematics +- Stochastic analysis +layout: "concept" +--- + +Given an [Itō diffusion](/know/concept/ito-calculus/) $X_t$ +with a time-independent drift $f$ and intensity $g$ +such that the diffusion uniquely exists on the $t$-axis. +We define the **infinitesimal generator** $\hat{A}$ +as an operator with the following action on a given function $h(x)$, +where $\mathbf{E}$ is a +[conditional expectation](/know/concept/conditional-expectation/): + +$$\begin{aligned} + \boxed{ + \hat{A}\{h(X_0)\} + \equiv \lim_{t \to 0^+} \bigg[ \frac{1}{t} \mathbf{E}\Big[ h(X_t) - h(X_0) \Big| X_0 \Big] \bigg] + } +\end{aligned}$$ + +Which only makes sense for $h$ where this limit exists. +The assumption that $X_t$ does not have any explicit time-dependence +means that $X_0$ need not be the true initial condition; +it can also be the state $X_s$ at any $s$ infinitesimally smaller than $t$. + +Conveniently, for a sufficiently well-behaved $h$, +the generator $\hat{A}$ is identical to the Kolmogorov operator $\hat{L}$ +found in the [backward Kolmogorov equation](/know/concept/kolmogorov-equations/): + +$$\begin{aligned} + \boxed{ + \hat{A}\{h(x)\} + = \hat{L}\{h(x)\} + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-kolmogorov"/> +<label for="proof-kolmogorov">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-kolmogorov">Proof.</label> +We define a new process $Y_t \equiv h(X_t)$, and then apply Itō's lemma, leading to: + +$$\begin{aligned} + \dd{Y_t} + &= \bigg( \pdv{h}{x} f(X_t) + \frac{1}{2} \pdvn{2}{h}{x} g^2(X_t) \bigg) \dd{t} + \pdv{h}{x} g(X_t) \dd{B_t} + \\ + &= \hat{L}\{h(X_t)\} \dd{t} + \pdv{h}{x} g(X_t) \dd{B_t} +\end{aligned}$$ + +Where we have recognized the definition of $\hat{L}$. +Integrating the above equation yields: + +$$\begin{aligned} + Y_t + = Y_0 + \int_0^t \hat{L}\{h(X_s)\} \dd{s} + \int_0^\tau \pdv{h}{x} g(X_s) \dd{B_s} +\end{aligned}$$ + +As always, the latter [Itō integral](/know/concept/ito-integral/) +is a [martingale](/know/concept/martingale/), so it vanishes +when we take the expectation conditioned on the "initial" state $X_0$, leaving: + +$$\begin{aligned} + \mathbf{E}[Y_t | X_0] + = Y_0 + \mathbf{E}\bigg[ \int_0^t \hat{L}\{h(X_s)\} \dd{s} \bigg| X_0 \bigg] +\end{aligned}$$ + +For suffiently small $t$, the integral can be replaced by its first-order approximation: + +$$\begin{aligned} + \mathbf{E}[Y_t | X_0] + \approx Y_0 + \hat{L}\{h(X_0)\} \: t +\end{aligned}$$ + +Rearranging this gives the following, +to be understood in the limit $t \to 0^+$: + +$$\begin{aligned} + \hat{L}\{h(X_0)\} + \approx \frac{1}{t} \mathbf{E}[Y_t - Y_0| X_0] +\end{aligned}$$ +</div> +</div> + +The general definition of resembles that of a classical derivative, +and indeed, the generator $\hat{A}$ can be thought of as a differential operator. +In that case, we would like an analogue of the classical +fundamental theorem of calculus to relate it to integration. + +Such an analogue is provided by **Dynkin's formula**: +for a stopping time $\tau$ with a finite expected value $\mathbf{E}[\tau|X_0] < \infty$, +it states that: + +$$\begin{aligned} + \boxed{ + \mathbf{E}\big[ h(X_\tau) | X_0 \big] + = h(X_0) + \mathbf{E}\bigg[ \int_0^\tau \hat{L}\{h(X_t)\} \dd{t} \bigg| X_0 \bigg] + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-dynkin"/> +<label for="proof-dynkin">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-dynkin">Proof.</label> +The proof is similar to the one above. +Define $Y_t = h(X_t)$ and use Itō’s lemma: + +$$\begin{aligned} + \dd{Y_t} + &= \bigg( \pdv{h}{x} f(X_t) + \frac{1}{2} \pdvn{2}{h}{x} g^2(X_t) \bigg) \dd{t} + \pdv{h}{x} g(X_t) \dd{B_t} + \\ + &= \hat{L} \{h(X_t)\} \dd{t} + \pdv{h}{x} g(X_t) \dd{B_t} +\end{aligned}$$ + +And then integrate this from $t = 0$ to the provided stopping time $t = \tau$: + +$$\begin{aligned} + Y_\tau + = Y_0 + \int_0^\tau \hat{L}\{h(X_t)\} \dd{t} + \int_0^\tau \pdv{h}{x} g(X_t) \dd{B_t} +\end{aligned}$$ + +All [Itō integrals](/know/concept/ito-integral/) +are [martingales](/know/concept/martingale/), +so the latter integral's conditional expectation is zero for the "initial" condition $X_0$. +The rest of the above equality is also a martingale: + +$$\begin{aligned} + 0 + = \mathbf{E}\bigg[ Y_\tau - Y_0 - \int_0^\tau \hat{L}\{h(X_t)\} \dd{t} \bigg| X_0 \bigg] +\end{aligned}$$ + +Isolating this equation for $\mathbf{E}[Y_\tau | X_0]$ then gives Dynkin's formula. +</div> +</div> + +A common application of Dynkin's formula is predicting +when the stopping time $\tau$ occurs, and in what state $X_\tau$ this happens. +Consider an example: +for a region $\Omega$ of state space with $X_0 \in \Omega$, +we define the exit time $\tau \equiv \inf\{ t : X_t \notin \Omega \}$, +provided that $\mathbf{E}[\tau | X_0] < \infty$. + +To get information about when and where $X_t$ exits $\Omega$, +we define the *general reward* $\Gamma$ as follows, +consisting of a *running reward* $R$ for $X_t$ inside $\Omega$, +and a *terminal reward* $T$ on the boundary $\partial \Omega$ where we stop at $X_\tau$: + +$$\begin{aligned} + \Gamma + = \int_0^\tau R(X_t) \dd{t} + \: T(X_\tau) +\end{aligned}$$ + +For example, for $R = 1$ and $T = 0$, this becomes $\Gamma = \tau$, +and if $R = 0$, then $T(X_\tau)$ can tell us the exit point. +Let us now define $h(X_0) = \mathbf{E}[\Gamma | X_0]$, +and apply Dynkin's formula: + +$$\begin{aligned} + \mathbf{E}\big[ h(X_\tau) | X_0 \big] + &= \mathbf{E}\big[ \Gamma \big| X_0 \big] + \mathbf{E}\bigg[ \int_0^\tau \hat{L}\{h(X_t)\} \dd{t} \bigg| X_0 \bigg] + \\ + &= \mathbf{E}\big[ T(X_\tau) | X_0 \big] + \mathbf{E}\bigg[ \int_0^\tau \hat{L}\{h(X_t)\} + R(X_t) \dd{t} \bigg| X_0 \bigg] +\end{aligned}$$ + +The two leftmost terms depend on the exit point $X_\tau$, +but not directly on $X_t$ for $t < \tau$, +while the rightmost depends on the whole trajectory $X_t$. +Therefore, the above formula is fulfilled +if $h(x)$ satisfies the following equation and boundary conditions: + +$$\begin{aligned} + \boxed{ + \begin{cases} + \hat{L}\{h(x)\} + R(x) = 0 & \mathrm{for}\; x \in \Omega \\ + h(x) = T(x) & \mathrm{for}\; x \notin \Omega + \end{cases} + } +\end{aligned}$$ + +In other words, we have just turned a difficult question about a stochastic trajectory $X_t$ +into a classical differential boundary value problem for $h(x)$. + + + +## References +1. U.H. Thygesen, + *Lecture notes on diffusions and stochastic differential equations*, + 2021, Polyteknisk Kompendie. diff --git a/source/know/concept/dyson-equation/index.md b/source/know/concept/dyson-equation/index.md new file mode 100644 index 0000000..82020ad --- /dev/null +++ b/source/know/concept/dyson-equation/index.md @@ -0,0 +1,169 @@ +--- +title: "Dyson equation" +date: 2021-11-01 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +Consider the time-dependent Schrödinger equation, +describing a wavefunction $\Psi_0(\vb{r}, t)$: + +$$\begin{aligned} + i \hbar \pdv{}{t}\Psi_0(\vb{r}, t) + = \hat{H}_0(\vb{r}) \: \Psi_0(\vb{r}, t) +\end{aligned}$$ + +By definition, this equation's +[fundamental solution](/know/concept/fundamental-solution/) +$G_0(\vb{r}, t; \vb{r}', t')$ satisfies the following: + +$$\begin{aligned} + \Big( i \hbar \pdv{}{t}- \hat{H}_0(\vb{r}) \Big) G_0(\vb{r}, t; \vb{r}', t') + = \delta(\vb{r} - \vb{r}') \: \delta(t - t') +\end{aligned}$$ + +From this, we define the inverse $\hat{G}{}_0^{-1}(\vb{r}, t)$ +as follows, so that $\hat{G}{}_0^{-1} G_0 = \delta(\vb{r} \!-\! \vb{r}') \: \delta(t \!-\! t')$: + +$$\begin{aligned} + \hat{G}{}_0^{-1}(\vb{r}, t) + &\equiv i \hbar \pdv{}{t}- \hat{H}_0(\vb{r}) +\end{aligned}$$ + +Note that $\hat{G}{}_0^{-1}$ is an operator, while $G_0$ is a function. +For the sake of consistency, we thus define +the operator $\hat{G}_0(\vb{r}, t)$ +as a multiplication by $G_0$ +and integration over $\vb{r}'$ and $t'$: + +$$\begin{aligned} + \hat{G}_0(\vb{r}, t) \: f + \equiv \iint_{-\infty}^\infty G_0(\vb{r}, t; \vb{r}', t') \: f(\vb{r}', t') \: \dd{\vb{r}}' \dd{t'} +\end{aligned}$$ + +For an arbitrary function $f(\vb{r}, t)$, +so that $\hat{G}{}_0^{-1} \hat{G}_0 = \hat{G}_0 \hat{G}{}_0^{-1} = 1$. +Moving on, the Schrödinger equation can be rewritten like so, +using $\hat{G}{}_0^{-1}$: + +$$\begin{aligned} + \hat{G}{}_0^{-1}(\vb{r}, t) \: \Psi_0(\vb{r}, t) + = 0 +\end{aligned}$$ + +Let us assume that $\hat{H}_0$ is simple, +such that $G_0$ and $\hat{G}{}_0^{-1}$ can be found without issues +by solving the defining equation above. + +Suppose we now add a more complicated and +possibly time-dependent term $\hat{H}_1(\vb{r}, t)$, +in which case the corresponding fundamental solution +$G(\vb{r}, \vb{r}', t, t')$ satisfies: + +$$\begin{aligned} + \delta(\vb{r} - \vb{r}') \: \delta(t - t') + &= \Big( i \hbar \pdv{}{t}- \hat{H}_0(\vb{r}) - \hat{H}_1(\vb{r}, t) \Big) G(\vb{r}, t; \vb{r}', t') + \\ + &= \Big( \hat{G}{}_0^{-1}(\vb{r}, t) - \hat{H}_1(\vb{r}, t) \Big) G(\vb{r}, t; \vb{r}', t') +\end{aligned}$$ + +This equation is typically too complicated to solve, +so we would like an easier way to calculate this new $G$. +The perturbed wavefunction $\Psi(\vb{r}, t)$ +satisfies the Schrödinger equation: + +$$\begin{aligned} + \Big( \hat{G}{}_0^{-1}(\vb{r}, t) - \hat{H}_1(\vb{r}, t) \Big) \Psi(\vb{r}, t) + = 0 +\end{aligned}$$ + +We know that $\hat{G}{}_0^{-1} \Psi_0 = 0$, +which we put on the right, +and then we apply $\hat{G}_0$ in front: + +$$\begin{aligned} + \hat{G}_0^{-1} \Psi - \hat{H}_1 \Psi + = \hat{G}_0^{-1} \Psi_0 + \quad \implies \quad + \Psi - \hat{G}_0 \hat{H}_1 \Psi + &= \Psi_0 +\end{aligned}$$ + +This equation is recursive, +so we iteratively insert it into itself. +Note that the resulting equations are the same as those from +[time-dependent perturbation theory](/know/concept/time-dependent-perturbation-theory/): + +$$\begin{aligned} + \Psi + &= \Psi_0 + \hat{G}_0 \hat{H}_1 \Psi + \\ + &= \Psi_0 + \hat{G}_0 \hat{H}_1 \Psi_0 + \hat{G}_0 \hat{H}_1 \hat{G}_0 \hat{H}_1 \Psi + \\ + &= \Psi_0 + \hat{G}_0 \hat{H}_1 \Psi_0 + \hat{G}_0 \hat{H}_1 \hat{G}_0 \hat{H}_1 \Psi_0 + + \hat{G}_0 \hat{H}_1 \hat{G}_0 \hat{H}_1 \hat{G}_0 \hat{H}_1 \Psi_0 + \: ... + \\ + &= \Psi_0 + \big( \hat{G}_0 + \hat{G}_0 \hat{H}_1 \hat{G}_0 + \hat{G}_0 \hat{H}_1 \hat{G}_0 \hat{H}_1 \hat{G}_0 + \: ... \big) \hat{H}_1 \Psi_0 +\end{aligned}$$ + +The parenthesized expression clearly has the same recursive pattern, +so we denote it by $\hat{G}$ and write the so-called **Dyson equation**: + +$$\begin{aligned} + \boxed{ + \hat{G} + = \hat{G}_0 + \hat{G}_0 \hat{H}_1 \hat{G} + } +\end{aligned}$$ + +Such an iterative scheme is excellent for approximating $\hat{G}(\vb{r}, t)$. +Once a satisfactory accuracy is obtained, +the perturbed wavefunction $\Psi$ can be calculated from: + +$$\begin{aligned} + \boxed{ + \Psi + = \Psi_0 + \hat{G} \hat{H}_1 \Psi_0 + } +\end{aligned}$$ + +This relation is equivalent to the Schrödinger equation. +So now we have the operator $\hat{G}(\vb{r}, t)$, +but what about the fundamental solution function $G(\vb{r}, t; \vb{r}', t')$? +Let us take its definition, multiply it by an arbitrary $f(\vb{r}, t)$, +and integrate over $G$'s second argument pair: + +$$\begin{aligned} + \iint \big( \hat{G}{}_0^{-1} \!-\! \hat{H}_1 \big) G(\vb{r}', t') \: f(\vb{r}', t') \dd{\vb{r}'} \dd{t'} + = \iint \delta(\vb{r} \!-\! \vb{r}') \: \delta(t \!-\! t') \: f(\vb{r}', t') \dd{\vb{r}'} \dd{t'} + = f +\end{aligned}$$ + +Where we have hidden the arguments $(\vb{r}, t)$ for brevity. +We now apply $\hat{G}_0(\vb{r}, t)$ to this equation +(which contains an integral over $t''$ independent of $t'$): + +$$\begin{aligned} + \hat{G}_0 f + &= \big( \hat{G}_0 \hat{G}{}_0^{-1} - \hat{G}_0 \hat{H}_1 \big) \iint_{-\infty}^\infty G(\vb{r}', t') \: f(\vb{r}', t') \dd{\vb{r}'} \dd{t'} + \\ + &= \big( 1 - \hat{G}_0 \hat{H}_1 \big) \iint_{-\infty}^\infty G(\vb{r}', t') \: f(\vb{r}', t') \dd{\vb{r}'} \dd{t'} +\end{aligned}$$ + +Here, the shape of Dyson's equation is clearly recognizable, +so we conclude that, as expected, the operator $\hat{G}$ +is defined as multiplication by the function $G$ followed by integration: + +$$\begin{aligned} + \hat{G}(\vb{r}, t) \: f(\vb{r}, t) + \equiv \iint_{-\infty}^\infty G(\vb{r}, t; \vb{r}', t') \: f(\vb{r}', t') \dd{\vb{r}}' \dd{t'} +\end{aligned}$$ + + + +## References +1. H. Bruus, K. Flensberg, + *Many-body quantum theory in condensed matter physics*, + 2016, Oxford. diff --git a/source/know/concept/ehrenfests-theorem/index.md b/source/know/concept/ehrenfests-theorem/index.md new file mode 100644 index 0000000..a2a676a --- /dev/null +++ b/source/know/concept/ehrenfests-theorem/index.md @@ -0,0 +1,131 @@ +--- +title: "Ehrenfest's theorem" +date: 2021-02-24 +categories: +- Quantum mechanics +- Physics +layout: "concept" +--- + +In quantum mechanics, **Ehrenfest's theorem** gives a general expression for the +time evolution of an observable's expectation value $\expval{\hat{L}}$. + +The time-dependent Schrödinger equation is as follows, +where prime denotes differentiation with respect to time $t$: + +$$\begin{aligned} + \Ket{\psi'} = \frac{1}{i \hbar} \hat{H} \Ket{\psi} + \qquad + \Bra{\psi'} = - \frac{1}{i \hbar} \Bra{\psi} \hat{H} +\end{aligned}$$ + +Given an observable operator $\hat{L}$ and a state $\Ket{\psi}$, +the time-derivative of the expectation value $\expval{\hat{L}}$ is as follows +(due to the product rule of differentiation): + +$$\begin{aligned} + \dv{\expval{\hat{L}}}{t} + &= \matrixel{\psi}{\hat{L}}{\psi'} + \matrixel{\psi'}{\hat{L}}{\psi} + \matrixel{\psi}{\hat{L}'}{\psi} + \\ + &= \frac{1}{i \hbar} \matrixel{\psi}{\hat{L}\hat{H}}{\psi} + - \frac{1}{i \hbar} \matrixel{\psi}{\hat{H}\hat{L}}{\psi} + + \Expval{\dv{\hat{L}}{t}} +\end{aligned}$$ + +The first two terms on the right can be rewritten using a commutator, +yielding the general form of Ehrenfest's theorem: + +$$\begin{aligned} + \boxed{ + \dv{\expval{\hat{L}}}{t} + = \frac{1}{i \hbar} \Expval{[\hat{L}, \hat{H}]} + \Expval{\dv{\hat{L}}{t}} + } +\end{aligned}$$ + +In practice, since most operators are time-independent, +the last term often vanishes. + +As a interesting side note, in the [Heisenberg picture](/know/concept/heisenberg-picture/), +this relation proves itself, +when one simply wraps all terms in $\Bra{\psi}$ and $\Ket{\psi}$. + +Two observables of particular interest are the position $\hat{X}$ and momentum $\hat{P}$. +Applying the above theorem to $\hat{X}$ yields the following, +which we reduce using the fact that $\hat{X}$ commutes +with the potential $V(\hat{X})$, +because one is a function of the other: + +$$\begin{aligned} + \dv{\expval{\hat{X}}}{t} + &= \frac{1}{i \hbar} \Expval{[\hat{X}, \hat{H}]} + = \frac{1}{2 i \hbar m} \Expval{[\hat{X}, \hat{P}^2] + 2 m [\hat{X}, V(\hat{X})]} + = \frac{1}{2 i \hbar m} \Expval{[\hat{X}, \hat{P}^2]} + \\ + &= \frac{1}{2 i \hbar m} \Expval{\hat{P} [\hat{X}, \hat{P}] + [\hat{X}, \hat{P}] \hat{P}} + = \frac{2 i \hbar}{2 i \hbar m} \expval{\hat{P}} + = \frac{\expval{\hat{P}}}{m} +\end{aligned}$$ + +This is the first part of the "original" form of Ehrenfest's theorem, +which is reminiscent of classical Newtonian mechanics: + +$$\begin{gathered} + \boxed{ + \dv{\expval{\hat{X}}}{t} = \frac{\expval{\hat{P}}}{m} + } +\end{gathered}$$ + +Next, applying the general formula to the expected momentum $\expval{\hat{P}}$ +gives us: + +$$\begin{aligned} + \dv{\expval{\hat{P}}}{t} + &= \frac{1}{i \hbar} \Expval{[\hat{P}, \hat{H}]} + = \frac{1}{2 i \hbar m} \Expval{[\hat{P}, \hat{P}^2] + 2 m [\hat{P}, V(\hat{X})]} + = \frac{1}{i \hbar} \Expval{[\hat{P}, V(\hat{X})]} +\end{aligned}$$ + +To find the commutator, we go to the $\hat{X}$-basis and use a test +function $f(x)$: + +$$\begin{aligned} + \Comm{- i \hbar \dv{}{x}}{V(x)} \: f(x) + &= - i \hbar \frac{dV}{dx} f(x) - i \hbar V(x) \frac{df}{dx} + i \hbar V(x) \frac{df}{dx} + = - i \hbar \frac{dV}{dx} f(x) +\end{aligned}$$ + +By inserting this result back into the previous equation, we find the following: + +$$\begin{aligned} + \dv{\expval{\hat{P}}}{t} + &= - \frac{i \hbar}{i \hbar} \Expval{\frac{d V}{d \hat{X}}} + = - \Expval{\frac{d V}{d \hat{X}}} +\end{aligned}$$ + +This is the second part of Ehrenfest's theorem, +which is also similar to Newtonian mechanics: + +$$\begin{gathered} + \boxed{ + \dv{\expval{\hat{P}}}{t} = - \Expval{\pdv{V}{\hat{X}}} + } +\end{gathered}$$ + +There is an important consequence of Ehrenfest's original theorems +for the symbolic derivatives of the Hamiltonian $\hat{H}$ +with respect to $\hat{X}$ and $\hat{P}$: + +$$\begin{gathered} + \boxed{ + \Expval{\pdv{\hat{H}}{\hat{P}}} + = \dv{\expval{\hat{X}}}{t} + } + \qquad \quad + \boxed{ + - \Expval{\pdv{\hat{H}}{\hat{X}}} + = \dv{\expval{\hat{P}}}{t} + } +\end{gathered}$$ + +These are easy to prove yourself, +and are analogous to Hamilton's canonical equations. diff --git a/source/know/concept/einstein-coefficients/index.md b/source/know/concept/einstein-coefficients/index.md new file mode 100644 index 0000000..ff44888 --- /dev/null +++ b/source/know/concept/einstein-coefficients/index.md @@ -0,0 +1,341 @@ +--- +title: "Einstein coefficients" +date: 2021-07-11 +categories: +- Physics +- Optics +- Quantum mechanics +- Two-level system +- Laser theory +layout: "concept" +--- + +The **Einstein coefficients** quantify +the emission and absorption of photons by a solid, +and can be calculated analytically from first principles +in several useful situations. + + +## Qualitative description + +Suppose we have a ground state with energy $E_1$ containing $N_1$ electrons, +and an excited state with energy $E_2$ containing $N_2$ electrons. +The resonance $\omega_0 \equiv (E_2 \!-\! E_1)/\hbar$ +is the frequency of the photon emitted +when an electron falls from $E_2$ to $E_1$. + +The first Einstein coefficient is the **spontaneous emission rate** $A_{21}$, +which gives the probability per unit time +that an excited electron falls from state 2 to 1, +so that $N_2(t)$ obeys the following equation, +which is easily solved: + +$$\begin{aligned} + \dv{N_2}{t} = - A_{21} N_2 + \quad \implies \quad + N_2(t) = N_2(0) \exp(- t / \tau) +\end{aligned}$$ + +Where $\tau = 1 / A_{21}$ is the **natural radiative lifetime** of the excited state, +which gives the lifetime of an excited electron, +before it decays to the ground state. + +The next coefficient is the **absorption rate** $B_{12}$, +which is the probability that an incoming photon excites an electron, +per unit time and per unit spectral energy density +(i.e. the rate depends on the frequency of the incoming light). +Then $N_1(t)$ obeys the following equation: + +$$\begin{aligned} + \dv{N_1}{t} = - B_{12} N_1 u(\omega_0) +\end{aligned}$$ + +Where $u(\omega)$ is the spectral energy density of the incoming light, +put here to express the fact that only photons with frequency $\omega_0$ are absorbed. + +There is one more Einstein coefficient: the **stimulated emission rate** $B_{21}$. +An incoming photon has an associated electromagnetic field, +which can encourage an excited electron to drop to the ground state, +such that for $A_{21} = 0$: + +$$\begin{aligned} + \dv{N_2}{t} = - B_{21} N_2 u(\omega_0) +\end{aligned}$$ + +These three coefficients $A_{21}$, $B_{12}$ and $B_{21}$ are related to each other. +Suppose that the system is in equilibrium, +i.e. that $N_1$ and $N_2$ are constant. +We assume that the number of particles in the system is constant, +implying that $N_1'(t) = - N_2'(t) = 0$, so: + +$$\begin{aligned} + B_{12} N_1 u(\omega_0) = A_{21} N_2 + B_{21} N_2 u(\omega_0) = 0 +\end{aligned}$$ + +Isolating this equation for $u(\omega_0)$, +gives following expression for the radiation: + +$$\begin{aligned} + u(\omega_0) + = \frac{A_{21}}{(N_1 / N_2) B_{12} - B_{21}} +\end{aligned}$$ + +We assume that the system is in thermal equilibrium +with its own black-body radiation, and that there is no external light. +Then this is a [canonical ensemble](/know/concept/canonical-ensemble/), +meaning that the relative probability that an electron has $E_2$ compared to $E_1$ +is given by the Boltzmann distribution: + +$$\begin{aligned} + \frac{\mathrm{Prob}(E_2)}{\mathrm{Prob}(E_1)} + = \frac{N_2}{N_1} + = \frac{g_2}{g_1} \exp(- \hbar \omega_0 \beta) +\end{aligned}$$ + +Where $g_2$ and $g_1$ are the degeneracies of the energy levels. +Inserting this back into the equation for the spectrum $u(\omega_0)$ yields: + +$$\begin{aligned} + u(\omega_0) + = \frac{A_{21}}{(g_1 / g_2) B_{12} \exp(\hbar \omega_0 \beta) - B_{21}} +\end{aligned}$$ + +Since $u(\omega_0)$ represents only black-body radiation, +our result must agree with [Planck's law](/know/concept/plancks-law/): + +$$\begin{aligned} + u(\omega_0) + = \frac{A_{21}}{B_{21} \big( (g_1 B_{12} / g_2 B_{21}) \exp(\hbar \omega_0 \beta) - 1 \big)} + = \frac{\hbar \omega_0^3}{\pi^2 c^3} \frac{1}{\exp(\hbar \omega_0 \beta) - 1} +\end{aligned}$$ + +This gives us the following two equations relating the Einstein coefficients: + +$$\begin{aligned} + \boxed{ + A_{21} = \frac{\hbar \omega_0^3}{\pi^2 c^3} B_{21} + \qquad \quad + g_1 B_{12} = g_2 B_{21} + } +\end{aligned}$$ + +Note that this result holds even if $E_1$ is not the ground state, +but instead some lower excited state below $E_2$, +due to the principle of [detailed balance](/know/concept/detailed-balance/). +Furthermore, it turns out that these relations +also hold if the system is not in equilibrium. + +A notable case is **population inversion**, +where $B_{21} N_2 > B_{12} N_1$ such that $N_2 > (g_2 / g_1) N_1$. +This situation is mandatory for lasers, where stimulated emission must dominate, +such that the light becomes stronger as it travels through the medium. + + +## Coherent light + +In fact, we can analytically calculate the Einstein coefficients in some cases, +by treating incoming light as a perturbation +to an electron in a two-level system, +and then finding $B_{12}$ and $B_{21}$ from the resulting transition rate. +We need to make the [electric dipole approximation](/know/concept/electric-dipole-approximation/), +in which case the perturbing Hamiltonian $\hat{H}_1(t)$ is given by: + +$$\begin{aligned} + \hat{H}_1(t) + = - q \vec{r} \cdot \vec{E}_0 \cos(\omega t) +\end{aligned}$$ + +Where $q = -e$ is the electron charge, +$\vec{r}$ is the position operator, +and $\vec{E}_0$ is the amplitude of +the [electromagnetic wave](/know/concept/electromagnetic-wave-equation/). +For simplicity, we let the amplitude be along the $z$-axis: + +$$\begin{aligned} + \hat{H}_1(t) + = - q E_0 z \cos(\omega t) +\end{aligned}$$ + +This form of $\hat{H}_1$ is a well-known case for +[time-dependent perturbation theory](/know/concept/time-dependent-perturbation-theory/), +which tells us that the transition probability from $\Ket{a}$ to $\Ket{b}$ is: + +$$\begin{aligned} + P_{ab} + = \frac{\big|\!\matrixel{a}{H_1}{b}\!\big|^2}{\hbar^2} \frac{\sin^2\!\big( (\omega_{ba} - \omega) t / 2 \big)}{(\omega_{ba} - \omega)^2} +\end{aligned}$$ + +If the nucleus is at $z = 0$, +then generally $\Ket{1}$ and $\Ket{2}$ will be even or odd functions of $z$, +meaning that $\matrixel{1}{z}{1} = \matrixel{2}{z}{2} = 0$ +(see also [Laporte's selection rule](/know/concept/selection-rules/)), +leading to: + +$$\begin{gathered} + \matrixel{1}{H_1}{2} = - E_0 d^* + \qquad + \matrixel{2}{H_1}{1} = - E_0 d + \\ + \matrixel{1}{H_1}{1} = \matrixel{2}{H_1}{2} = 0 +\end{gathered}$$ + +Where $d \equiv q \matrixel{2}{z}{1}$ is a constant, +namely the $z$-component of the **transition dipole moment**. +The chance of an upward jump (i.e. absorption) is: + +$$\begin{aligned} + P_{12} + = \frac{E_0^2 |d|^2}{\hbar^2} \frac{\sin^2\!\big( (\omega_0 - \omega) t / 2 \big)}{(\omega_0 - \omega)^2} +\end{aligned}$$ + +Meanwhile, the transition probability for stimulated emission is as follows, +using the fact that $P_{ab}$ is a sinc-function, +and is therefore symmetric around $\omega_{ba}$: + +$$\begin{aligned} + P_{21} + = \frac{E_0^2 |d|^2}{\hbar^2} \frac{\sin^2\!\big( (\omega_0 - \omega) t / 2 \big)}{(\omega_0 - \omega)^2} +\end{aligned}$$ + +Surprisingly, the probabilities of absorption and stimulated emission are the same! +In practice, however, the relative rates of these two processes depends heavily on +the availability of electrons and holes in both states. + +In theory, we could calculate the transition rate $R_{12} = \ipdv{P_{12}}{t}$, +which would give us Einstein's absorption coefficient $B_{12}$, +for this specific case of coherent monochromatic light. +However, the result would not be constant in time $t$, +so is not really useful. + + +## Polarized light + +To solve this "problem", we generalize to (incoherent) polarized polychromatic light. +To do so, we note that the energy density $u$ of an electric field $E_0$ is given by: + +$$\begin{aligned} + u = \frac{1}{2} \varepsilon_0 E_0^2 + \qquad \implies \qquad + E_0^2 = \frac{2 u}{\varepsilon_0} +\end{aligned}$$ + +Where $\varepsilon_0$ is the vacuum permittivity. +Putting this in the previous result for $P_{12}$ gives us: + +$$\begin{aligned} + P_{12} + = \frac{2 u |d|^2}{\varepsilon_0 \hbar^2} \frac{\sin^2\!\big( (\omega_0 - \omega) t / 2 \big)}{(\omega_0 - \omega)^2} +\end{aligned}$$ + +For a continuous light spectrum, +this $u$ turns into the spectral energy density $u(\omega)$: + +$$\begin{aligned} + P_{12} + = \frac{2 |d|^2}{\varepsilon_0 \hbar^2} + \int_0^\infty \frac{\sin^2\!\big( (\omega_0 - \omega) t / 2 \big)}{(\omega_0 - \omega)^2} u(\omega) \dd{\omega} +\end{aligned}$$ + +From here, the derivation is similar to that of +[Fermi's golden rule](/know/concept/fermis-golden-rule/), +despite the distinction that we are integrating over frequencies rather than states. + +At sufficiently large $t$, the integrand is sharply peaked at $\omega = \omega_0$ +and negligible everywhere else, +so we take $u(\omega)$ out of the integral and extend the integration limits. +Then we rewrite and look up the integral, +which turns out to be $\pi t$: + +$$\begin{aligned} + P_{12} + = \frac{|d|^2}{\varepsilon_0 \hbar^2} u(\omega_0) \int_{-\infty}^\infty \frac{\sin^2\!\big(x t \big)}{x^2} \dd{x} + = \frac{\pi |d|^2}{\varepsilon_0 \hbar^2} u(\omega_0) \:t +\end{aligned}$$ + +From this, the transition rate $R_{12} = B_{12} u(\omega_0)$ +is then calculated as follows: + +$$\begin{aligned} + R_{12} + = \pdv{P_{12}}{t} + = \frac{\pi |d|^2}{\varepsilon_0 \hbar^2} u(\omega_0) +\end{aligned}$$ + +Using the relations from earlier with $g_1 = g_2$, +the Einstein coefficients are found to be as follows +for a polarized incoming light spectrum: + +$$\begin{aligned} + \boxed{ + B_{21} = B_{12} = \frac{\pi |d|^2}{\varepsilon_0 \hbar^2} + \qquad + A_{21} = \frac{\omega_0^3 |d|^2}{\pi \varepsilon_0 \hbar c^3} + } +\end{aligned}$$ + + +## Unpolarized light + +We can generalize the above result even further to unpolarized light. +Let us return to the matrix elements of the perturbation $\hat{H}_1$, +and define the polarization unit vector $\vec{n}$: + +$$\begin{aligned} + \matrixel{2}{\hat{H}_1}{1} + = - \vec{d} \cdot \vec{E}_0 + = - E_0 (\vec{d} \cdot \vec{n}) +\end{aligned}$$ + +Where $\vec{d} \equiv q \matrixel{2}{\vec{r}}{1}$ is +the full **transition dipole moment** vector, which is usually complex. + +The goal is to calculate the average of $|\vec{d} \cdot \vec{n}|^2$. +In [spherical coordinates](/know/concept/spherical-coordinates/), +we integrate over all directions $\vec{n}$ for fixed $\vec{d}$, +using that $\vec{d} \cdot \vec{n} = |\vec{d}| \cos(\theta)$ +with $|\vec{d}| \equiv |d_x|^2 \!+\! |d_y|^2 \!+\! |d_z|^2$: + +$$\begin{aligned} + \Expval{|\vec{d} \cdot \vec{n}|^2} + = \frac{1}{4 \pi} \int_0^\pi \int_0^{2 \pi} |\vec{d}|^2 \cos^2(\theta) \sin(\theta) \dd{\varphi} \dd{\theta} +\end{aligned}$$ + +Where we have divided by $4\pi$ (the surface area of a unit sphere) for normalization, +and $\theta$ is the polar angle between $\vec{n}$ and $\vec{d}$. +Evaluating the integrals yields: + +$$\begin{aligned} + \Expval{|\vec{d} \cdot \vec{n}|^2} + = \frac{2 \pi}{4 \pi} |\vec{d}|^2 \int_0^\pi \cos^2(\theta) \sin(\theta) \dd{\theta} + = \frac{|\vec{d}|^2}{2} \Big[ \!-\! \frac{\cos^3(\theta)}{3} \Big]_0^\pi + = \frac{|\vec{d}|^2}{3} +\end{aligned}$$ + +With this additional constant factor $1/3$, +the transition rate $R_{12}$ is modified to: + +$$\begin{aligned} + R_{12} + = \pdv{P_{12}}{t} + = \frac{\pi |\vec{d}|^2}{3 \varepsilon_0 \hbar^2} u(\omega_0) +\end{aligned}$$ + +From which it follows that the Einstein coefficients for unpolarized light are given by: + +$$\begin{aligned} + \boxed{ + B_{21} = B_{12} = \frac{\pi |\vec{d}|^2}{3 \varepsilon_0 \hbar^2} + \qquad + A_{21} = \frac{\omega_0^3 |\vec{d}|^2}{3 \pi \varepsilon_0 \hbar c^3} + } +\end{aligned}$$ + + + +## References +1. M. Fox, + *Optical properties of solids*, 2nd edition, + Oxford. +2. D.J. Griffiths, D.F. Schroeter, + *Introduction to quantum mechanics*, 3rd edition, + Cambridge. diff --git a/source/know/concept/elastic-collision/index.md b/source/know/concept/elastic-collision/index.md new file mode 100644 index 0000000..f3c4b7b --- /dev/null +++ b/source/know/concept/elastic-collision/index.md @@ -0,0 +1,154 @@ +--- +title: "Elastic collision" +date: 2021-10-04 +categories: +- Physics +- Classical mechanics +layout: "concept" +--- + +In an **elastic collision**, +the sum of the colliding objects' kinetic energies +is the same before and after the collision. +In contrast, in an **inelastic collision**, +some of that energy is converted into another form, +for example heat. + + +## One dimension + +In 1D, not only the kinetic energy is conserved, but also the total momentum. +Let $v_1$ and $v_2$ be the initial velocities of objects 1 and 2, +and $v_1'$ and $v_2'$ their velocities afterwards: + +$$\begin{aligned} + \begin{cases} + \quad\! m_1 v_1 +\:\:\: m_2 v_2 + = \quad m_1 v_1' +\:\:\: m_2 v_2' + \\ + \displaystyle\frac{1}{2} m_1 v_1^2 + \frac{1}{2} m_2 v_2^2 + = \frac{1}{2} m_1 v_1'^2 + \frac{1}{2} m_2 v_2'^2 + \end{cases} +\end{aligned}$$ + +After some rearranging, +these two equations can be written as follows: + +$$\begin{aligned} + \begin{cases} + m_1 (v_1 - v_1') + \qquad\quad\:\;\; = m_2 (v_2' - v_2) + \\ + m_1 (v_1 - v_1') (v_1 + v_1') + = m_2 (v_2' - v_2) (v_2 + v_2') + \end{cases} +\end{aligned}$$ + +Using the first equation to replace $m_1 (v_1 \!-\! v_1')$ +with $m_2 (v_2 \!-\! v_2')$ in the second: + +$$\begin{aligned} + m_2 (v_1 + v_1') (v_2' - v_2) + = m_2 (v_2 + v_2') (v_2' - v_2) +\end{aligned}$$ + +Dividing out the common factors +then leads us to a simplified system of equations: + +$$\begin{aligned} + \begin{cases} + \qquad\;\; v_1 + v_1' + = v_2 + v_2' + \\ + m_1 v_1 + m_2 v_2 + = m_1 v_1' + m_2 v_2' + \end{cases} +\end{aligned}$$ + +Note that the first relation is equivalent to $v_1 - v_2 = v_2' - v_1'$, +meaning that the objects' relative velocity +is reversed by the collision. +Moving on, we replace $v_1'$ in the second equation: + +$$\begin{aligned} + m_1 v_1 + m_2 v_2 + &= m_1 (v_2 + v_2' - v_1) + m_2 v_2' + \\ + (m_1 + m_2) v_2' + &= 2 m_1 v_1 + (m_2 - m_1) v_2 +\end{aligned}$$ + +Dividing by $m_1 + m_2$, +and going through the same process for $v_1'$, +we arrive at: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + v_1' + &= \frac{(m_1 - m_2) v_1 + 2 m_2 v_2}{m_1 + m_2} + \\ + v_2' + &= \frac{2 m_1 v_1 + (m_2 - m_1) v_2}{m_1 + m_2} + \end{aligned} + } +\end{aligned}$$ + +To analyze this result, +for practicality, we simplify it by setting $v_2 = 0$. +In that case: + +$$\begin{aligned} + v_1' + = \frac{(m_1 - m_2) v_1}{m_1 + m_2} + \qquad \quad + v_2' + = \frac{2 m_1 v_1}{m_1 + m_2} +\end{aligned}$$ + +How much of its energy and momentum does object 1 transfer to object 2? +The following ratios compare $v_1$ and $v_2'$ to quantify the transfer: + +$$\begin{aligned} + \frac{m_2 v_2'}{m_1 v_1} + = \frac{2 m_2}{m_1 + m_2} + \qquad \quad + \frac{m_2 v_2'^2}{m_1 v_1^2} + = \frac{4 m_1 m_2}{(m_1 + m_2)^2} +\end{aligned}$$ + +If $m_1 = m_2$, both ratios reduce to $1$, +meaning that all energy and momentum is transferred, +and object 1 is at rest after the collision. +Newton's cradle is an example of this. + +If $m_1 \ll m_2$, object 1 simply bounces off object 2, +barely transferring any energy. +Object 2 ends up with twice object 1's momentum, +but $v_2'$ is very small and thus negligible: + +$$\begin{aligned} + \frac{m_2 v_2'}{m_1 v_1} + \approx 2 + \qquad \quad + \frac{m_2 v_2'^2}{m_1 v_1^2} + \approx \frac{4 m_1}{m_2} +\end{aligned}$$ + +If $m_1 \gg m_2$, object 1 barely notices the collision, +so not much is transferred to object 2: + +$$\begin{aligned} + \frac{m_2 v_2'}{m_1 v_1} + \approx \frac{2 m_2}{m_1} + \qquad \quad + \frac{m_2 v_2'^2}{m_1 v_1^2} + \approx \frac{4 m_2}{m_1} +\end{aligned}$$ + + + +## References +1. M. Salewski, A.H. Nielsen, + *Plasma physics: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/electric-dipole-approximation/index.md b/source/know/concept/electric-dipole-approximation/index.md new file mode 100644 index 0000000..c3e6dc0 --- /dev/null +++ b/source/know/concept/electric-dipole-approximation/index.md @@ -0,0 +1,165 @@ +--- +title: "Electric dipole approximation" +date: 2021-09-14 +categories: +- Physics +- Quantum mechanics +- Optics +- Electromagnetism +- Perturbation +layout: "concept" +--- + +Suppose that an [electromagnetic wave](/know/concept/electromagnetic-wave-equation/) +is travelling through an atom, and affecting the electrons. +The general Hamiltonian of an electron in such a wave is given by: + +$$\begin{aligned} + \hat{H} + &= \frac{(\vu{P} - q \vb{A})^2}{2 m} + q \varphi + \\ + &= \frac{\vu{P}{}^2}{2 m} - \frac{q}{2 m} (\vb{A} \cdot \vu{P} + \vu{P} \cdot \vb{A}) + \frac{q^2 \vb{A}^2}{2m} + q \varphi +\end{aligned}$$ + +With charge $q = - e$, +canonical momentum operator $\vu{P} = - i \hbar \nabla$, +and magnetic vector potential $\vb{A}(\vb{x}, t)$. +We reduce this by fixing the Coulomb gauge $\nabla \cdot \vb{A} = 0$, +so that $\vb{A} \cdot \vu{P} = \vu{P} \cdot \vb{A}$: + +$$\begin{aligned} + \comm{\vb{A}}{\vu{P}} \psi + &= -i \hbar \vb{A} \cdot (\nabla \psi) + i \hbar \nabla \cdot (\vb{A} \psi) + \\ + &= i \hbar (\nabla \cdot \vb{A}) \psi + = 0 +\end{aligned}$$ + +Where $\psi$ is an arbitrary test function. +Assuming $\vb{A}$ is so small that $\vb{A}{}^2$ is negligible, we split $\hat{H}$ as follows, +where $\hat{H}_1$ can be regarded as a perturbation to $\hat{H}_0$: + +$$\begin{aligned} + \hat{H} + = \hat{H}_0 + \hat{H}_1 + \qquad \quad + \hat{H}_0 + \equiv \frac{\vu{P}{}^2}{2 m} + q \varphi + \qquad \quad + \hat{H}_1 + \equiv - \frac{q}{m} \vu{P} \cdot \vb{A} +\end{aligned}$$ + +In an electromagnetic wave, $\vb{A}$ is oscillating sinusoidally in time and space: + +$$\begin{aligned} + \vb{A}(\vb{x}, t) = \vb{A}_0 \sin(\vb{k} \cdot \vb{x} - \omega t) +\end{aligned}$$ + +Mathematically, it is more convenient to represent this with a complex exponential, +whose real part should be taken at the end of the calculation: + +$$\begin{aligned} + \vb{A}(\vb{x}, t) = - i \vb{A}_0 \exp(i \vb{k} \cdot \vb{x} - i \omega t) +\end{aligned}$$ + +The corresponding perturbative [electric field](/know/concept/electric-field/) $\vb{E}$ is then given by: + +$$\begin{aligned} + \vb{E}(\vb{x}, t) + = - \pdv{\vb{A}}{t} + = \vb{E}_0 \exp(i \vb{k} \cdot \vb{x} - i \omega t) +\end{aligned}$$ + +Where $\vb{E}_0 = \omega \vb{A}_0$. +Let us restrict ourselves to visible light, +whose wavelength $2 \pi / |\vb{k}| \sim 10^{-6} \:\mathrm{m}$. +Meanwhile, an atomic orbital is several Bohr $\sim 10^{-10} \:\mathrm{m}$, +so $\vb{k} \cdot \vb{x}$ is negligible: + +$$\begin{aligned} + \boxed{ + \vb{E}(\vb{x}, t) + \approx \vb{E}_0 \exp(- i \omega t) + } +\end{aligned}$$ + +This is the **electric dipole approximation**: +we ignore all spatial variation of $\vb{E}$, +and only consider its temporal oscillation. +Also, since we have not used the word "photon", +we are implicitly treating the radiation classically, +and the electron quantum-mechanically. + +Next, we want to rewrite $\hat{H}_1$ +to use the electric field $\vb{E}$ instead of the potential $\vb{A}$. +To do so, we use that $\vu{P} = m \: \idv{\vu{x}}{t}$ +and evaluate this in the [interaction picture](/know/concept/interaction-picture/): + +$$\begin{aligned} + \vu{P} + = m \idv{\vu{x}}{t} + = m \frac{i}{\hbar} \comm{\hat{H}_0}{\vu{x}} + = m \frac{i}{\hbar} (\hat{H}_0 \vu{x} - \vu{x} \hat{H}_0) +\end{aligned}$$ + +Taking the off-diagonal inner product with +the two-level system's states $\Ket{1}$ and $\Ket{2}$ gives: + +$$\begin{aligned} + \matrixel{2}{\vu{P}}{1} + = m \frac{i}{\hbar} \matrixel{2}{\hat{H}_0 \vu{x} - \vu{x} \hat{H}_0}{1} + = m i \omega_0 \matrixel{2}{\vu{x}}{1} +\end{aligned}$$ + +Therefore, $\vu{P} / m = i \omega_0 \vu{x}$, +where $\omega_0 \equiv (E_2 \!-\! E_1) / \hbar$ is the resonance of the energy gap, +close to which we assume that $\vb{A}$ and $\vb{E}$ are oscillating, i.e. $\omega \approx \omega_0$. +We thus get: + +$$\begin{aligned} + \hat{H}_1(t) + &= - \frac{q}{m} \vu{P} \cdot \vb{A} + = - (- i i) q \omega_0 \vu{x} \cdot \vb{A}_0 \exp(- i \omega t) + \\ + &\approx - q \vu{x} \cdot \vb{E}_0 \exp(- i \omega t) + = - \vu{d} \cdot \vb{E}_0 \exp(- i \omega t) +\end{aligned}$$ + +Where $\vu{d} \equiv q \vu{x} = - e \vu{x}$ is +the **transition dipole moment operator** of the electron, +hence the name **electric dipole approximation**. +Finally, we take the real part, yielding: + +$$\begin{aligned} + \boxed{ + \hat{H}_1(t) + = - \vu{d} \cdot \vb{E}(t) + = - q \vu{x} \cdot \vb{E}_0 \cos(\omega t) + } +\end{aligned}$$ + +If this approximation is too rough, +$\vb{E}$ can always be Taylor-expanded in $(i \vb{k} \cdot \vb{x})$: + +$$\begin{aligned} + \vb{E}(\vb{x}, t) + = \vb{E}_0 \Big( 1 + (i \vb{k} \cdot \vb{x}) + \frac{1}{2} (i \vb{k} \cdot \vb{x})^2 + \: ... \Big) \exp(- i \omega t) +\end{aligned}$$ + +Taking the real part then yields the following series of higher-order correction terms: + +$$\begin{aligned} + \vb{E}(\vb{x}, t) + = \vb{E}_0 \Big( \cos(\omega t) + (\vb{k} \cdot \vb{x}) \sin(\omega t) - \frac{1}{2} (\vb{k} \cdot \vb{x})^2 \cos(\omega t) + \: ... \Big) +\end{aligned}$$ + + + +## References +1. M. Fox, + *Optical properties of solids*, 2nd edition, + Oxford. +2. D.J. Griffiths, D.F. Schroeter, + *Introduction to quantum mechanics*, 3rd edition, + Cambridge. diff --git a/source/know/concept/electric-field/index.md b/source/know/concept/electric-field/index.md new file mode 100644 index 0000000..eef8bd5 --- /dev/null +++ b/source/know/concept/electric-field/index.md @@ -0,0 +1,126 @@ +--- +title: "Electric field" +date: 2021-07-12 +categories: +- Physics +- Electromagnetism +layout: "concept" +--- + +The **electric field** $\vb{E}$ is a vector field +that describes electric effects, +and is defined as the field that correctly predicts +the [Lorentz force](/know/concept/lorentz-force/) +on a particle with electric charge $q$: + +$$\begin{aligned} + \vb{F} + = q \vb{E} +\end{aligned}$$ + +This definition implies that the direction of $\vb{E}$ +is from positive to negative charges, +since opposite charges attracts and like charges repel. + +If two opposite point charges with magnitude $q$ +are observed from far away, +they can be treated as a single object called a **dipole**, +which has an **electric dipole moment** $\vb{p}$ defined like so, +where $\vb{d}$ is the vector going from +the negative to the positive charge (opposite direction of $\vb{E}$): + +$$\begin{aligned} + \vb{p} = q \vb{d} +\end{aligned}$$ + +Alternatively, for consistency with [magnetic fields](/know/concept/magnetic-field/), +$\vb{p}$ can be defined from the aligning torque $\vb{\tau}$ +experienced by the dipole when placed in an $\vb{E}$-field. +In other words, $\vb{p}$ satisfies: + +$$\begin{aligned} + \vb{\tau} = \vb{p} \times \vb{E} +\end{aligned}$$ + +Where $\vb{p}$ has units of $\mathrm{C m}$. +The **polarization density** $\vb{P}$ is defined from $\vb{p}$, +and roughly speaking represents the moments per unit volume: + +$$\begin{aligned} + \vb{P} \equiv \dv{\vb{p}}{V} + \:\:\iff\:\: + \vb{p} = \int_V \vb{P} \dd{V} +\end{aligned}$$ + +If $\vb{P}$ has the same magnitude and direction throughout the body, +then this becomes $\vb{p} = \vb{P} V$, where $V$ is the volume. +Therefore, $\vb{P}$ has units of $\mathrm{C / m^2}$. + +A nonzero $\vb{P}$ complicates things, +since it contributes to the field and hence modifies $\vb{E}$. +We thus define +the "free" **displacement field** $\vb{D}$ +from the "bound" field $\vb{P}$ +and the "net" field $\vb{E}$: + +$$\begin{aligned} + \vb{D} \equiv \varepsilon_0 \vb{E} + \vb{P} + \:\:\iff\:\: + \vb{E} = \frac{1}{\varepsilon_0} (\vb{D} - \vb{P}) +\end{aligned}$$ + +Where the **electric permittivity of free space** $\varepsilon_0$ is a known constant. +It is important to point out some inconsistencies here: +$\vb{D}$ and $\vb{P}$ contain a factor of $\varepsilon_0$, +and therefore measure **flux density**, +while $\vb{E}$ does not contain $\varepsilon_0$, +and thus measures **field intensity**. +Note that this convention is the opposite +of the magnetic analogues $\vb{B}$, $\vb{H}$ and $\vb{M}$, +and that $\vb{M}$ has the opposite sign of $\vb{P}$. + +The polarization $\vb{P}$ is a function of $\vb{E}$. +In addition to the inherent polarity +of the material $\vb{P}_0$ (zero in most cases), +there is a (possibly nonlinear) response +to the applied $\vb{E}$-field: + +$$\begin{aligned} + \vb{P} = + \vb{P}_0 + \varepsilon_0 \chi_e^{(1)} \vb{E} + + \varepsilon_0 \chi_e^{(2)} |\vb{E}| \: \vb{E} + + \varepsilon_0 \chi_e^{(3)} |\vb{E}|^2 \: \vb{E} + ... +\end{aligned}$$ + +Where the $\chi_e^{(n)}$ are the **electric susceptibilities** of the medium. +For simplicity, we often assume that only the $n\!=\!1$ term is nonzero, +which is the linear response to $\vb{E}$. +In that case, we define the **absolute permittivity** $\varepsilon$ so that: + +$$\begin{aligned} + \vb{D} + = \varepsilon_0 \vb{E} + \vb{P} + = \varepsilon_0 \vb{E} + \varepsilon_0 \chi_e^{(1)} \vb{E} + = \varepsilon_0 \varepsilon_r \vb{E} + = \varepsilon \vb{E} +\end{aligned}$$ + +I.e. $\varepsilon \equiv \varepsilon_r \varepsilon_0$, +where $\varepsilon_r \equiv 1 + \chi_e^{(1)}$ is +the [**dielectric function**](/know/concept/dielectric-function/) +or **relative permittivity**, +whose calculation is of great interest in physics. + +In reality, a material cannot respond instantly to $\vb{E}$, +meaning that $\chi_e^{(1)}$ is a function of time, +and that $\vb{P}$ is the convolution of $\chi_e^{(1)}(t)$ and $\vb{E}(t)$: + +$$\begin{aligned} + \vb{P}(t) + = \varepsilon_0 \big(\chi_e^{(1)} * \vb{E}\big)(t) + = \varepsilon_0 \int_{-\infty}^\infty \chi_e^{(1)}(t - \tau) \: \vb{E}(\tau) \:d\tau +\end{aligned}$$ + +Note that this definition requires $\chi_e^{(1)}(t) = 0$ for $t < 0$ +in order to ensure causality, +which leads to the [Kramers-Kronig relations](/know/concept/kramers-kronig-relations/). diff --git a/source/know/concept/electromagnetic-wave-equation/index.md b/source/know/concept/electromagnetic-wave-equation/index.md new file mode 100644 index 0000000..e6f6677 --- /dev/null +++ b/source/know/concept/electromagnetic-wave-equation/index.md @@ -0,0 +1,246 @@ +--- +title: "Electromagnetic wave equation" +date: 2021-09-09 +categories: +- Physics +- Electromagnetism +- Optics +layout: "concept" +--- + +The electromagnetic wave equation describes +the propagation of light through various media. +Since an electromagnetic (light) wave consists of +an [electric field](/know/concept/electric-field/) +and a [magnetic field](/know/concept/magnetic-field/), +we need [Maxwell's equations](/know/concept/maxwells-equations/) +in order to derive the wave equation. + + +## Uniform medium + +We will use all of Maxwell's equations, +but we start with Ampère's circuital law for the "free" fields $\vb{H}$ and $\vb{D}$, +in the absence of a free current $\vb{J}_\mathrm{free} = 0$: + +$$\begin{aligned} + \nabla \cross \vb{H} + = \pdv{\vb{D}}{t} +\end{aligned}$$ + +We assume that the medium is isotropic, linear, +and uniform in all of space, such that: + +$$\begin{aligned} + \vb{D} = \varepsilon_0 \varepsilon_r \vb{E} + \qquad \quad + \vb{H} = \frac{1}{\mu_0 \mu_r} \vb{B} +\end{aligned}$$ + +Which, upon insertion into Ampère's law, +yields an equation relating $\vb{B}$ and $\vb{E}$. +This may seem to contradict Ampère's "total" law, +but keep in mind that $\vb{J}_\mathrm{bound} \neq 0$ here: + +$$\begin{aligned} + \nabla \cross \vb{B} + = \mu_0 \mu_r \varepsilon_0 \varepsilon_r \pdv{\vb{E}}{t} +\end{aligned}$$ + +Now we take the curl, rearrange, +and substitute $\nabla \cross \vb{E}$ according to Faraday's law: + +$$\begin{aligned} + \nabla \cross (\nabla \cross \vb{B}) + = \mu_0 \mu_r \varepsilon_0 \varepsilon_r \pdv{}{t}(\nabla \cross \vb{E}) + = - \mu_0 \mu_r \varepsilon_0 \varepsilon_r \pdvn{2}{\vb{B}}{t} +\end{aligned}$$ + +Using a vector identity, we rewrite the leftmost expression, +which can then be reduced thanks to Gauss' law for magnetism $\nabla \cdot \vb{B} = 0$: + +$$\begin{aligned} + - \mu_0 \mu_r \varepsilon_0 \varepsilon_r \pdvn{2}{\vb{B}}{t} + &= \nabla (\nabla \cdot \vb{B}) - \nabla^2 \vb{B} + = - \nabla^2 \vb{B} +\end{aligned}$$ + +This describes $\vb{B}$. +Next, we repeat the process for $\vb{E}$: +taking the curl of Faraday's law yields: + +$$\begin{aligned} + \nabla \cross (\nabla \cross \vb{E}) + = - \pdv{}{t}(\nabla \cross \vb{B}) + = - \mu_0 \mu_r \varepsilon_0 \varepsilon_r \pdvn{2}{\vb{E}}{t} +\end{aligned}$$ + +Which can be rewritten using same vector identity as before, +and then reduced by assuming that there is no net charge density $\rho = 0$ +in Gauss' law, such that $\nabla \cdot \vb{E} = 0$: + +$$\begin{aligned} + - \mu_0 \mu_r \varepsilon_0 \varepsilon_r \pdvn{2}{\vb{E}}{t} + &= \nabla (\nabla \cdot \vb{E}) - \nabla^2 \vb{E} + = - \nabla^2 \vb{E} +\end{aligned}$$ + +We thus arrive at the following two (implicitly coupled) +wave equations for $\vb{E}$ and $\vb{B}$, +where we have defined the phase velocity $v \equiv 1 / \sqrt{\mu_0 \mu_r \varepsilon_0 \varepsilon_r}$: + +$$\begin{aligned} + \boxed{ + \pdvn{2}{\vb{E}}{t} - \frac{1}{v^2} \nabla^2 \vb{E} + = 0 + } + \qquad \quad + \boxed{ + \pdvn{2}{\vb{B}}{t} - \frac{1}{v^2} \nabla^2 \vb{B} + = 0 + } +\end{aligned}$$ + +Traditionally, it is said that the solutions are as follows, +where the wavenumber $|\vb{k}| = \omega / v$: + +$$\begin{aligned} + \vb{E}(\vb{r}, t) + &= \vb{E}_0 \exp(i \vb{k} \cdot \vb{r} - i \omega t) + \\ + \vb{B}(\vb{r}, t) + &= \vb{B}_0 \exp(i \vb{k} \cdot \vb{r} - i \omega t) +\end{aligned}$$ + +In fact, thanks to linearity, these **plane waves** can be treated as +terms in a Fourier series, meaning that virtually +*any* function $f(\vb{k} \cdot \vb{r} - \omega t)$ is a valid solution. + +Keep in mind that in reality $\vb{E}$ and $\vb{B}$ are real, +so although it is mathematically convenient to use plane waves, +in the end you will need to take the real part. + + +## Non-uniform medium + +A useful generalization is to allow spatial change +in the relative permittivity $\varepsilon_r(\vb{r})$ +and the relative permeability $\mu_r(\vb{r})$. +We still assume that the medium is linear and isotropic, so: + +$$\begin{aligned} + \vb{D} + = \varepsilon_0 \varepsilon_r(\vb{r}) \vb{E} + \qquad \quad + \vb{B} + = \mu_0 \mu_r(\vb{r}) \vb{H} +\end{aligned}$$ + +Inserting these expressions into Faraday's and Ampère's laws +respectively yields: + +$$\begin{aligned} + \nabla \cross \vb{E} + = - \mu_0 \mu_r(\vb{r}) \pdv{\vb{H}}{t} + \qquad \quad + \nabla \cross \vb{H} + = \varepsilon_0 \varepsilon_r(\vb{r}) \pdv{\vb{E}}{t} +\end{aligned}$$ + +We then divide Ampère's law by $\varepsilon_r(\vb{r})$, +take the curl, and substitute Faraday's law, giving: + +$$\begin{aligned} + \nabla \cross \Big( \frac{1}{\varepsilon_r} \nabla \cross \vb{H} \Big) + = \varepsilon_0 \pdv{}{t}(\nabla \cross \vb{E}) + = - \mu_0 \mu_r \varepsilon_0 \pdvn{2}{\vb{H}}{t} +\end{aligned}$$ + +Next, we exploit linearity by decomposing $\vb{H}$ and $\vb{E}$ +into Fourier series, with terms given by: + +$$\begin{aligned} + \vb{H}(\vb{r}, t) + = \vb{H}(\vb{r}) \exp(- i \omega t) + \qquad \quad + \vb{E}(\vb{r}, t) + = \vb{E}(\vb{r}) \exp(- i \omega t) +\end{aligned}$$ + +By inserting this ansatz into the equation, +we can remove the explicit time dependence: + +$$\begin{aligned} + \nabla \cross \Big( \frac{1}{\varepsilon_r} \nabla \cross \vb{H} \Big) \exp(- i \omega t) + = \mu_0 \varepsilon_0 \omega^2 \mu_r \vb{H} \exp(- i \omega t) +\end{aligned}$$ + +Dividing out $\exp(- i \omega t)$, +we arrive at an eigenvalue problem for $\omega^2$, +with $c = 1 / \sqrt{\mu_0 \varepsilon_0}$: + +$$\begin{aligned} + \boxed{ + \nabla \cross \Big( \frac{1}{\varepsilon_r(\vb{r})} \nabla \cross \vb{H}(\vb{r}) \Big) + = \Big( \frac{\omega}{c} \Big)^2 \mu_r(\vb{r}) \vb{H}(\vb{r}) + } +\end{aligned}$$ + +Compared to a uniform medium, $\omega$ is often not arbitrary here: +there are discrete eigenvalues $\omega$, +corresponding to discrete **modes** $\vb{H}(\vb{r})$. + +Next, we go through the same process to find an equation for $\vb{E}$. +Starting from Faraday's law, we divide by $\mu_r(\vb{r})$, +take the curl, and insert Ampère's law: + +$$\begin{aligned} + \nabla \cross \Big( \frac{1}{\mu_r} \nabla \cross \vb{E} \Big) + = - \mu_0 \pdv{}{t}(\nabla \cross \vb{H}) + = - \mu_0 \varepsilon_0 \varepsilon_r \pdvn{2}{\vb{E}}{t} +\end{aligned}$$ + +Then, by replacing $\vb{E}(\vb{r}, t)$ with our plane-wave ansatz, +we remove the time dependence: + +$$\begin{aligned} + \nabla \cross \Big( \frac{1}{\mu_r} \nabla \cross \vb{E} \Big) \exp(- i \omega t) + = - \mu_0 \varepsilon_0 \omega^2 \varepsilon_r \vb{E} \exp(- i \omega t) +\end{aligned}$$ + +Which, after dividing out $\exp(- i \omega t)$, +yields an analogous eigenvalue problem with $\vb{E}(r)$: + +$$\begin{aligned} + \boxed{ + \nabla \cross \Big( \frac{1}{\mu_r(\vb{r})} \nabla \cross \vb{E}(\vb{r}) \Big) + = \Big( \frac{\omega}{c} \Big)^2 \varepsilon_r(\vb{r}) \vb{E}(\vb{r}) + } +\end{aligned}$$ + +Usually, it is a reasonable approximation +to say $\mu_r(\vb{r}) = 1$, +in which case the equation for $\vb{H}(\vb{r})$ +becomes a Hermitian eigenvalue problem, +and is thus easier to solve than for $\vb{E}(\vb{r})$. + +Keep in mind, however, that in any case, +the solutions $\vb{H}(\vb{r})$ and/or $\vb{E}(\vb{r})$ +must satisfy the two Maxwell's equations that were not explicitly used: + +$$\begin{aligned} + \nabla \cdot (\varepsilon_r \vb{E}) = 0 + \qquad \quad + \nabla \cdot (\mu_r \vb{H}) = 0 +\end{aligned}$$ + +This is equivalent to demanding that the resulting waves are *transverse*, +or in other words, +the wavevector $\vb{k}$ must be perpendicular to +the amplitudes $\vb{H}_0$ and $\vb{E}_0$. + + +## References +1. J.D. Joannopoulos, S.G. Johnson, J.N. Winn, R.D. Meade, + *Photonic crystals: molding the flow of light*, + 2nd edition, Princeton. diff --git a/source/know/concept/equation-of-motion-theory/index.md b/source/know/concept/equation-of-motion-theory/index.md new file mode 100644 index 0000000..81d4d46 --- /dev/null +++ b/source/know/concept/equation-of-motion-theory/index.md @@ -0,0 +1,197 @@ +--- +title: "Equation-of-motion theory" +date: 2021-11-08 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +In many-body quantum theory, **equation-of-motion theory** +is a method to calculate the time evolution of a system's properties +using [Green's functions](/know/concept/greens-functions/). + +Starting from the definition of +the retarded single-particle Green's function $G_{\nu \nu'}^R(t, t')$, +we simply take the $t$-derivative +(we could do the same with the advanced function $G_{\nu \nu'}^A$): + +$$\begin{aligned} + i \hbar \pdv{G^R_{\nu \nu'}(t, t')}{t} + &= \pdv{\Theta(t \!-\! t')}{t} \Expval{\comm{\hat{c}_\nu(t)}{\hat{c}_{\nu'}^\dagger(t')}_{\mp}} + + \Theta(t \!-\! t') \pdv{}{t}\Expval{\comm{\hat{c}_\nu(t)}{\hat{c}_{\nu'}^\dagger(t')}_{\mp}} + \\ + &= \delta(t \!-\! t') \Expval{\comm{\hat{c}_\nu(t)}{\hat{c}_{\nu'}^\dagger(t')}_{\mp}} + + \Theta(t \!-\! t') \Expval{\Comm{\dv{\hat{c}_\nu(t)}{t}}{\hat{c}_{\nu'}^\dagger(t)}_{\mp}} +\end{aligned}$$ + +Where we have used that the derivative +of a [Heaviside step function](/know/concept/heaviside-step-function/) $\Theta$ +is a [Dirac delta function](/know/concept/dirac-delta-function/) $\delta$. +Also, from the [second quantization](/know/concept/second-quantization/), +$\expval{\comm{\hat{c}_\nu(t)}{\hat{c}_{\nu'}^\dagger(t')}_{\mp}}$ +for $t = t'$ is zero when $\nu \neq \nu'$. + +Since we are in the [Heisenberg picture](/know/concept/heisenberg-picture/), +we know the equation of motion of $\hat{c}_\nu(t)$: + +$$\begin{aligned} + \dv{\hat{c}_\nu(t)}{t} + = \frac{i}{\hbar} \comm{\hat{H}_0(t)}{\hat{c}_\nu(t)} + \frac{i}{\hbar} \comm{\hat{H}_\mathrm{int}(t)}{\hat{c}_\nu(t)} +\end{aligned}$$ + +Where the single-particle part of the Hamiltonian $\hat{H}_0$ +and the interaction part $\hat{H}_\mathrm{int}$ +are assumed to be time-independent in the Schrödinger picture. +We thus get: + +$$\begin{aligned} + i \hbar \pdv{G^R_{\nu \nu'}}{t} + &= \delta_{\nu \nu'} \delta(t \!-\! t')+ \frac{i}{\hbar} \Theta(t \!-\! t') + \Expval{\Comm{\comm{\hat{H}_0}{\hat{c}_\nu} + \comm{\hat{H}_\mathrm{int}}{\hat{c}_\nu}}{\hat{c}_{\nu'}^\dagger}_{\mp}} +\end{aligned}$$ + +The most general form of $\hat{H}_0$, for any basis, +is as follows, where $u_{\nu' \nu''}$ are constants: + +$$\begin{aligned} + \hat{H}_0 + = \sum_{\nu' \nu''} u_{\nu' \nu''} \hat{c}_{\nu'}^\dagger \hat{c}_{\nu''} + \quad \implies \quad + \comm{\hat{H}_0}{\hat{c}_\nu} + = - \sum_{\nu''} u_{\nu \nu''} \hat{c}_{\nu''} +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-commH0"/> +<label for="proof-commH0">Proof</label> +<div class="hidden"> +<label for="proof-commH0">Proof.</label> +Using the commutator identity for $\comm{A B}{C}$, +we decompose it like so: + +$$\begin{aligned} + \comm{\hat{H}_0}{\hat{c}_\nu} + &= \sum_{\nu' \nu''} u_{\nu \nu''} \comm{\hat{c}_{\nu'}^\dagger \hat{c}_{\nu''}}{\hat{c}_\nu} + = \sum_{\nu' \nu''} u_{\nu' \nu''} \Big( \hat{c}_{\nu'}^\dagger \comm{\hat{c}_{\nu''}}{\hat{c}_\nu} + + \comm{\hat{c}_{\nu'}^\dagger}{\hat{c}_\nu} \hat{c}_{\nu''} \Big) +\end{aligned}$$ + +Bosons have well-known commutation relations, +so the result follows directly: + +$$\begin{aligned} + \comm{\hat{H}_0}{\hat{b}_\nu} + &= \sum_{\nu' \nu''} u_{\nu' \nu''} \Big( \hat{b}_{\nu'}^\dagger \comm{\hat{b}_{\nu''}}{\hat{b}_\nu} + + \comm{\hat{b}_{\nu'}^\dagger}{\hat{b}_\nu} \hat{b}_{\nu''} \Big) + = - \sum_{\nu''} u_{\nu \nu''} \hat{b}_{\nu''} +\end{aligned}$$ + +Fermions only have anticommutation relations, +so a bit more work is necessary: + +$$\begin{aligned} + \comm{\hat{H}_0}{\hat{f}_{\!\nu}} + &= \sum_{\nu' \nu''} u_{\nu' \nu''} \Big( \hat{f}_{\!\nu'}^\dagger \comm{\hat{f}_{\!\nu''}}{\hat{f}_{\!\nu}} + + \comm{\hat{f}_{\!\nu'}^\dagger}{\hat{f}_{\!\nu}} \hat{f}_{\!\nu''} \Big) + \\ + &= \sum_{\nu' \nu''} u_{\nu' \nu''} \Big( \hat{f}_{\!\nu'}^\dagger \acomm{\hat{f}_{\!\nu''}}{\hat{f}_{\!\nu}} + - 2 \hat{f}_{\!\nu'}^\dagger \hat{f}_{\!\nu} \hat{f}_{\!\nu''} + + \acomm{\hat{f}_{\!\nu'}^\dagger}{\hat{f}_{\!\nu}} \hat{f}_{\!\nu''} + - 2 \hat{f}_{\!\nu} \hat{f}_{\!\nu'}^\dagger \hat{f}_{\!\nu''} \Big) + \\ + &= \sum_{\nu' \nu''} u_{\nu' \nu''} \Big( \delta_{\nu \nu'} \hat{f}_{\!\nu''} + - 2 \acomm{\hat{f}_{\!\nu'}^\dagger}{\hat{f}_{\!\nu}} \hat{f}_{\!\nu''} \Big) + = - \sum_{\nu''} u_{\nu \nu''} \hat{f}_{\!\nu''} +\end{aligned}$$ +</div> +</div> + +Substituting this into $G_{\nu \nu'}^R$'s equation of motion, +we recognize another Green's function $G_{\nu'' \nu'}^R$: + +$$\begin{aligned} + i \hbar \pdv{G^R_{\nu \nu'}}{t} + &= \delta_{\nu \nu'} \delta(t \!-\! t') + \frac{i}{\hbar} \Theta(t \!-\! t') + \bigg( \Expval{\comm{\comm{\hat{H}_\mathrm{int}}{\hat{c}_\nu}}{\hat{c}_{\nu'}^\dagger}_{\mp}} + - \sum_{\nu''} u_{\nu \nu''} \Expval{\comm{\hat{c}_{\nu''}}{\hat{c}_{\nu'}^\dagger}_{\mp}} \bigg) + \\ + &= \delta_{\nu \nu'} \delta(t \!-\! t') + + \frac{i}{\hbar} \Theta(t \!-\! t') \Expval{\comm{\comm{\hat{H}_\mathrm{int}}{\hat{c}_\nu}}{\hat{c}_{\nu'}^\dagger}_{\mp}} + + \sum_{\nu''} u_{\nu \nu''} G_{\nu''\nu'}^R(t, t') +\end{aligned}$$ + +Rearranging this as follows yields the main result +of equation-of-motion theory: + +$$\begin{aligned} + \boxed{ + \sum_{\nu''} \Big( i \hbar \delta_{\nu \nu''} \pdv{}{t} - u_{\nu \nu''} \Big) G^R_{\nu'' \nu'}(t, t') + = \delta_{\nu \nu'} \delta(t \!-\! t') + D_{\nu \nu'}^R(t, t') + } +\end{aligned}$$ + +Where $D_{\nu \nu'}^R$ represents a correction due to interactions $\hat{H}_\mathrm{int}$, +and also has the form of a retarded Green's function, +but with $\hat{c}_{\nu}$ replaced by $\comm{-\hat{H}_\mathrm{int}}{\hat{c}_\nu}$: + +$$\begin{aligned} + \boxed{ + D^R_{\nu'' \nu'}(t, t') + \equiv - \frac{i}{\hbar} \Theta(t \!-\! t') \Expval{\comm{\comm{-\hat{H}_\mathrm{int}(t)}{\hat{c}_\nu(t)}}{\hat{c}_{\nu'}^\dagger(t')}_{\mp}} + } +\end{aligned}$$ + +Unfortunately, calculating $D_{\nu \nu'}^R$ +might still not be doable due to $\hat{H}_\mathrm{int}$. +The key idea of equation-of-motion theory is to either approximate $D_{\nu \nu'}^R$ now, +or to differentiate it again $i \hbar \idv{D_{\nu \nu'}^R}{t}$, +and try again for the resulting corrections, +until a solvable equation is found. +There is no guarantee that that will ever happen; +if not, one of the corrections needs to be approximated. + +For non-interacting particles $\hat{H}_\mathrm{int} = 0$, +so clearly $D_{\nu \nu'}^R$ trivially vanishes then. +Let us assume that $\hat{H}_0$ is also time-independent, +such that $G_{\nu'' \nu'}^R$ only depends on the difference $t - t'$: + +$$\begin{aligned} + \sum_{\nu''} \Big( i \hbar \delta_{\nu \nu''} \pdv{}{t} - u_{\nu \nu''} \Big) G^R_{\nu'' \nu'}(t - t') + = \delta_{\nu \nu'} \delta(t - t') +\end{aligned}$$ + +We take the [Fourier transform](/know/concept/fourier-transform/) +$(t \!-\! t') \to (\omega + i \eta)$, where $\eta \to 0^+$ ensures convergence: + +$$\begin{aligned} + \sum_{\nu''} \Big( \hbar \delta_{\nu \nu''} (\omega + i \eta) - u_{\nu \nu''} \Big) G^R_{\nu'' \nu'}(\omega) + = \delta_{\nu \nu'} +\end{aligned}$$ + +If we assume a diagonal basis $u_{\nu \nu''} = \varepsilon_\nu \delta_{\nu \nu''}$, +this reduces to the following: + +$$\begin{aligned} + \delta_{\nu \nu'} + &= \sum_{\nu''} \Big( \hbar \delta_{\nu \nu''} (\omega + i \eta) - \varepsilon_\nu \delta_{\nu \nu''} \Big) G^R_{\nu'' \nu'}(\omega) + \\ + &= \Big( \hbar (\omega + i \eta) - \varepsilon_\nu \Big) G^R_{\nu \nu'}(\omega) +\end{aligned}$$ + +For a non-interacting, time-independent Hamiltonian, +we therefore arrive at: + +$$\begin{aligned} + \boxed{ + G^R_{\nu \nu'}(\omega) + = \frac{\delta_{\nu \nu'}}{\hbar (\omega + i \eta) - \varepsilon_\nu} + } +\end{aligned}$$ + + + +## References +1. H. Bruus, K. Flensberg, + *Many-body quantum theory in condensed matter physics*, + 2016, Oxford. diff --git a/source/know/concept/euler-bernoulli-law/index.md b/source/know/concept/euler-bernoulli-law/index.md new file mode 100644 index 0000000..37212d2 --- /dev/null +++ b/source/know/concept/euler-bernoulli-law/index.md @@ -0,0 +1,308 @@ +--- +title: "Euler-Bernoulli law" +date: 2021-06-03 +categories: +- Physics +layout: "concept" +--- + +**Euler-Bernoulli beam theory** concerns itself with the bending of beams +(e.g. the metal beams used in large buildings), +subject to certain simplifying assumptions, +which are generally valid for beams that are narrow, +i.e. longitudinally much larger than transversely. + +Consider a beam of length $L$, placed upright +on the $z = 0$ plane, above the origin. +If we pull the top of this beam in the postive $y$-direction, +we assume that it bends uniformly, +i.e. with constant radius of [curvature](/know/concept/curvature/) $R$. +We also assume that the bending is **shear-free**: +if we treat the beam as a bundle of elastic strings, +then there is no friction between them. + +The central string has its length unchanged (i.e. still $L$), +while an arbitrary non-central string is extended or compressed to $L'$. +The [Cauchy strain tensor](/know/concept/cauchy-strain-tensor/) element $u_{zz}$ is then: + +$$\begin{aligned} + u_{zz} + = \frac{L' - L}{L} +\end{aligned}$$ + +Because the bending is uniform, the central string +is an arc with radius $R$ and central angle $\theta$, +where $L = \theta R$. +The non-central string has $L' = \theta R'$, +where $R'$ is geometrically shown to be $R' = R - y$, +with $y$ being the $y$-coordinate of that string at the beam's base. +So: + +$$\begin{aligned} + u_{zz} + = \frac{R' - R}{R} + = - \frac{y}{R} +\end{aligned}$$ + +By assumption, there are no shear stresses +and no forces acting on the beam's sides, +so the only nonzero component of the +[Cauchy stress tensor](/know/concept/cauchy-stress-tensor/) $\hat{\sigma}$ +is $\sigma_{zz}$, given by [Hooke's law](/know/concept/hookes-law/): + +$$\begin{aligned} + \sigma_{zz} = E u_{zz} +\end{aligned}$$ + +Where $E$ is the elastic modulus of the material. +By Hooke's inverse law, +the other nonzero strain components are as follows, +where $\nu$ is Poisson's ratio: + +$$\begin{aligned} + u_{xx} + = u_{yy} + = - \frac{\nu}{E} \sigma_{zz} + = - \nu u_{zz} + = \nu \frac{y}{R} +\end{aligned}$$ + +For completeness, we turn the strain tensor $\hat{u}$ +into a full displacement field $\va{u}$: + +$$\begin{aligned} + \boxed{ + u_x = \nu \frac{x y}{R} + \qquad + u_y = \frac{z^2}{2 R} + \nu \frac{y^2 - x^2}{2 R} + \qquad + u_z = - \frac{y z}{R} + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-field"/> +<label for="proof-field">Proof</label> +<div class="hidden"> +<label for="proof-field">Proof.</label> +By integrating the above strains $u_{ii} = \ipdv{u_i}{i}$, +we get the components of $\va{u}$: + +$$\begin{aligned} + u_x + = \nu \frac{x y}{R} + f_x(y, z) + \qquad + u_y + = \nu \frac{y^2}{2 R} + f_y(x, z) + \qquad + u_z + = - \frac{y z}{R} + f_z(x, y) +\end{aligned}$$ + +Where $f_x$, $f_y$ and $f_z$ are integration constants, +which we find by demanding that the off-diagonal strains $u_{ij}$ are zero. +Starting with $u_{xz} = 0$: + +$$\begin{aligned} + 0 + = u_{xz} + = \frac{1}{2} \Big( \pdv{u_x}{z} + \pdv{u_z}{x} \Big) + = \frac{1}{2} \Big( \pdv{f_x}{z} + \pdv{f_z}{x} \Big) +\end{aligned}$$ + +Here, only $f_x$ may depend on $z$, +and only $f_z$ may depend on $x$. +This equation thus tell us: + +$$\begin{aligned} + f_x(y, z) + = z \: g(y) + \qquad \quad + f_z(x, y) + = - x \: g(y) +\end{aligned}$$ + +Where $g(y)$ is an unknown integration constant. +Moving on to $u_{xy} = 0$: + +$$\begin{aligned} + 0 + = \frac{1}{2} \Big( \pdv{u_x}{y} + \pdv{u_y}{x} \Big) + = \frac{1}{2} \Big( \nu \frac{x}{R} + \pdv{f_x}{y} + \pdv{f_y}{x} \Big) +\end{aligned}$$ + +Only $f_x$ may contain $y$, +so its $y$-derivative must be a constant, +so $g(y) = C y$. Therefore: + +$$\begin{aligned} + f_x(y, z) + = C y z + \qquad + f_y(x, z) + = - \nu \frac{x^2}{2 R} - C x z + h(z) + \qquad + f_z(x, y) + = - C x y +\end{aligned}$$ + +Where $h(z)$ is an unknown integration constant. +Finally, we put everything in $u_{yz} = 0$: + +$$\begin{aligned} + 0 + = \frac{1}{2} \Big( \pdv{u_y}{z} + \pdv{u_z}{y} \Big) + = \frac{1}{2} \Big( \pdv{f_y}{z} - \frac{z}{R} + \pdv{f_z}{y} \Big) + = \frac{1}{2} \Big( \!-\! 2 C x + \dv{h}{z} - \frac{z}{R} \Big) +\end{aligned}$$ + +Only the first term contains $x$, so to satisfy this equation, we must set $C = 0$. +The remaining terms then tell us that $h(z) = z^2 / (2 R)$. +Therefore: + +$$\begin{aligned} + f_x = 0 + \qquad + f_y = - \nu \frac{x^2}{2 R} + \frac{z^2}{2 R} + \qquad + f_z = 0 +\end{aligned}$$ + +Inserting this into the components $u_x$, $u_y$ and $u_z$ +then yields the full displacement field. +</div> +</div> + +In any case, the beam experiences a bending torque with an $x$-component $T_x$ given by: + +$$\begin{aligned} + T_x + = - \int_A y \sigma_{zz} \dd{A} + = - \frac{E}{R} \int_A y^2 \dd{A} +\end{aligned}$$ + +Where $A$ is the cross-section. +Th above integral is known as the **area moment**, +and is typically abbreviated by $I$. +This brings us to the **Euler-Bernoulli law**: + +$$\begin{aligned} + \boxed{ + T_x + = - \frac{E I}{R} + } + \qquad \quad + I + \equiv \int_A y^2 \dd{A} +\end{aligned}$$ + +The product $E I$ is called the **flexural rigidity**, +i.e. the beam's "stiffness". +For a small deformation, i.e. a large radius of curvature $R$, +the law can be approximated by: + +$$\begin{aligned} + T_x + \approx - E I \dvn{2}{y}{z} +\end{aligned}$$ + + + +## Slender rods + +A beam that is very thin in the transverse directions ($x$ and $y$ in this case), +can be approximated as a single string or rod $y(z)$. +Each infinitesimal piece $(\dd{y}, \dd{z})$ of the rod +exerts forces $F_y$ and $F_z$ on the next piece, +and is feels external forces-per-length $K_y$ and $K_z$, e.g. gravity. +In order to have equilibrium, the total force must be zero: + +$$\begin{aligned} + 0 + &= F_y(z + \dd{z}) - F_y(z) + K_y(z) \dd{z} + \\ + 0 + &= F_z(z + \dd{z}) - F_z(z) + K_z(z) \dd{z} +\end{aligned}$$ + +Rearranging these relations yields these equations for the internal forces $F_y$ and $F_z$: + +$$\begin{aligned} + \boxed{ + \dv{F_y}{z} + = - K_y + } + \qquad \quad + \boxed{ + \dv{F_z}{z} + = - K_z + } +\end{aligned}$$ + +Meanwhile, the rod also feels a torque with $x$-component $T_x$, +where equilibrium entails: + +$$\begin{aligned} + 0 + = T_x(z + \dd{z}) - T_x(z) + F_z(z) \dd{y} - F_y(z) \dd{z} +\end{aligned}$$ + +This can be rearranged to get a differential equation for $T_x$, namely: + +$$\begin{aligned} + \boxed{ + \dv{T_x}{z} + = F_y - F_z \dv{y}{z} + } +\end{aligned}$$ + +If $F_z$ and $\idv{y}{z}$ are small, the last term can be dropped. +These equations are widely applicable, +but there is one especially important application, +so much so that it is usually what is meant by "Euler-Bernoulli law": +the shape of a laterally loaded rod. + +Consider a beam along the $z$-axis, carrying a lateral load $K_y$, +e.g. its own weight $A g \rho$ or more. +Assuming there is no other load $K_z = 0$ +and $F_y \ll F_z$, the above equations become: + +$$\begin{aligned} + T_x + = - E I \dvn{2}{y}{z} + \qquad + \dv{T_x}{z} + = F_y + \qquad + \dv{F_y}{z} + = - K_y +\end{aligned}$$ + +Which we can simply substitute into each other, +eventually leading to: + +$$\begin{aligned} + \boxed{ + K_y + = \dvn{2}{}{z}\Big( E I \dvn{2}{y}{z} \Big) + } +\end{aligned}$$ + +This is often referred to as the **Euler-Bernoulli law** as well. +Typically the flexural rigidity $EI$ is a constant in $z$, +in which case we can reduce the equation to: + +$$\begin{aligned} + K_y + = E I \dvn{4}{y}{z} +\end{aligned}$$ + +Which is clearly solved by a fourth-order polynomial, +given some boundary conditions. + + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/euler-equations/index.md b/source/know/concept/euler-equations/index.md new file mode 100644 index 0000000..f89d577 --- /dev/null +++ b/source/know/concept/euler-equations/index.md @@ -0,0 +1,182 @@ +--- +title: "Euler equations" +date: 2021-03-31 +categories: +- Physics +- Fluid mechanics +- Fluid dynamics +layout: "concept" +--- + +The **Euler equations** are a system of partial differential equations +that govern the movement of **ideal fluids**, +i.e. fluids without viscosity. +There exist several forms, depending on +the surrounding assumptions about the fluid. + + +## Incompressible fluid + +In a fluid moving according to the velocity vield $\va{v}(\va{r}, t)$, +the acceleration felt by a particle is given by +the **material acceleration field** $\va{w}(\va{r}, t)$, +which is the [material derivative](/know/concept/material-derivative/) of $\va{v}$: + +$$\begin{aligned} + \va{w} + \equiv \frac{\mathrm{D} \va{v}}{\mathrm{D} t} + = \pdv{\va{v}}{t} + (\va{v} \cdot \nabla) \va{v} +\end{aligned}$$ + +This infinitesimal particle obeys Newton's second law, +which can be written as follows: + +$$\begin{aligned} + \va{w} \dd{m} + = \va{w} \rho \dd{V} + = \va{f^*} \dd{V} +\end{aligned}$$ + +Where $\dd{m}$ and $\dd{V}$ are the particle's mass volume, +and $\rho$ is the fluid density, which we assume, in this case, to be constant in space and time. +Then the **effective force density** $\va{f^*}$ represents the net force-per-particle. +By dividing the law by $\dd{V}$, we find: + +$$\begin{aligned} + \rho \va{w} + = \va{f^*} +\end{aligned}$$ + +Next, we want to find another expression for $\va{f^*}$. +We know that the overall force $\va{F}$ on an arbitrary volume $V$ of the fluid +is the sum of the gravity body force $\va{F}_g$, +and the pressure contact force $\va{F}_p$ on the enclosing surface $S$. +Using the divergence theorem, we then find: + +$$\begin{aligned} + \va{F} + = \va{F}_g + \va{F}_p + = \int_V \rho \va{g} \dd{V} - \oint_S p \dd{\va{S}} + = \int_V (\rho \va{g} - \nabla p) \dd{V} + = \int_V \va{f^*} \dd{V} +\end{aligned}$$ + +Where $p(\va{r}, t)$ is the pressure field, +and $\va{g}(\va{r}, t)$ is the gravitational acceleration field. +Combining this with Newton's law, we find the following equation for the force density: + +$$\begin{aligned} + \va{f^*} + = \rho \va{w} + = \rho \va{g} - \nabla p +\end{aligned}$$ + +Dividing this by $\rho$, +we get the first of the system of Euler equations: + +$$\begin{aligned} + \boxed{ + \va{w} + = \frac{\mathrm{D} \va{v}}{\mathrm{D} t} + = \va{g} - \frac{\nabla p}{\rho} + } +\end{aligned}$$ + +The last ingredient is **incompressibility**: +the same volume must simultaneously +be flowing in and out of an arbitrary enclosure $S$. +Then, by the divergence theorem: + +$$\begin{aligned} + 0 + = \oint_S \va{v} \cdot \dd{\va{S}} + = \int_V \nabla \cdot \va{v} \dd{V} +\end{aligned}$$ + +Since $S$ and $V$ are arbitrary, +the integrand must vanish by itself everywhere: + +$$\begin{aligned} + \boxed{ + \nabla \cdot \va{v} = 0 + } +\end{aligned}$$ + +Combining this with the equation for $\va{w}$, +we get a system of two coupled differential equations: +these are the Euler equations for an incompressible fluid +with spatially uniform density $\rho$: + +$$\begin{aligned} + \boxed{ + \frac{\mathrm{D} \va{v}}{\mathrm{D} t} + = \va{g} - \frac{\nabla p}{\rho} + \qquad \quad + \nabla \cdot \va{v} + = 0 + } +\end{aligned}$$ + +The above form is straightforward to generalize to incompressible fluids +with non-uniform spatial densities $\rho(\va{r}, t)$. +In other words, these fluids are "lumpy" (variable density), +but the size of their lumps does not change (incompressibility). + +To update the equations, we demand conservation of mass: +the mass evolution of a volume $V$ +is equal to the mass flow through its boundary $S$. +Applying the divergence theorem again: + +$$\begin{aligned} + 0 + = \dv{}{t}\int_V \rho \dd{V} + \oint_S \rho \va{v} \cdot \dd{\va{S}} + = \int_V \dv{\rho}{t} + \nabla \cdot (\rho \va{v}) \dd{V} +\end{aligned}$$ + +Since $V$ is arbitrary, the integrand must be zero. +This leads to the following **continuity equation**, +to which we apply a vector identity: + +$$\begin{aligned} + 0 + = \dv{\rho}{t} + \nabla \cdot (\rho \va{v}) + = \dv{\rho}{t} + (\va{v} \cdot \nabla) \rho + \rho (\nabla \cdot \va{v}) +\end{aligned}$$ + +Thanks to incompressibility, the last term disappears, +leaving us with a material derivative: + +$$\begin{aligned} + \boxed{ + 0 + = \frac{\mathrm{D} \rho}{\mathrm{D} t} + = \dv{\rho}{t} + (\va{v} \cdot \nabla) \rho + } +\end{aligned}$$ + +Putting everything together, Euler's system of equations +now takes the following form: + +$$\begin{aligned} + \boxed{ + \frac{\mathrm{D} \va{v}}{\mathrm{D} t} + = \va{g} - \frac{\nabla p}{\rho} + \qquad + \nabla \cdot \va{v} + = 0 + \qquad + \frac{\mathrm{D} \rho}{\mathrm{D} t} + = 0 + } +\end{aligned}$$ + +Usually, however, when discussing incompressible fluids, +$\rho$ is assumed to be spatially uniform, +in which case the latter equation is trivially satisfied. + + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/fabry-perot-cavity/cavity.png b/source/know/concept/fabry-perot-cavity/cavity.png Binary files differnew file mode 100644 index 0000000..f7b0c2a --- /dev/null +++ b/source/know/concept/fabry-perot-cavity/cavity.png diff --git a/source/know/concept/fabry-perot-cavity/index.md b/source/know/concept/fabry-perot-cavity/index.md new file mode 100644 index 0000000..e2852d4 --- /dev/null +++ b/source/know/concept/fabry-perot-cavity/index.md @@ -0,0 +1,233 @@ +--- +title: "Fabry-Pérot cavity" +date: 2021-09-18 +categories: +- Physics +- Optics +- Laser theory +layout: "concept" +--- + +In its simplest form, a **Fabry-Pérot cavity** +is a region of light-transmitting medium surrounded by two mirrors, +which may transmit some of the incoming light. +Such a setup can be used as e.g. an interferometer or a laser cavity. + +Below, we calculate its quasinormal modes in 1D. +We divide the $x$-axis into three domains: left $L$, center $C$, and right $R$. +The cavity $C$ has length $\ell$ and is centered on $x = 0$. +Let $n_L$, $n_C$ and $n_R$ be the respective domains' refractive indices: + +<a href="cavity.png"> +<img src="cavity.png" style="width:70%"> +</a> + + +## Microscopic cavity + +In its simplest "microscopic" form, the reflection at the boundaries +is simply caused by the index differences there. +Consider this ansatz for the [electric field](/know/concept/electric-field/) $E_m(x)$, +where $m$ is the mode: + +$$\begin{aligned} + E_m(x) + = \begin{cases} + A_1 e^{- i k_m n_L x} & \mathrm{for}\; x < -\ell/2 \\ + A_2 e^{- i k_m n_C x} + A_3 e^{i k_m n_C x} & \mathrm{for}\; \!-\!\ell/2 < x < \ell/2 \\ + A_4 e^{i k_m n_R x} & \mathrm{for}\; x > \ell/2 + \end{cases} +\end{aligned}$$ + +The goal is to find the modes' wavenumbers $k_m$. +First, we demand that $E_m$ and its derivative $\idv{E_m}{x}$ +are continuous at the boundaries $x = \pm \ell/2$: + +$$\begin{aligned} + A_1 e^{i k_m n_L \ell/2} + &= A_2 e^{i k_m n_C \ell/2} + A_3 e^{- i k_m n_C \ell/2} + \\ + A_4 e^{i k_m n_R \ell/2} + &= A_2 e^{- i k_m n_C \ell/2} + A_3 e^{i k_m n_C \ell/2} +\end{aligned}$$ +$$\begin{aligned} + - i k_m n_L A_1 e^{i k_m n_L \ell/2} + &= - i k_m n_C A_2 e^{i k_m n_C \ell/2} + i k_m n_C A_3 e^{- i k_m n_C \ell/2} + \\ + i k_m n_R A_4 e^{i k_m n_R \ell/2} + &= - i k_m n_C A_2 e^{- i k_m n_C \ell/2} + i k_m n_C A_3 e^{i k_m n_C \ell/2} +\end{aligned}$$ + +Rearranging the four equations above yields the following linear system: + +$$\begin{aligned} + 0 + &= A_1 - A_2 e^{i k_m (n_C - n_L) \ell/2} - A_3 e^{- i k_m (n_C + n_L) \ell/2} + \\ + 0 + &= A_2 e^{- i k_m (n_C + n_R) \ell/2} + A_3 e^{i k_m (n_C - n_R) \ell/2} - A_4 + \\ + 0 + &= n_L A_1 + n_C \big( A_3 e^{- i k_m (n_C + n_L) \ell/2} - A_2 e^{i k_m (n_C - n_L) \ell/2} \big) + \\ + 0 + &= n_C \big( A_3 e^{i k_m (n_C - n_R) \ell/2} - A_2 e^{- i k_m (n_C + n_R) \ell/2} \big) - n_R A_4 +\end{aligned}$$ + +Which can be rewritten in matrix form as follows, with the system matrix on the left: + +$$\begin{aligned} + \begin{bmatrix} + 1 & -e^{i k_m (n_C - n_L) \ell/2} & -e^{- i k_m (n_C + n_L) \ell/2} & 0 \\ + 0 & e^{- i k_m (n_C + n_R) \ell/2} & e^{i k_m (n_C - n_R) \ell/2} & -1 \\ + n_L & -n_C e^{i k_m (n_C - n_L) \ell/2} & n_C e^{- i k_m (n_C + n_L) \ell/2} & 0 \\ + 0 & -n_C e^{- i k_m (n_C + n_R) \ell/2} & n_C e^{i k_m (n_C - n_R) \ell/2} & -n_R + \end{bmatrix} + \cdot + \begin{bmatrix} + A_1 \\ A_2 \\ A_3 \\ A_4 + \end{bmatrix} + = + \begin{bmatrix} + 0 \\ 0 \\ 0 \\ 0 + \end{bmatrix} +\end{aligned}$$ + +We want non-trivial solutions, where we +cannot simply satisfy the system by setting $A_1$, $A_2$, $A_3$ and +$A_4$; this constraint will give us an equation for $k_m$. Therefore, we +demand that the system matrix is singular, i.e. its determinant is zero: + +$$\begin{aligned} + 0 = + &- n_C (n_L + n_R) \big( e^{i k_m (2 n_C - n_L - n_R) \ell/2} + e^{- i k_m (2 n_C + n_L + n_R) \ell/2} \big) + \\ + &+ (n_C^2 + n_L n_R) \big( e^{i k_m (2 n_C - n_L - n_R) \ell/2} - e^{- i k_m (2 n_C + n_L + n_R) \ell/2} \big) +\end{aligned}$$ + +We multiply by $e^{i k_m (n_L + n_R) \ell / 2}$ and +decompose the exponentials into sines and cosines: + +$$\begin{aligned} + 0 + = i 2 (n_C^2 + n_L n_R) \sin(k_m n_C \ell) + - 2 n_C (n_L + n_R) \cos(k_m n_C \ell) +\end{aligned}$$ + +Finally, some further rearranging gives a convenient transcendental equation: + +$$\begin{aligned} + \boxed{ + 0 + = \tan(k_m n_C \ell) + i \frac{n_C (n_L + n_R)}{n_C^2 + n_L n_R} + } +\end{aligned}$$ + +Thanks to linearity, we can choose one of the amplitudes +$A_1$, $A_2$, $A_3$ or $A_4$ freely, +and then the others are determined by $k_m$ and the field's continuity. + + +## Macroscopic cavity + +Next, consider a "macroscopic" Fabry-Pérot cavity +with complex mirror structures at boundaries, e.g. Bragg reflectors. +If the cavity is large enough, we can neglect the mirrors' thicknesses, +and just use their reflection coefficients $r_L$ and $r_R$. +We use the same ansatz: + +$$\begin{aligned} + E_m(x) + = + \begin{cases} + A_1 e^{-i k_m n_L x} & \mathrm{for}\; x < -\ell/2 \\ + A_2 e^{-i k_m n_C x} + A_3 e^{i k_m n_C x} & \mathrm{for}\; \!-\!\ell/2 < x < \ell/2 \\ + A_4 e^{i k_m n_R x} & \mathrm{for}\; \ell/2 < x + \end{cases} +\end{aligned}$$ + +On the left, $A_3$ is the reflection of $A_2$, +and on the right, $A_2$ is the reflection of $A_3$, +where the reflected amplitudes are determined +by the coefficients $r_L$ and $r_R$, respectively: + +$$\begin{aligned} + A_3 e^{- i k_m n_C \ell/2} + &= r_L A_2 e^{i k_m n_C \ell/2} + \\ + A_2 e^{-i k_m n_C \ell/2} + &= r_R A_3 e^{i k_m n_C \ell/2} +\end{aligned}$$ + +These equations might seem to contradict each other. +We recast them into matrix form: + +$$\begin{aligned} + \begin{bmatrix} + 1 & - r_R e^{i k_m n_C \ell} \\ + - r_L e^{i k_m n_C \ell} & 1 + \end{bmatrix} + \cdot + \begin{bmatrix} + A_2 \\ A_3 + \end{bmatrix} + = + \begin{bmatrix} + 0 \\ 0 + \end{bmatrix} +\end{aligned}$$ + +Again, we demand that the determinant is zero, in order to get non-trivial solutions: + +$$\begin{aligned} + 0 + &= 1 - r_L r_R e^{i 2 k_m n_C \ell} +\end{aligned}$$ + +Isolating this for $k_m$ yields the following modes, +where $m$ is an arbitrary integer: + +$$\begin{aligned} + \boxed{ + k_m + = - \frac{\ln(r_L r_R) + i 2 \pi m}{i 2 n_C \ell} + } +\end{aligned}$$ + +These $k_m$ satisfy the matrix equation above. +Thanks to linearity, we can choose one of $A_2$ or $A_3$, +and then the other is determined by the corresponding reflection equation. + +Finally, we look at the light transmitted through the mirrors, +according to $1 \!-\! r_L$ and $1 \!-\! r_R$: + +$$\begin{aligned} + A_1 e^{i k_m n_L \ell/2} + &= (1 - r_L) A_2 e^{i k_m n_C \ell/2} + \\ + A_4 e^{i k_m n_R \ell/2} + &= (1 - r_R) A_3 e^{i k_m n_C \ell/2} +\end{aligned}$$ + +We simply isolate for $A_1$ and $A_4$ respectively, +yielding the following amplitudes: + +$$\begin{aligned} + A_1 + &= (1 - r_L) A_2 e^{i k_m (n_C - n_L) \ell/2} + \\ + A_4 + &= (1 - r_R) A_3 e^{i k_m (n_C - n_R) \ell/2} +\end{aligned}$$ + +Note that we have not demanded continuity of the electric field. +This is because the mirrors are infinitely thin "magic" planes; +had we instead used the full mirror structure, +then we would have demanded continuity, as you maybe expected. + + + +## References +1. P.T. Kristensen, K. Herrmann, F. Intravaia, K. Busch, + [Modeling electromagnetic resonators using quasinormal modes](https://doi.org/10.1364/AOP.377940), + 2020, Optical Society of America. diff --git a/source/know/concept/fermi-dirac-distribution/index.md b/source/know/concept/fermi-dirac-distribution/index.md new file mode 100644 index 0000000..7fc4f0e --- /dev/null +++ b/source/know/concept/fermi-dirac-distribution/index.md @@ -0,0 +1,80 @@ +--- +title: "Fermi-Dirac distribution" +date: 2021-07-11 +categories: +- Physics +- Statistics +- Quantum mechanics +layout: "concept" +--- + +**Fermi-Dirac statistics** describe how identical **fermions**, +which obey the [Pauli exclusion principle](/know/concept/pauli-exclusion-principle/), +will distribute themselves across the available states in a system at equilibrium. + +Consider one single-particle state $s$, +which can contain $0$ or $1$ fermions. +Because the occupation number $N$ is variable, +we turn to the [grand canonical ensemble](/know/concept/grand-canonical-ensemble/), +whose grand partition function $\mathcal{Z}$ is as follows, +where we sum over all microstates of $s$: + +$$\begin{aligned} + \mathcal{Z} + = \sum_{N = 0}^1 \exp(- \beta N (\varepsilon - \mu)) + = 1 + \exp(- \beta (\varepsilon - \mu)) +\end{aligned}$$ + +Where $\mu$ is the chemical potential, +and $\varepsilon$ is the energy contribution per particle in $s$, +i.e. the total energy of all particles $E = \varepsilon N$. + +The corresponding [thermodynamic potential](/know/concept/thermodynamic-potential/) +is the Landau potential $\Omega$, given by: + +$$\begin{aligned} + \Omega + = - k T \ln{\mathcal{Z}} + = - k T \ln\!\Big( 1 + \exp(- \beta (\varepsilon - \mu)) \Big) +\end{aligned}$$ + +The average number of particles $\Expval{N}$ +in state $s$ is then found to be as follows: + +$$\begin{aligned} + \Expval{N} + = - \pdv{\Omega}{\mu} + = k T \pdv{\ln{\mathcal{Z}}}{\mu} + = \frac{\exp(- \beta (\varepsilon - \mu))}{1 + \exp(- \beta (\varepsilon - \mu))} +\end{aligned}$$ + +By multiplying both the numerator and the denominator by $\exp(\beta (\varepsilon \!-\! \mu))$, +we arrive at the standard form of +the **Fermi-Dirac distribution** or **Fermi function** $f_F$: + +$$\begin{aligned} + \boxed{ + \Expval{N} + = f_F(\varepsilon) + = \frac{1}{\exp(\beta (\varepsilon - \mu)) + 1} + } +\end{aligned}$$ + +This tells the expected occupation number $\Expval{N}$ of state $s$, +given a temperature $T$ and chemical potential $\mu$. +The corresponding variance $\sigma^2$ of $N$ is found to be: + +$$\begin{aligned} + \boxed{ + \sigma^2 + = k T \pdv{\Expval{N}}{\mu} + = \Expval{N} \big(1 - \Expval{N}\big) + } +\end{aligned}$$ + + + +## References +1. H. Gould, J. Tobochnik, + *Statistical and thermal physics*, 2nd edition, + Princeton. diff --git a/source/know/concept/fermis-golden-rule/index.md b/source/know/concept/fermis-golden-rule/index.md new file mode 100644 index 0000000..f64e9df --- /dev/null +++ b/source/know/concept/fermis-golden-rule/index.md @@ -0,0 +1,86 @@ +--- +title: "Fermi's golden rule" +date: 2021-07-10 +categories: +- Physics +- Quantum mechanics +- Two-level system +- Optics +layout: "concept" +--- + +In quantum mechanics, **Fermi's golden rule** expresses +the transition rate between two states of a system, +when a sinusoidal perturbation is applied +at the resonance frequency $\omega = E_g / \hbar$ of the +energy gap $E_g$. The main conclusion is that the rate is independent of +time. + +From [time-dependent perturbation theory](/know/concept/time-dependent-perturbation-theory/), +we know that the transition probability +for a particle in state $\Ket{a}$ to go to $\Ket{b}$ +is as follows for a periodic perturbation at frequency $\omega$: + +$$\begin{aligned} + P_{ab} + = \frac{|V_{ba}|^2}{\hbar^2} \frac{\sin^2\!\big((\omega_{ba} - \omega) t / 2\big)}{(\omega_{ba} - \omega)^2} +\end{aligned}$$ + +Where $\omega_{ba} \equiv (E_b - E_a) / \hbar$. +If we assume that $\Ket{b}$ irreversibly absorbs an unlimited number of particles, +then we can interpret $P_{ab}$ as the "amount" of the current particle +that has transitioned since the last period $2 \pi n / (\omega_{ba} \!-\! \omega)$. + +For generality, let $E_b$ be the center +of a state continuum with width $\Delta E$. +In that case, $P_{ab}$ must be modified as follows, +where $\rho(E_x)$ is the destination's +[density of states](/know/concept/density-of-states/): + +$$\begin{aligned} + P_{ab} + &= \frac{|V_{ba}|^2}{\hbar^2} \int_{E_b - \Delta E / 2}^{E_b + \Delta E / 2} + \frac{\sin^2\!\big((\omega_{xa} - \omega) t / 2\big)}{(\omega_{xa} - \omega)^2} \:\rho(E_x) \dd{E_x} +\end{aligned}$$ + +If $E_b$ is not in a continuum, then $\rho(E_x) = \delta(E_x - E_b)$. +The integrand is a sharp sinc-function around $E_x$. +For large $t$, it is so sharp that we can take out $\rho(E_x)$. +In that case, we also simplify the integration limits. +Then we substitute $x \equiv (\omega_{xa}\!-\!\omega) / 2$ to get: + +$$\begin{aligned} + P_{ab} + &\approx \frac{2}{\hbar} |V_{ba}|^2 \rho(E_b) \int_{-\infty}^\infty \frac{\sin^2(x t)}{x^2} \:dx +\end{aligned}$$ + +This definite integral turns out to be $\pi |t|$, +so we find, because clearly $t > 0$: + +$$\begin{aligned} + P_{ab} + &= \frac{2 \pi}{\hbar} |V_{ba}|^2 \rho(E_b) \: t +\end{aligned}$$ + +The transition rate $R_{ab}$, +i.e. the number of particles per unit time, +then takes this form: + +$$\begin{aligned} + \boxed{ + R_{ab} + = \pdv{P_{ab}}{t} + = \frac{2 \pi}{\hbar} |V_{ba}|^2 \rho(E_b) + } +\end{aligned}$$ + +Note that the $t$-dependence has disappeared, +and all that remains is a constant factor involving $E_b = E_a \!+\! \hbar \omega$, +where $\omega$ is the resonance frequency. + + + +## References +1. D.J. Griffiths, D.F. Schroeter, + *Introduction to quantum mechanics*, 3rd edition, + Cambridge. diff --git a/source/know/concept/feynman-diagram/conservation.png b/source/know/concept/feynman-diagram/conservation.png Binary files differnew file mode 100644 index 0000000..1d19fd0 --- /dev/null +++ b/source/know/concept/feynman-diagram/conservation.png diff --git a/source/know/concept/feynman-diagram/freegf.png b/source/know/concept/feynman-diagram/freegf.png Binary files differnew file mode 100644 index 0000000..632ccaf --- /dev/null +++ b/source/know/concept/feynman-diagram/freegf.png diff --git a/source/know/concept/feynman-diagram/fullgf.png b/source/know/concept/feynman-diagram/fullgf.png Binary files differnew file mode 100644 index 0000000..f376ef2 --- /dev/null +++ b/source/know/concept/feynman-diagram/fullgf.png diff --git a/source/know/concept/feynman-diagram/index.md b/source/know/concept/feynman-diagram/index.md new file mode 100644 index 0000000..15410f7 --- /dev/null +++ b/source/know/concept/feynman-diagram/index.md @@ -0,0 +1,332 @@ +--- +title: "Feynman diagram" +date: 2021-11-18 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +When doing calculations in the context of condensed matter physics and quantum field theory, +**Feynman diagrams** graphically represent expressions +that would be tedious or error-prone to work with directly. +This article is about condensed matter physics. + +Suppose we have a many-particle Hamiltonian $\hat{H} = \hat{H}_0 + \hat{H}_1$, +consisting of an "easy" term $\hat{H}_0$, +and then a "difficult" term $\hat{H}_1$ +with time-dependent and/or interacting parts. +Let $\Ket{\Phi_0}$ be a known eigenstate (or superposition thereof) +of the easily solvable part $\hat{H}_0$, +with respect to which we will take expectation values $\Expval{}$. + +Below, we go through the most notable components of Feynman diagrams +and how to translate them into a mathematical expression. + + +## Real space + +The most common component is a **fermion line**, which represents +a [Green's function](/know/concept/greens-functions/) $G^0$ +for the simple Hamiltonian $\hat{H}_0$. +Any type of Green's function is possible in theory (e.g. a retarded), +but usually the *causal* function is used. +Let the subscript $I$ refer to the +[interaction picture](/know/concept/interaction-picture/), +and $\mathcal{T}\{\}$ denote the +[time-ordered product](/know/concept/time-ordered-product/): + +<a href="freegf.png"> +<img src="freegf.png" style="width:60%"> +</a> +$$\begin{aligned} + = i \hbar G_{s_2 s_1}^0(\vb{r}_2, t_2; \vb{r}_1, t_1) + = \Expval{\mathcal{T} \Big\{ \hat{\Psi}_{s_2 I}(\vb{r}_2, t_2) \hat{\Psi}_{s_1 I}^\dagger(\vb{r}_1, t_1) \Big\}} +\end{aligned}$$ + +The arrow points in the direction of time, or more generally, +from the point of creation $\hat{\Psi}{}^\dagger$ +to the point of annihilation $\hat{\Psi}$. +The dots at the ends are called **vertices**, +which represent points in space and time with a spin. +Vertices can be +**internal** (one Green's function entering AND one leaving) +or **external** (either one Green's function entering OR one leaving). + +Less common is a **heavy fermion line**, representing +a causal Green's function $G$ for the entire Hamiltonian $\hat{H}$, +where the subscript $H$ refers to the [Heisenberg picture](/know/concept/heisenberg-picture/): + +<a href="fullgf.png"> +<img src="fullgf.png" style="width:60%"> +</a> +$$\begin{aligned} + = i \hbar G_{s_2 s_1}(\vb{r}_2, t_2; \vb{r}_1, t_1) + = \Expval{\mathcal{T} \Big\{ \hat{\Psi}_{s_2 H}(\vb{r}_2, t_2) \hat{\Psi}_{s_1 H}^\dagger(\vb{r}_1, t_1) \Big\}} +\end{aligned}$$ + +Next, an **interaction line** or **boson line** represents +a two-body interaction operator $\hat{W}$ (in $\hat{H}_1$), +which we assume to be instantaneous, i.e. time-independent +(in quantum field theory this is *not* assumed), +hence it starts and ends at the same time, +and no arrow is drawn: + +<a href="interaction.png"> +<img src="interaction.png" style="width:60%"> +</a> +$$\begin{aligned} + = \frac{1}{i \hbar} W_{s_2 s_1}(\vb{r}_2, t_2; \vb{r}_1, t_1) + = \frac{1}{i \hbar} W(\vb{r}_2, \vb{r}_1; t_1) \: \delta(t_2 - t_1) +\end{aligned}$$ + +We have chosen to disallow spin flipping, +so $W$ does not depend on $s_1$ or $s_2$. +For reference, this function $W$ +has a time-dependence coming only from the interaction picture, +and is to be used as follows to get the full two-body operator $\hat{W}$: + +$$\begin{aligned} + \hat{W} + = \frac{1}{2} \sum_{s_1 s_2} \iint_{-\infty}^\infty \hat{\Psi}_{s_1}^\dagger(\vb{r}_1) \hat{\Psi}_{s_2}^\dagger(\vb{r}_2) + W(\vb{r}_1, \vb{r}_2) \hat{\Psi}_{s_2}(\vb{r}_2) \hat{\Psi}_{s_1}(\vb{r}_1) \dd{\vb{r}_1} \dd{\vb{r}_2} +\end{aligned}$$ + +One-body (time-dependent) operators $\hat{V}$ in $\hat{H}_1$ +are instead represented by a special vertex: + +<a href="perturbation.png"> +<img src="perturbation.png" style="width:35%"> +</a> +$$\begin{aligned} + = \frac{1}{i \hbar} V_s(\vb{r}, t) +\end{aligned}$$ + +Other graphical components exist representing +more complicated operators and quantities, +but these deserve their own articles. + +In order for a given Feynman diagram to be valid, +it must satisfy the following criteria: + +a. Each vertex must be connected to one or two fermion lines, + at most one of which leaves, + and at most one of which enters. +b. Each internal vertex contains at most one "event"; + which could be $V$ or $W$. + +Finally, we need some additional rules to convert +diagrams into mathematical expressions: + +1. Disallow spin flipping by multiplying + each internal vertex by $\delta_{s_\mathrm{in} s_\mathrm{out}}$. +2. If both ends of a line are at the same time (always the case for $W$), + an infinitesimal $\eta \to 0^+$ must be added + to the time of all creation operators, + so e.g. $G(t, t) \to G(t, t\!+\!\eta)$. +3. Integrate over spacetime coordinates $(\vb{r}, t)$ + and sum over the spin $s$ of all internal vertices, + but not external ones. +4. Multiply the result by $(-1)^F$, + where $F$ is the number of closed fermion loops. +5. Depending on the context, additional constant factors may be required; + sometimes they are changed on-the-fly during a calculation. + +Note that rules 4 and 5 are convention, +just like the factors $i \hbar$ in $G^0$, $G$, $V$ and $W$; +it simply turns out to be nicer to do it this way +when using Feynman diagrams in the wild. + +The combination of rules 2 and 3 means that spin +belongs to lines rather than vertices, +so that a particle with a given spin propagates +from vertex to vertex without getting flipped. + + +## Fourier space + +If the system is time-independent and spatially uniform, +meaning it has continuous translational symmetry in time and space, +then it is useful to work in [Fourier space](/know/concept/fourier-transform/): + +$$\begin{aligned} + G_{s_2 s_1}^0(\vb{r}_2, t_2; \vb{r}_1, t_1) + &= G_{s_1}^0(\vb{r}_2 - \vb{r}_1, t_2 - t_1) \: \delta_{s_2 s_1} + \\ + &= \frac{\delta_{s_2 s_1}}{(2 \pi)^4} \iint_{-\infty}^\infty G_{s_1}^0(\vb{k}, \omega) \: + e^{i \vb{k} \cdot (\vb{r}_2 - \vb{r}_1)} e^{- i \omega (t_2 - t_1)} \dd{\vb{k}} \dd{\omega} + \\ + W_{s_2 s_1}(\vb{r}_2, t_2; \vb{r}_1, t_1) + &= W(\vb{r}_2 - \vb{r}_1) \: \delta(t_2 - t_1) + \\ + &= \frac{1}{(2 \pi)^4} \iint_{\infty}^\infty W(\vb{k}) \: + e^{i \vb{k} \cdot (\vb{r}_2 - \vb{r}_1)} e^{- i \omega (t_2 - t_1)} \dd{\vb{k}} \dd{\omega} +\end{aligned}$$ + +Where we have used an integral representation of +the [Dirac delta function](/know/concept/dirac-delta-function/). +Note the inconsistent sign of the exponent +in the Fourier transform definitions for space and time. + +Working in Fourier space allows us to simplify calculations. +Consider the following diagram and the resulting expression, +where $\tilde{\vb{r}} = (\vb{r}, t)$, and $\tilde{\vb{k}} = (\vb{k}, \omega)$: + +<a href="conservation.png"> +<img src="conservation.png" style="width:40%"> +</a> +$$\begin{aligned} + &= (i \hbar)^3 \sum_{s s'} \!\!\iint \dd{\tilde{\vb{r}}} \dd{\tilde{\vb{r}}'} + G_{s_1's}^0(\tilde{\vb{r}}_1', \tilde{\vb{r}}) G_{s s_1}^0(\tilde{\vb{r}}, \tilde{\vb{r}}_1) \delta_{s_1 s_1'} + W(\tilde{\vb{r}}, \tilde{\vb{r}}') + G_{s_2' s'}^0(\tilde{\vb{r}}_2', \tilde{\vb{r}}') G_{s' s_2}^0(\tilde{\vb{r}}', \tilde{\vb{r}}_2) \delta_{s_2 s_2'} + \\ + &= \frac{-i \hbar^3}{(2 \pi)^{20}} + \sum_{s_1 s_2} \!\!\iint \dd{\tilde{\vb{r}}} \dd{\tilde{\vb{r}}'} + \bigg(\! \int \dd{\tilde{\vb{k}}_2} G_{s_1}^0(\tilde{\vb{k}}_2) e^{i \tilde{\vb{k}}_2 \cdot (\tilde{\vb{r}}_1' - \tilde{\vb{r}})} \!\bigg) + \bigg(\! \int \dd{\tilde{\vb{k}}_1} G_{s_1}^0(\tilde{\vb{k}}_1) e^{i \tilde{\vb{k}}_1 \cdot (\tilde{\vb{r}} - \tilde{\vb{r}}_1)} \!\bigg) + \\ + &\qquad\times \bigg(\! \int \dd{\tilde{\vb{p}}} W(\tilde{\vb{p}}) e^{i \tilde{\vb{p}} \cdot (\tilde{\vb{r}}' - \tilde{\vb{r}})} \!\bigg) + \bigg(\! \int \dd{\tilde{\vb{q}}_2} G_{s_2}^0(\tilde{\vb{q}}_2) e^{i \tilde{\vb{q}}_2 \cdot (\tilde{\vb{r}}_2' - \tilde{\vb{r}}')} \!\bigg) + \bigg(\! \int \dd{\tilde{\vb{q}}_1} G_{s_2}^0(\tilde{\vb{q}}_1) e^{i \tilde{\vb{q}}_1 \cdot (\tilde{\vb{r}}' - \tilde{\vb{r}}_2)} \!\bigg) + \\ + &= \frac{-i \hbar^3}{(2 \pi)^{12}} + \sum_{s_1 s_2} \!\!\iint \dd{\tilde{\vb{k}}_1} \dd{\tilde{\vb{k}}_2} + G_{s_1}^0(\tilde{\vb{k}}_2) G_{s_1}^0(\tilde{\vb{k}}_1) + \iint \dd{\tilde{\vb{q}}_1} \dd{\tilde{\vb{q}}_2} + G_{s_2}^0(\tilde{\vb{q}}_2) G_{s_2}^0(\tilde{\vb{q}}_1) + \\ + &\qquad\times + e^{i \tilde{\vb{k}}_2 \cdot \tilde{\vb{r}}_1' - i \tilde{\vb{k}}_1 \cdot \tilde{\vb{r}}_1 + + i \tilde{\vb{q}}_2 \cdot \tilde{\vb{r}}_2' - i \tilde{\vb{q}}_1 \cdot \tilde{\vb{r}}_2} + \!\!\int \dd{\tilde{\vb{p}}} W(\tilde{\vb{p}}) + \bigg( \frac{1}{(2 \pi)^8} \!\!\iint \dd{\tilde{\vb{r}}} \dd{\tilde{\vb{r}}'} + e^{i (\tilde{\vb{k}}_1 - \tilde{\vb{k}}_2 - \tilde{\vb{p}}) \cdot \tilde{\vb{r}}} + e^{i (\tilde{\vb{q}}_1 - \tilde{\vb{q}}_2 + \tilde{\vb{p}}) \cdot \tilde{\vb{r}}'} \bigg) + \\ + &= \frac{-i \hbar^3}{(2 \pi)^{12}} + \sum_{s_1 s_2} \!\!\iint \dd{\tilde{\vb{k}}_1} \dd{\tilde{\vb{k}}_2} + G_{s_1}^0(\tilde{\vb{k}}_2) G_{s_1}^0(\tilde{\vb{k}}_1) + \iint \dd{\tilde{\vb{q}}_1} \dd{\tilde{\vb{q}}_2} + G_{s_2}^0(\tilde{\vb{q}}_2) G_{s_2}^0(\tilde{\vb{q}}_1) + \\ + &\qquad\times + e^{i \tilde{\vb{k}}_2 \cdot \tilde{\vb{r}}_1' - i \tilde{\vb{k}}_1 \cdot \tilde{\vb{r}}_1 + + i \tilde{\vb{q}}_2 \cdot \tilde{\vb{r}}_2' - i \tilde{\vb{q}}_1 \cdot \tilde{\vb{r}}_2} + \!\!\int \dd{\tilde{\vb{p}}} W(\tilde{\vb{p}}) + \: \delta(\tilde{\vb{k}}_1 \!-\! \tilde{\vb{k}}_2 \!-\! \tilde{\vb{p}}) + \: \delta(\tilde{\vb{q}}_1 \!-\! \tilde{\vb{q}}_2 \!+\! \tilde{\vb{p}}) + \\ + &= \frac{-i \hbar^3}{(2 \pi)^{12}} + \sum_{s_1 s_2} \!\!\int \dd{\tilde{\vb{p}}} W(\tilde{\vb{p}}) + \int \dd{\tilde{\vb{k}}_1} G_{s_1}^0(\tilde{\vb{k}}_1 \!-\! \tilde{\vb{p}}) G_{s_1}^0(\tilde{\vb{k}}_1) + \int \dd{\tilde{\vb{q}}_1} G_{s_2}^0(\tilde{\vb{q}}_1 \!+\! \tilde{\vb{p}}) G_{s_2}^0(\tilde{\vb{q}}_1) + \\ + &\qquad\times + e^{i \tilde{\vb{k}}_1 \cdot (\tilde{\vb{r}}_1' - \tilde{\vb{r}}_1)} + e^{i \tilde{\vb{q}}_1 \cdot (\tilde{\vb{r}}_2' - \tilde{\vb{r}}_2)} + e^{i \tilde{\vb{p}} \cdot (\tilde{\vb{r}}_2' - \tilde{\vb{r}}_1')} +\end{aligned}$$ + +Conveniently, the Dirac delta functions that appear from the integrals +represent conservation of wavevector $\vb{k}$ (momentum $\hbar \vb{k}$) +and angular frequency $\omega$ (energy $\hbar \omega$). + +In Fourier space, it makes more sense +to regard the incoming energies and momenta and spins as given, +and only integrate over the internal quantities. +We thus modify the Feynman diagram rules +such that we end up with the following result: + +$$\begin{aligned} + \equiv \frac{-i \hbar^3}{(2 \pi)^4} + \sum_{s} \!\!\int \dd{\tilde{\vb{p}}} W(\tilde{\vb{p}}) + \: G_{s_1}^0(\tilde{\vb{k}}_1 \!-\! \tilde{\vb{p}}) \: G_{s_1}^0(\tilde{\vb{k}}_1) + \: G_{s_2}^0(\tilde{\vb{q}}_1 \!+\! \tilde{\vb{p}}) \: G_{s_2}^0(\tilde{\vb{q}}_1) +\end{aligned}$$ + +Therefore, we say that fermion lines represent $i \hbar G_{s}^0(\vb{k}, \omega)$, +interaction lines $W(\vb{k}) / i \hbar$, etc., +and the other interpretation rules are modified to the following: + +1. Each line has a momentum $\vb{k}$ and energy $\omega$, + and each fermion line has a spin $s$; + these must all be conserved at each vertex. +2. If both ends of a *fermion* line would be at the same time, + multiply it by $e^{i \omega \eta}$, + where $\eta \to 0^+$ is a positive infinitesimal, + so e.g. $G(\tau, \tau) \to e^{i \omega \eta} G(\tau, \tau)$. +3. Integrate over all internal $(\vb{k}, \omega)$, + and sum over all internal spins $s$. + Let each $(\vb{k}, \omega)$ integral contribute a factor $1 / (2 \pi)^4$. +4. Multiply the end result by $(-1)^F$, where $F$ is the number of closed fermion loops. +5. Depending on the context, additional constant factors may be required; + sometimes they are changed on-the-fly during a calculation. + +Note that if the diagram is linear (i.e. does not contain interactions), +then conservation removes all internal variables, +so no integrals would be needed. + + +## Imaginary time + +Feynman diagrams are also useful when working with +[imaginary time](/know/concept/imaginary-time/). +In that case, the meaning of fermion lines is changed as follows, +involving the [Matsubara Green's function](/know/concept/matsubara-greens-function/): + +$$\begin{aligned} + i \hbar G_{s_2 s_1}^0(\vb{r}_2, t_2; \vb{r}_1, t_1) + \:\: &\longrightarrow \:\: + \hbar G_{s_2 s_1}^0(\vb{r}_2, \tau_2; \vb{r}_1, \tau_1) + = \Expval{\mathcal{T} \Big\{ \hat{\Psi}_I(\vb{r}_2, \tau_2) \hat{\Psi}_I^\dagger(\vb{r}_1, \tau_1) \Big\}} + \\ + i \hbar G_{s_2 s_1}(\vb{r}_2, t_2; \vb{r}_1, t_1) + \:\: &\longrightarrow \:\: + \hbar G_{s_2 s_1}(\vb{r}_2, \tau_2; \vb{r}_1, \tau_1) + = \Expval{\mathcal{T} \Big\{ \hat{\Psi}_H(\vb{r}_2, \tau_2) \hat{\Psi}_H^\dagger(\vb{r}_1, \tau_1) \Big\}} +\end{aligned}$$ + +Where the time-ordering is with respect to $\tau$. +Interaction lines are modified like so: + +$$\begin{aligned} + \frac{1}{i \hbar} W_{s_2 s_1}(\vb{r}_2, t_2; \vb{r}_1, t_1) + \:\: &\longrightarrow \:\: + -\frac{1}{\hbar} W_{s_2 s_1}(\vb{r}_2, \tau_2; \vb{r}_1, \tau_1) + = -\frac{1}{\hbar} W(\vb{r}_2, \vb{r}_1; \tau_1) \delta(\tau_2 \!-\! \tau_1) +\end{aligned}$$ + +One-body $V$-vertices are usually not used, +because they are intended for real-time-dependent operators, +but in theory they would get a factor $-1/\hbar$ too. + +For imaginary time, the Fourier transform is defined differently, +and a distinction must be made between +fermionic Matsubara frequencies $i \omega_n^f$ (for $G$ and $G^0$) +and bosonic Matsubara ones $i \omega_n^b$ (for $W$). +This distinction is compatible with frequency conservation, +since a sum of two fermionic frequencies is always bosonic. +We have: + +$$\begin{aligned} + G_{s_2 s_1}^0(\vb{r}_2, \tau_2; \vb{r}_1, \tau_1) + &= \frac{\delta_{s_2 s_1}}{(2 \pi)^3} \int_{-\infty}^\infty \frac{1}{\hbar \beta} \sum_{n = -\infty}^\infty + G_{s_1}^0(\vb{k}, i \omega_n^f) e^{i \vb{k} \cdot (\vb{r}_2 - \vb{r}_1)} e^{- i \omega_n^f (\tau_2 - \tau_1)} \dd{\vb{k}} + \\ + W_{s_2 s_1}(\vb{r}_2, \tau_2; \vb{r}_1, \tau_1) + &= \frac{1}{(2 \pi)^3} \int_{-\infty}^\infty \frac{1}{\hbar \beta} \sum_{n = -\infty}^\infty + W(\vb{k}) e^{i \vb{k} \cdot (\vb{r}_2 - \vb{r}_1)} e^{- i \omega_n^b (\tau_2 - \tau_1)} \dd{\vb{k}} +\end{aligned}$$ + +The interpretation in Fourier space is the same, +except that each internal integral/sum +instead gives a constant $1 / \big(\hbar \beta (2 \pi)^3\big)$, +and same-time fermion lines need a factor of $e^{i \omega_n^f \eta}$. + + + +## References +1. H. Bruus, K. Flensberg, + *Many-body quantum theory in condensed matter physics*, + 2016, Oxford. diff --git a/source/know/concept/feynman-diagram/interaction.png b/source/know/concept/feynman-diagram/interaction.png Binary files differnew file mode 100644 index 0000000..3c2d093 --- /dev/null +++ b/source/know/concept/feynman-diagram/interaction.png diff --git a/source/know/concept/feynman-diagram/perturbation.png b/source/know/concept/feynman-diagram/perturbation.png Binary files differnew file mode 100644 index 0000000..2e8fbf6 --- /dev/null +++ b/source/know/concept/feynman-diagram/perturbation.png diff --git a/source/know/concept/ficks-laws/index.md b/source/know/concept/ficks-laws/index.md new file mode 100644 index 0000000..234b180 --- /dev/null +++ b/source/know/concept/ficks-laws/index.md @@ -0,0 +1,165 @@ +--- +title: "Fick's laws" +date: 2021-09-05 +categories: +- Physics +- Mathematics +layout: "concept" +--- + +**Fick's laws of diffusion** govern the majority of diffusion processes, +where a certain "impurity" substance redistributes itself through a medium over time. +A diffusion process that obeys Fick's laws is called **Fickian**, +as opposed to **non-Fickian** or **anomalous diffusion**. + + +## Fick's first law + +**Fick's first law** states that diffusing matter +moves from regions of high concentration to regions of lower concentration, +at a rate proportional to the difference in concentration. + +Let $\vec{J}$ be the **diffusion flux** (with unit $\mathrm{m}^{-2} \mathrm{s}^{-1}$), +whose magnitude and direction describe the "flow" of diffusing matter. +Formally, Fick's first law predicts that the flux +is proportional to the gradient of the concentration $C$ (with unit $\mathrm{m}^{-3}$): + +$$\begin{aligned} + \boxed{ + \vec{J} = - D \: \nabla C + } +\end{aligned}$$ + +Where $D$ (with unit $\mathrm{m}^{2}/\mathrm{s}$) +is known as the **diffusion coefficient** or **diffusivity**, +and depends on both the medium and the diffusing substance. + +Fick's first law is a general physical principle, +which was discovered experimentally, +and thus does not have a general derivation. +Proofs for specific systems do exist, +but they say more about those systems +than about diffusion in general. + + +## Fick's second law + +To derive **Fick's second law**, we demand that matter is conserved, +i.e. the diffusing species is not created or destroyed anywhere. +Suppose that an arbitrary volume $V$ contains an amount $M$ of diffusing matter, +distributed in space according to $C(\vec{r})$, such that: + +$$\begin{aligned} + M + \equiv \int_V C \dd{V} +\end{aligned}$$ + +Over time $t$, matter enters/leaves $V$. +Let $S$ be the surface of $V$, and $\vec{J}$ the diffusion flux, +then $M$ changes as follows, to which we apply the divergence theorem: + +$$\begin{aligned} + \dv{M}{t} + = - \int_S \vec{J} \cdot \dd{\vec{S}} + = - \int_V \nabla \cdot \vec{J} \dd{V} +\end{aligned}$$ + +For comparison, we differentiate the definition of $M$, +and exploit that the integral ignores $t$: + +$$\begin{aligned} + \dv{M}{t} + = \dv{}{t}\int_V C \dd{V} + = \int_V \pdv{C}{t} \dd{V} +\end{aligned}$$ + +Both $\idv{M}{t}$ are equal, so stripping the integrals leads to this **continuity equation**: + +$$\begin{aligned} + \pdv{C}{t} + = - \nabla \cdot \vec{J} +\end{aligned}$$ + +From Fick's first law, we already have an expression for $\vec{J}$. +Substituting this into the continuity equation yields +the general form of Fick's second law: + +$$\begin{aligned} + \boxed{ + \pdv{C}{t} + = \nabla \cdot \Big( D \: \nabla C \Big) + } +\end{aligned}$$ + +Usually, it is assumed that $D$ is constant +with respect to space $\vec{r}$ and concentration $C$, +in which case Fick's second law reduces to: + +$$\begin{aligned} + \pdv{C}{t} = D \: \nabla^2 C +\end{aligned}$$ + + +## Fundamental solution + +Fick's second law has exact solutions for many situations, +but the most important one is arguably the **fundamental solution**. +Consider a 1D system (for simplicity) with constant diffusivity $D$, +where the initial concentration $C(x, 0)$ is +a [Dirac delta function](/know/concept/dirac-delta-function/): + +$$\begin{aligned} + C(x, 0) = \delta(x - x_0) +\end{aligned}$$ + +According to Fick's second law, +the concentration's time evolution of $C$ turns out to be: + +$$\begin{aligned} + H(x - x_0, t) + \equiv C(x, t) + = \frac{1}{\sqrt{4 \pi D t}} \exp\!\Big( \!-\!\frac{(x - x_0)^2}{4 D t} \Big) +\end{aligned}$$ + +This result is a normalized Gaussian, +as a consequence of +the [central limit theorem](/know/concept/central-limit-theorem/): +the diffusion behaviour is a sum of many independent steps +(i.e. molecular collisions). +The standard deviation is $\sqrt{2 D t}$, +meaning that the distance of a diffusion is proportional to $\sqrt{t}$. + +This solution $H$ is extremely useful, +because any initial concentration $C(x, 0)$ can be written as +a convolution of itself with a delta function: + +$$\begin{aligned} + C(x, 0) + = (C * \delta)(x) + = \int_{-\infty}^\infty C(x_0, 0) \: \delta(x - x_0) \dd{x_0} +\end{aligned}$$ + +In other words, any function is a linear combination of delta functions. +Fick's second law is linear, +so the overall solution $C(x, t)$ is the same combination of fundamental solutions $H$: + +$$\begin{aligned} + C(x, t) + = (C * H)(x) + &= \int_{-\infty}^\infty C(x_0, 0) \: H(x - x_0, t) \dd{x_0} + \\ + &= \int_{-\infty}^\infty \frac{1}{\sqrt{4 \pi D t}} \exp\!\Big( \!-\!\frac{(x - x_0)^2}{4 D t} \Big) \: C(x_0, 0) \dd{x_0} +\end{aligned}$$ + +This technique is analogous to using +the [impulse response](/know/concept/impulse-response/) +of a linear operator to extrapolate all its inhomogeneous solutions. +The difference is that here, we used the initial condition +instead of the forcing function. + + + +## References +1. U.F. Thygesen, + *Lecture notes on diffusions and stochastic differential equations*, + 2021, Polyteknisk Kompendie. diff --git a/source/know/concept/fourier-transform/index.md b/source/know/concept/fourier-transform/index.md new file mode 100644 index 0000000..32edb47 --- /dev/null +++ b/source/know/concept/fourier-transform/index.md @@ -0,0 +1,245 @@ +--- +title: "Fourier transform" +date: 2021-02-22 +categories: +- Mathematics +- Physics +- Optics +layout: "concept" +--- + +The **Fourier transform** (FT) is an integral transform which converts a +function $f(x)$ into its frequency representation $\tilde{f}(k)$. +Great volumes have already been written about this subject, +so let us focus on the aspects that are useful to physicists. + +The **forward** FT is defined as follows, where $A$, $B$, and $s$ are unspecified constants +(for now): + +$$\begin{aligned} + \boxed{ + \tilde{f}(k) + \equiv \hat{\mathcal{F}}\{f(x)\} + \equiv A \int_{-\infty}^\infty f(x) \exp(i s k x) \dd{x} + } +\end{aligned}$$ + +The **inverse Fourier transform** (iFT) undoes the forward FT operation: + +$$\begin{aligned} + \boxed{ + f(x) + \equiv \hat{\mathcal{F}}^{-1}\{\tilde{f}(k)\} + \equiv B \int_{-\infty}^\infty \tilde{f}(k) \exp(- i s k x) \dd{k} + } +\end{aligned}$$ + +Clearly, the inverse FT of the forward FT of $f(x)$ must equal $f(x)$ +again. Let us verify this, by rearranging the integrals to get the +[Dirac delta function](/know/concept/dirac-delta-function/) $\delta(x)$: + +$$\begin{aligned} + \hat{\mathcal{F}}^{-1}\{\hat{\mathcal{F}}\{f(x)\}\} + &= A B \int_{-\infty}^\infty \exp(-i s k x) \int_{-\infty}^\infty f(x') \exp(i s k x') \dd{x'} \dd{k} + \\ + &= 2 \pi A B \int_{-\infty}^\infty f(x') \Big(\frac{1}{2\pi} \int_{-\infty}^\infty \exp(i s k (x' - x)) \dd{k} \Big) \dd{x'} + \\ + &= 2 \pi A B \int_{-\infty}^\infty f(x') \: \delta(s(x' - x)) \dd{x'} + = \frac{2 \pi A B}{|s|} f(x) +\end{aligned}$$ + +Therefore, the constants $A$, $B$, and $s$ are subject to the following +constraint: + +$$\begin{aligned} + \boxed{\frac{2\pi A B}{|s|} = 1} +\end{aligned}$$ + +But that still gives a lot of freedom. The exact choices of $A$ and $B$ +are generally motivated by the [convolution theorem](/know/concept/convolution-theorem/) +and [Parseval's theorem](/know/concept/parsevals-theorem/). + +The choice of $|s|$ depends on whether the frequency variable $k$ +represents the angular ($|s| = 1$) or the physical ($|s| = 2\pi$) +frequency. The sign of $s$ is not so important, but is generally based +on whether the analysis is for forward ($s > 0$) or backward-propagating +($s < 0$) waves. + + +## Derivatives + +The FT of a derivative has a very useful property. +Below, after integrating by parts, we remove the boundary term by +assuming that $f(x)$ is localized, i.e. $f(x) \to 0$ for $x \to \pm \infty$: + +$$\begin{aligned} + \hat{\mathcal{F}}\{f'(x)\} + &= A \int_{-\infty}^\infty f'(x) \exp(i s k x) \dd{x} + \\ + &= A \big[ f(x) \exp(i s k x) \big]_{-\infty}^\infty - i s k A \int_{-\infty}^\infty f(x) \exp(i s k x) \dd{x} + \\ + &= (- i s k) \tilde{f}(k) +\end{aligned}$$ + +Therefore, as long as $f(x)$ is localized, the FT eliminates derivatives +of the transformed variable, which makes it useful against PDEs: + +$$\begin{aligned} + \boxed{ + \hat{\mathcal{F}}\{f'(x)\} = (- i s k) \tilde{f}(k) + } +\end{aligned}$$ + +This generalizes to higher-order derivatives, as long as these +derivatives are also localized in the $x$-domain, which is practically +guaranteed if $f(x)$ itself is localized: + +$$\begin{aligned} + \boxed{ + \hat{\mathcal{F}} \Big\{ \dvn{n}{f}{x} \Big\} + = (- i s k)^n \tilde{f}(k) + } +\end{aligned}$$ + +Derivatives in the frequency domain have an analogous property: + +$$\begin{aligned} + \dvn{n}{\tilde{f}}{k} + &= A \dvn{n}{}{k}\int_{-\infty}^\infty f(x) \exp(i s k x) \dd{x} + \\ + &= A \int_{-\infty}^\infty (i s x)^n f(x) \exp(i s k x) \dd{x} + = \hat{\mathcal{F}}\{ (i s x)^n f(x) \} +\end{aligned}$$ + + +## Multiple dimensions + +The Fourier transform is straightforward to generalize to $N$ dimensions. +Given a scalar field $f(\vb{x})$ with $\vb{x} = (x_1, ..., x_N)$, +its FT $\tilde{f}(\vb{k})$ is defined as follows: + +$$\begin{aligned} + \boxed{ + \tilde{f}(\vb{k}) + \equiv \hat{\mathcal{F}}\{f(\vb{x})\} + \equiv A \int_{-\infty}^\infty f(\vb{x}) \exp(i s \vb{k} \cdot \vb{x}) \ddn{N}{\vb{x}} + } +\end{aligned}$$ + +Where the wavevector $\vb{k} = (k_1, ..., k_N)$. +Likewise, the inverse FT is given by: + +$$\begin{aligned} + \boxed{ + f(\vb{x}) + \equiv \hat{\mathcal{F}}^{-1}\{\tilde{f}(\vb{k})\} + \equiv B \int_{-\infty}^\infty \tilde{f}(\vb{k}) \exp(- i s \vb{k} \cdot \vb{x}) \ddn{N}{\vb{k}} + } +\end{aligned}$$ + +In practice, in $N$D, there is not as much disagreement about +the constants $A$, $B$ and $s$ as in 1D: +typically $A = 1$ and $B = 1 / (2 \pi)^N$, with $s = \pm 1$. +Any choice will do, as long as: + +$$\begin{aligned} + \boxed{ + A B + = \bigg( \frac{|s|}{2 \pi} \bigg)^{\!N} + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-constants-ND"/> +<label for="proof-constants-ND">Proof</label> +<div class="hidden"> +<label for="proof-constants-ND">Proof.</label> +The inverse FT of the forward FT of $f(\vb{x})$ must be equal to $f(\vb{x})$ again, so: + +$$\begin{aligned} + \hat{\mathcal{F}}^{-1}\{\hat{\mathcal{F}}\{ f(\vb{x}) \}\} + &= A B \int \exp(- i s \vb{k} \cdot \vb{x}) + \int f(\vb{x}') \exp(i s \vb{k} \cdot \vb{x}') \ddn{N}{\vb{x}'} \ddn{N}{\vb{k}} + \\ + &= (2 \pi)^N A B \int f(\vb{x}') + \Big( \frac{1}{(2 \pi)^N} \int \exp(i s \vb{k} \cdot (\vb{x}' - \vb{x})) \ddn{N}{\vb{k}} \Big) \ddn{N}{\vb{x}'} + \\ + &= (2 \pi)^N A B \int f(\vb{x}') + \Big( \prod_{n = 1}^N \frac{1}{2 \pi} \int \exp(i s k_n (x_n' - x_n)) \dd{k_n} \Big) \ddn{N}{\vb{x}'} +\end{aligned}$$ + +Here, we recognize the definition of the Dirac delta function again, +leading to: + +$$\begin{aligned} + \hat{\mathcal{F}}^{-1}\{\hat{\mathcal{F}}\{ f(\vb{x}) \}\} + &= (2 \pi)^N A B \int f(\vb{x}') + \Big( \prod_{n = 1}^N \delta(s(x_n' - x_n)) \Big) \ddn{N}{\vb{x}'} + \\ + &= \frac{(2 \pi)^N A B}{|s|^N} \int f(\vb{x}') \: \delta(\vb{x}' - \vb{x}) \ddn{N}{\vb{x}'} + = \frac{(2 \pi)^N A B}{|s|^N} f(\vb{x}) +\end{aligned}$$ +</div> +</div> + +Differentiation is more complicated for $N > 1$, +but the FT is still useful, +notably for the Laplacian $\nabla^2 \equiv \idv{ {}^2}{x_1^2} + ... + \idv{ {}^2}{x_N^2}$. +Let $|\vb{k}|$ be the norm of $\vb{k}$, +then for a localized $f$: + +$$\begin{aligned} + \boxed{ + \hat{\mathcal{F}}\{\nabla^2 f(\vb{x})\} + = - s^2 |\vb{k}|^2 \tilde{f}(\vb{k}) + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-laplacian"/> +<label for="proof-laplacian">Proof</label> +<div class="hidden"> +<label for="proof-laplacian">Proof.</label> +We insert $\nabla^2 f$ into the FT, +decompose the exponential and the Laplacian, +and then integrate by parts (limits $\pm \infty$ omitted): + +$$\begin{aligned} + \hat{\mathcal{F}}\{\nabla^2 f\} + &= A \int \big( \nabla^2 f \big) \exp(i s \vb{k} \cdot \vb{x}) \ddn{N}{\vb{x}} + \\ + &= A \int \Big( \sum_{n = 1}^N \pdv{ {}^2 f}{x_n^2} \Big) \Big( \prod_{m = 1}^N \exp(i s k_m x_m) \Big) \ddn{N}{\vb{x}} + \\ + &= A \sum_{n = 1}^N \bigg[ \pdv{f}{x_n} \exp(i s \vb{k} \cdot \vb{x}) \bigg] + - A \sum_{n = 1}^N i s k_n \int \pdv{f}{x_n} \exp(i s \vb{k} \cdot \vb{x}) \ddn{N}{\vb{x}} +\end{aligned}$$ + +Just like in 1D, we get rid of the boundary term +by assuming that all derivatives $\idv{f}{x_n}$ are nicely localized. +To proceed, we then integrate by parts again: + +$$\begin{aligned} + \hat{\mathcal{F}}\{\nabla^2 f\} + &= - A \sum_{n = 1}^N i s k_n \int \pdv{f}{x_n} \Big( \prod_{m = 1}^N \exp(i s k_m x_m) \Big) \ddn{N}{\vb{x}} + \\ + &= - A \sum_{n = 1}^N i s k_n \bigg[ f \exp(i s \vb{k} \cdot \vb{x}) \bigg] + + A \sum_{n = 1}^N (i s k_n)^2 \int f \exp(i s \vb{k} \cdot \vb{x}) \ddn{N}{\vb{x}} +\end{aligned}$$ + +Once again, we remove the boundary term +by assuming that $f$ is localized, yielding: + +$$\begin{aligned} + \hat{\mathcal{F}}\{\nabla^2 f\} + &= - A s^2 \sum_{n = 1}^N k_n^2 \int f \exp(i s \vb{k} \cdot \vb{x}) \ddn{N}{\vb{x}} + = - s^2 \sum_{n = 1}^N k_n^2 \tilde{f} +\end{aligned}$$ +</div> +</div> + + + +## References +1. O. Bang, + *Applied mathematics for physicists: lecture notes*, 2019, + unpublished. diff --git a/source/know/concept/fredholm-alternative/index.md b/source/know/concept/fredholm-alternative/index.md new file mode 100644 index 0000000..c813fb4 --- /dev/null +++ b/source/know/concept/fredholm-alternative/index.md @@ -0,0 +1,61 @@ +--- +title: "Fredholm alternative" +date: 2021-05-29 +categories: +- Mathematics +layout: "concept" +--- + +The **Fredholm alternative** is a theorem regarding equations involving +a linear operator $\hat{L}$ on a [Hilbert space](/know/concept/hilbert-space/), +and is useful in the context of multiple-scale perturbation theory. +It is an *alternative* because it gives two mutually exclusive options, +given here in [Dirac notation](/know/concept/dirac-notation/): + +1. $\hat{L} \Ket{u} = \Ket{f}$ has a unique solution $\Ket{u}$ for every $\Ket{f}$. +2. $\hat{L}^\dagger \Ket{w} = 0$ has non-zero solutions. + Then regarding $\hat{L} \Ket{u} = \Ket{f}$: + 1. If $\Inprod{w}{f} = 0$ for all $\Ket{w}$, then it has infinitely many solutions $\Ket{u}$. + 2. If $\Inprod{w}{f} \neq 0$ for any $\Ket{w}$, then it has no solutions $\Ket{u}$. + +Where $\hat{L}^\dagger$ is the adjoint of $\hat{L}$. +In other words, $\hat{L} \Ket{u} = \Ket{f}$ has non-trivial solutions if +and only if for all $\Ket{w}$ (including the trivial case $\Ket{w} = 0$) +it holds that $\Inprod{w}{f} = 0$. + +As a specific example, +if $\hat{L}$ is a matrix and the kets are vectors, +this theorem can alternatively be stated as follows using the determinant: + +1. If $\mathrm{det}(\hat{L}) \neq 0$, then $\hat{L} \vec{u} = \vec{f}$ + has a unique solution $\vec{u}$ for every $\vec{f}$. +2. If $\mathrm{det}(\hat{L}) = 0$, + then $\hat{L}^\dagger \vec{w} = \vec{0}$ has non-zero solutions. + Then regarding $\hat{L} \vec{u} = \vec{f}$: + 1. If $\vec{w} \cdot \vec{f} = 0$ for all $\vec{w}$, then it has + infinitely many solutions $\vec{u}$. + 2. If $\vec{w} \cdot \vec{f} \neq 0$ for any $\vec{w}$, then it has + no solutions $\vec{u}$. + +Consequently, the Fredholm alternative is also brought up +in the context of eigenvalue problems. +Define $\hat{M} = (\hat{L} - \lambda \hat{I})$, +where $\lambda$ is an eigenvalue of $\hat{L}$ +if and only if $\mathrm{det}(\hat{M}) = 0$. +Then for the equation $\hat{M} \Ket{u} = \Ket{f}$, we can say that: + +1. If $\lambda$ is *not* an eigenvalue, + then there is a unique solution $\Ket{u}$ for each $\Ket{f}$. +2. If $\lambda$ is an eigenvalue, then $\hat{M}^\dagger \Ket{w} = 0$ + has non-zero solutions. Then: + 1. If $\Inprod{w}{f} = 0$ for all $\Ket{w}$, then there are + infinitely many solutions $\Ket{u}$. + 2. If $\Inprod{w}{f} \neq 0$ for any $\Ket{w}$, then there are no + solutions $\Ket{u}$. + + + +## References +1. O. Bang, + *Nonlinear mathematical physics: lecture notes*, 2020, + unpublished. diff --git a/source/know/concept/fundamental-solution/index.md b/source/know/concept/fundamental-solution/index.md new file mode 100644 index 0000000..f5a51d5 --- /dev/null +++ b/source/know/concept/fundamental-solution/index.md @@ -0,0 +1,145 @@ +--- +title: "Fundamental solution" +date: 2021-11-02 +categories: +- Mathematics +- Physics +layout: "concept" +--- + +Given a linear operator $\hat{L}$ acting on $x \in [a, b]$, +its **fundamental solution** $G(x, x')$ is defined as the response +of $\hat{L}$ to a [Dirac delta function](/know/concept/dirac-delta-function/) +$\delta(x - x')$ for $x \in ]a, b[$: + +$$\begin{aligned} + \boxed{ + \hat{L}\{ G(x, x') \} + = A \delta(x - x') + } +\end{aligned}$$ + +Where $A$ is a constant, usually $1$. +Fundamental solutions are often called **Green's functions**, +but are distinct from the (somewhat related) +[Green's functions](/know/concept/greens-functions/) +in many-body quantum theory. + +Note that the definition of $G(x, x')$ generalizes that of +the [impulse response](/know/concept/impulse-response/). +And likewise, due to the superposition principle, +once $G$ is known, $\hat{L}$'s response $u(x)$ to +*any* forcing function $f(x)$ can easily be found as follows: + +$$\begin{aligned} + \hat{L} \{ u(x) \} + = f(x) + \quad \implies \quad + \boxed{ + u(x) + = \frac{1}{A} \int_a^b f(x') \: G(x, x') \dd{x'} + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-solution"/> +<label for="proof-solution">Proof</label> +<div class="hidden"> +<label for="proof-solution">Proof.</label> +$\hat{L}$ only acts on $x$, so $x' \in ]a, b[$ is simply a parameter, +meaning we are free to multiply the definition of $G$ +by the constant $f(x')$ on both sides, +and exploit $\hat{L}$'s linearity: + +$$\begin{aligned} + A f(x') \: \delta(x - x') + = f(x') \hat{L}\{ G(x, x') \} + = \hat{L}\{ f(x') \: G(x, x') \} +\end{aligned}$$ + +We then integrate both sides over $x'$ in the interval $[a, b]$, +allowing us to consume $\delta(x \!-\! x')$. +Note that $\int \dd{x'}$ commutes with $\hat{L}$ acting on $x$: + +$$\begin{aligned} + A \int_a^b f(x') \: \delta(x - x') \dd{x'} + &= \int_a^b \hat{L}\{ f(x') \: G(x, x') \} \dd{x'} + \\ + A f(x) + &= \hat{L} \int_a^b f(x') \: G(x, x') \dd{x'} +\end{aligned}$$ + +By definition, $\hat{L}$'s response $u(x)$ to $f(x)$ +satisfies $\hat{L}\{ u(x) \} = f(x)$, recognizable here. +</div> +</div> + +While the impulse response is typically used for initial value problems, +the fundamental solution $G$ is used for boundary value problems. +Suppose those boundary conditions are homogeneous, +i.e. $u(x)$ or one of its derivatives is zero at the boundaries. +Then: + +$$\begin{aligned} + 0 + &= u(a) + = \frac{1}{A} \int_a^b f(x') \: G(a, x') \dd{x'} + \qquad \implies \quad + G(a, x') = 0 + \\ + 0 + &= u_x(a) + = \frac{1}{A} \int_a^b f(x') \: G_x(a, x') \dd{x'} + \quad \implies \quad + G_x(a, x') = 0 +\end{aligned}$$ + +This holds for all $x'$, and analogously for the other boundary $x = b$. +In other words, the boundary conditions are built into $G$. + +What if the boundary conditions are inhomogeneous? +No problem: thanks to the linearity of $\hat{L}$, +those conditions can be given to the homogeneous solution $u_h(x)$, +where $\hat{L}\{ u_h(x) \} = 0$, +such that the inhomogeneous solution $u_i(x) = u(x) - u_h(x)$ +has homogeneous boundaries again, +so we can use $G$ as usual to find $u_i(x)$, and then just add $u_h(x)$. + +If $\hat{L}$ is self-adjoint +(see e.g. [Sturm-Liouville theory](/know/concept/sturm-liouville-theory/)), +then the fundamental solution $G(x, x')$ +has the following **reciprocity** boundary condition: + +$$\begin{aligned} + \boxed{ + G(x, x') = G^*(x', x) + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-reciprocity"/> +<label for="proof-reciprocity">Proof</label> +<div class="hidden"> +<label for="proof-reciprocity">Proof.</label> +Consider two parameters $x_1'$ and $x_2'$. +The self-adjointness of $\hat{L}$ means that: + +$$\begin{aligned} + \int_a^b G^*(x, x_1') \Big( \hat{L} \{ G(x, x_2') \} \Big) \dd{x} + &= \int_a^b \Big( \hat{L} \{ G(x, x_1') \} \Big)^* G(x, x_2') \dd{x} + \\ + \int_a^b G^*(x, x_1') \: \delta(x - x_2') \dd{x} + &= \int_a^b \delta^*(x - x_1') \: G(x, x_2') \dd{x} + \\ + G^*(x_2', x_1') + &= G(x_1', x_2') +\end{aligned}$$ +</div> +</div> + + + +## References +1. O. Bang, + *Applied mathematics for physicists: lecture notes*, 2019, + unpublished. diff --git a/source/know/concept/fundamental-thermodynamic-relation/index.md b/source/know/concept/fundamental-thermodynamic-relation/index.md new file mode 100644 index 0000000..a251fcd --- /dev/null +++ b/source/know/concept/fundamental-thermodynamic-relation/index.md @@ -0,0 +1,53 @@ +--- +title: "Fundamental thermodynamic relation" +date: 2021-07-07 +categories: +- Physics +- Thermodynamics +layout: "concept" +--- + +The **fundamental thermodynamic relation** combines the first two +[laws of thermodynamics](/know/concept/laws-of-thermodynamics/), +and gives the change of the internal energy $U$, +which is a [thermodynamic potential](/know/concept/thermodynamic-potential/), +in terms of the change in +entropy $S$, volume $V$, and the number of particles $N$. + +Starting from the first law of thermodynamics, +we write an infinitesimal change in energy $\dd{U}$ as follows, +where $T$ is the temperature and $P$ is the pressure: + +$$\begin{aligned} + \dd{U} &= \dd{Q} + \dd{W} = T \dd{S} - P \dd{V} +\end{aligned}$$ + +The term $T \dd{S}$ comes from the second law of thermodynamics, +and represents the transfer of thermal energy, +while $P \dd{V}$ represents physical work. + +However, we are missing a term, namely matter transfer. +If particles can enter/leave the system (i.e. the population $N$ is variable), +then each such particle costs an amount $\mu$ of energy, +where $\mu$ is known as the **chemical potential**: + +$$\begin{aligned} + \dd{U} = T \dd{S} - P \dd{V} + \mu \dd{N} +\end{aligned}$$ + +To generalize even further, there may be multiple species of particle, +which each have a chemical potential $\mu_i$. +In that case, we sum over all species $i$: + +$$\begin{aligned} + \boxed{ + \dd{U} = T \dd{S} - P \dd{V} + \sum_{i}^{} \mu_i \dd{N_i} + } +\end{aligned}$$ + + + +## References +1. H. Gould, J. Tobochnik, + *Statistical and thermal physics*, 2nd edition, + Princeton. diff --git a/source/know/concept/ghz-paradox/index.md b/source/know/concept/ghz-paradox/index.md new file mode 100644 index 0000000..5cd2d19 --- /dev/null +++ b/source/know/concept/ghz-paradox/index.md @@ -0,0 +1,115 @@ +--- +title: "GHZ paradox" +date: 2021-03-29 +categories: +- Physics +- Quantum mechanics +- Quantum information +layout: "concept" +--- + +The **Greenberger-Horne-Zeilinger** or **GHZ paradox** +is an alternative proof of [Bell's theorem](/know/concept/bells-theorem/) +that does not use inequalities, +but the three-particle entangled **GHZ state** $\Ket{\mathrm{GHZ}}$ instead, + +$$\begin{aligned} + \boxed{ + \Ket{\mathrm{GHZ}} + = \frac{1}{\sqrt{2}} \Big( \Ket{000} + \Ket{111} \Big) + } +\end{aligned}$$ + +Where $\Ket{0}$ and $\Ket{1}$ are qubit states, +for example, the eigenvalues of the Pauli matrix $\hat{\sigma}_z$. + +If we now apply certain products of the Pauli matrices $\hat{\sigma}_x$ and $\hat{\sigma}_y$ +to the three particles, we find: + + +$$\begin{aligned} + \hat{\sigma}_x \otimes \hat{\sigma}_x \otimes \hat{\sigma}_x \Ket{\mathrm{GHZ}} + &= \frac{1}{\sqrt{2}} \Big( \hat{\sigma}_x \Ket{0} \otimes \hat{\sigma}_x \Ket{0} \otimes \hat{\sigma}_x \Ket{0} + + \hat{\sigma}_x \Ket{1} \otimes \hat{\sigma}_x \Ket{1} \otimes \hat{\sigma}_x \Ket{1} \Big) + \\ + &= \frac{1}{\sqrt{2}} \Big( \Ket{1} \otimes \Ket{1} \otimes \Ket{1} + \Ket{0} \otimes \Ket{0} \otimes \Ket{0} \Big) + = \Ket{\mathrm{GHZ}} + \\ + \hat{\sigma}_x \otimes \hat{\sigma}_y \otimes \hat{\sigma}_y \Ket{\mathrm{GHZ}} + &= \frac{1}{\sqrt{2}} \Big( \hat{\sigma}_x \Ket{0} \otimes \hat{\sigma}_y \Ket{0} \otimes \hat{\sigma}_y \Ket{0} + + \hat{\sigma}_x \Ket{1} \otimes \hat{\sigma}_y \Ket{1} \otimes \hat{\sigma}_y \Ket{1} \Big) + \\ + &= \frac{1}{\sqrt{2}} \Big( \Ket{1} \otimes i \Ket{1} \otimes i \Ket{1} + \Ket{0} \otimes i \Ket{0} \otimes i \Ket{0} \Big) + = - \Ket{\mathrm{GHZ}} +\end{aligned}$$ + +In other words, the GHZ state is a simultaneous eigenstate of these composite operators, +with eigenvalues $+1$ and $-1$, respectively. +Let us introduce two other product operators, +such that we have a set of four observables, +for which $\Ket{\mathrm{GHZ}}$ gives these eigenvalues: + +$$\begin{aligned} + \hat{\sigma}_x \otimes \hat{\sigma}_x \otimes \hat{\sigma}_x + \quad &\implies \quad +1 + \\ + \hat{\sigma}_x \otimes \hat{\sigma}_y \otimes \hat{\sigma}_y + \quad &\implies \quad -1 + \\ + \hat{\sigma}_y \otimes \hat{\sigma}_x \otimes \hat{\sigma}_y + \quad &\implies \quad -1 + \\ + \hat{\sigma}_y \otimes \hat{\sigma}_y \otimes \hat{\sigma}_x + \quad &\implies \quad -1 +\end{aligned}$$ + +According to any local hidden variable (LHV) theory, +the measurement outcomes of the operators are predetermined, +and the three particles $A$, $B$ and $C$ can be measured separately, +or in other words, the eigenvalues can be factorized: + +$$\begin{aligned} + \hat{\sigma}_x \otimes \hat{\sigma}_x \otimes \hat{\sigma}_x + \quad &\implies \quad +1 = m_x^A m_x^B m_x^C + \\ + \hat{\sigma}_x \otimes \hat{\sigma}_y \otimes \hat{\sigma}_y + \quad &\implies \quad -1 = m_x^A m_y^B m_y^C + \\ + \hat{\sigma}_y \otimes \hat{\sigma}_x \otimes \hat{\sigma}_y + \quad &\implies \quad -1 = m_y^A m_x^B m_y^C + \\ + \hat{\sigma}_y \otimes \hat{\sigma}_y \otimes \hat{\sigma}_x + \quad &\implies \quad -1 = m_y^A m_y^B m_x^C +\end{aligned}$$ + +Where $m_x^A = \pm 1$ etc. +Let us now multiply both sides of these four equations together: + +$$\begin{aligned} + (+1) (-1) (-1) (-1) + &= (m_x^A m_x^B m_x^C) (m_x^A m_y^B m_y^C) (m_y^A m_x^B m_y^C) (m_y^A m_y^B m_x^C) + \\ + -1 + &= (m_x^A)^2 (m_x^B)^2 (m_x^C)^2 (m_y^A)^2 (m_y^B)^2 (m_y^C)^2 +\end{aligned}$$ + +This is a contradiction: the left-hand side is $-1$, +but all six factors on the right are $+1$. +This means that we must have made an incorrect assumption along the way. + +Our only assumption was that we could factorize the eigenvalues, +so that e.g. particle $A$ could be measured on its own +without an "action-at-a-distance" effect on $B$ or $C$. +However, because that leads us to a contradiction, +we must conclude that action-at-a-distance exists, +and that therefore all LHV-based theories are invalid. + + + +## References +1. N. Brunner, + *Quantum information theory: lecture notes*, + 2019, unpublished. +2. J.B. Brask, + *Quantum information: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/grad-shafranov-equation/index.md b/source/know/concept/grad-shafranov-equation/index.md new file mode 100644 index 0000000..8bef8af --- /dev/null +++ b/source/know/concept/grad-shafranov-equation/index.md @@ -0,0 +1,226 @@ +--- +title: "Grad-Shafranov equation" +date: 2022-03-06 +categories: +- Physics +- Plasma physics +layout: "concept" +--- + +Nuclear fusion reactors tend to have a torus shape, +in which the plasma is confined by a **pinch**, +i.e. by [magnetic fields](/know/concept/magnetic-field/) +chosen so that the [Lorentz force](/know/concept/lorentz-force/) +stops particles escaping. +Effectively, we are taking a cylindrical [screw pinch](/know/concept/screw-pinch/) +and bending it into a torus. + +We would like to find the equilibrium state of the plasma +in the general case of a reactor with toroidal symmetry. +Using ideal [magnetohydrodynamics](/know/concept/magnetohydrodynamics/) (MHD), +we start by assuming that the fluid is stationary, +and that the confining field $\vb{B}$ is fixed: + +$$\begin{aligned} + \vb{u} + = 0 + \qquad \qquad + \pdv{\vb{u}}{t} + = 0 + \qquad \qquad + \pdv{\vb{B}}{t} + = 0 + \qquad \qquad + \vb{E} + = 0 +\end{aligned}$$ + +Notice that $\vb{E} = 0$ is a result of the ideal generalized Ohm's law. +Under these assumptions, the relevant MHD equations to be solved are +Gauss' law for magnetism, Ampère's law, and the MHD momentum equation, respectively: + +$$\begin{aligned} + 0 + = \nabla \cdot \vb{B} + \qquad \qquad + \mu_0 \vb{J} + = \nabla \cross \vb{B} + \qquad \qquad + \nabla p + = \vb{J} \cross \vb{B} +\end{aligned}$$ + +The goal is to analyze them in this order, +exploiting toroidal symmetry along the way, +to arrive at a general equilibrium condition. +[Cylindrical polar coordinates](/know/concept/cylindrical-polar-coordinates/) $(r, \theta, z)$ +are a natural choice, with the $z$-axis running through the middle of the torus. + +As preparation, it is a good idea to write $\vb{B}$ +as the curl of a magnetic vector potential $\vb{A}$, +which looks like this in cylindrical polar coordinates: + +$$\begin{aligned} + \vb{B} + = \nabla \cross \vb{A} + = \begin{bmatrix} + \displaystyle \frac{1}{r} \pdv{A_z}{\theta} - \pdv{A_\theta}{z} \\ + \displaystyle \pdv{A_r}{z} - \pdv{A_z}{r} \\ + \displaystyle \frac{1}{r} \Big( \pdv{(r A_\theta)}{r} - \pdv{A_r}{\theta} \Big) + \end{bmatrix} + = \begin{bmatrix} + \displaystyle - \pdv{A_\theta}{z} \\ + \displaystyle \pdv{A_r}{z} - \pdv{A_z}{r} \\ + \displaystyle \frac{1}{r} \pdv{(r A_\theta)}{r} + \end{bmatrix} +\end{aligned}$$ + +Here, it is convenient to define the so-called **stream function** $\psi$ as follows: + +$$\begin{aligned} + \boxed{ + \psi + \equiv r A_\theta + } +\end{aligned}$$ + +Such that $\vb{B}$ can be written as below, +where we will regard $B_\theta$ as a given quantity: + +$$\begin{aligned} + \vb{B} + = \begin{bmatrix} + \displaystyle -\frac{1}{r} \pdv{\psi}{z} \\ + B_\theta \\ + \displaystyle \frac{1}{r} \pdv{\psi}{r} + \end{bmatrix} + \qquad \mathrm{where} \qquad + B_\theta + = \pdv{A_r}{z} - \pdv{A_z}{r} +\end{aligned}$$ + + +Inserting this into Gauss' law, +we see that it is trivially satisfied, +thanks to circular symmetry guaranteeing that $\ipdv{B_\theta}{\theta} = 0$: + +$$\begin{aligned} + 0 + = \nabla \cdot \vb{B} + &= - \frac{1}{r} \pdv{}{r}\bigg( \frac{r}{r} \pdv{\psi}{z} \bigg) + + \frac{1}{r} \pdv{B_\theta}{\theta} + + \pdv{}{z}\bigg( \frac{1}{r} \pdv{\psi}{r} \bigg) + \\ + &= - \frac{1}{r} \mpdv{\psi}{r}{z} + \frac{1}{r} \mpdv{\psi}{z}{r} + = 0 +\end{aligned}$$ + +What matters is that we have expressions for the components of $\vb{B}$. +Moving on, to find the current density $\vb{J}$, +we use Ampère's law and symmetry to get: + + +$$\begin{aligned} + \vb{J} + = \frac{1}{\mu_0} \nabla \cross \vb{B} + = \frac{1}{\mu_0} + \begin{bmatrix} + \displaystyle \frac{1}{r} \pdv{B_z}{\theta} - \pdv{B_\theta}{z} \\ + \displaystyle \pdv{B_r}{z} - \pdv{B_z}{r} \\ + \displaystyle \frac{1}{r} \Big( \pdv{(r B_\theta)}{r} - \pdv{B_r}{\theta} \Big) + \end{bmatrix} + = \frac{1}{\mu_0} + \begin{bmatrix} + \displaystyle 0 \\ + \displaystyle \pdv{B_r}{z} - \pdv{B_z}{r} \\ + \displaystyle \frac{1}{r} \pdv{(r B_\theta)}{r} + \end{bmatrix} +\end{aligned}$$ + +Where we have assumed that $B_\theta$ depends only on $r$, not $z$ or $\theta$. +Substituting this into the MHD momentum equation +gives the following pressure gradient $\nabla p$: + +$$\begin{aligned} + \nabla p + &= \vb{J} \cross \vb{B} + = \begin{bmatrix} + J_\theta B_z - J_z B_\theta \\ + J_z B_r - J_r B_z \\ + J_r B_\theta - J_\theta B_r + \end{bmatrix} + = \begin{bmatrix} + J_\theta B_z - J_z B_\theta \\ + J_z B_r \\ + - J_\theta B_r + \end{bmatrix} +\end{aligned}$$ + +Now, the idea is to focus on this $r$-component to get an equation for $\psi$, +whose solution can then be used to calculate the $\theta$ and $z$-components of $\nabla p$. +Therefore, we evaluate: + +$$\begin{aligned} + \pdv{p}{r} + &= J_\theta B_z - J_z B_\theta + \\ + &= \frac{1}{\mu_0} \bigg( \pdv{B_r}{z} - \pdv{B_z}{r} \bigg) B_z + - \frac{1}{\mu_0 r} \pdv{(r B_\theta)}{r} B_\theta + \\ + &= - \frac{1}{\mu_0} \bigg( \pdv{}{z}\Big(\frac{1}{r} \pdv{\psi}{z}\Big) + + \pdv{}{r}\Big(\frac{1}{r} \pdv{\psi}{r}\Big) \bigg) \frac{1}{r} \pdv{\psi}{r} + - \frac{1}{\mu_0 r} \pdv{(r B_\theta)}{r} B_\theta + \\ + &= - \frac{1}{\mu_0 r} \bigg( \frac{1}{r} \pdvn{2}{\psi}{z} + \pdv{}{r}\Big( \frac{1}{r} \pdv{\psi}{r} \Big) \bigg) \pdv{\psi}{r} + - \frac{1}{\mu_0 r} \pdv{(r B_\theta)}{r} B_\theta +\end{aligned}$$ + +By using the chain rule to rewrite $\ipdv{}{r}= (\ipdv{\psi}{r}) \; \ipdv{}{\psi}$, +we get $\ipdv{\psi}{r}$ in each term: + +$$\begin{aligned} + \pdv{\psi}{r} \pdv{p}{\psi} + &= - \frac{1}{\mu_0 r} \bigg( \frac{1}{r} \pdvn{2}{\psi}{z} + \pdv{}{r}\Big( \frac{1}{r} \pdv{\psi}{r} \Big) \bigg) \pdv{\psi}{r} + - \frac{1}{\mu_0 r} \pdv{\psi}{r} \pdv{(r B_\theta)}{\psi} B_\theta +\end{aligned}$$ + +Dividing out $\ipdv{\psi}{r}$ and multiplying by $\mu_0 r^2$ +leads us to the **Grad-Shafranov equation**, +which gives the equilibrium condition of a plasma in a toroidal reactor: + +$$\begin{aligned} + \boxed{ + \pdvn{2}{\psi}{z} + r \pdv{}{r}\bigg( \frac{1}{r} \pdv{\psi}{r} \bigg) + = - \mu_0 r^2 \pdv{p}{\psi} - r \pdv{(r B_\theta)}{\psi} B_\theta + } +\end{aligned}$$ + +Weirdly, $\psi$ appears both as an unknown and as a differentiation variable, +but this equation can still be solved analytically by +assuming a certain $\psi$-dependence of $p$ and $r B_\theta$. + +Suppose that $B_\theta$ is induced by a poloidal electrical current $I_\mathrm{pol}$, +i.e. a current around the "tube" of the torus, +then, assuming $I_\mathrm{pol}$ only depends on $r$, we have: + +$$\begin{aligned} + B_\theta + = \frac{\mu_0 I_\mathrm{pol}(r)}{2 \pi r} +\end{aligned}$$ + +Inserting this into the Grad-Shafranov equation yields its following alternative form: + +$$\begin{aligned} + \boxed{ + \pdvn{2}{\psi}{z} + r \pdv{}{r}\bigg( \frac{1}{r} \pdv{\psi}{r} \bigg) + = - \mu_0 r^2 \pdv{p}{\psi} - \frac{\mu_0^2}{8 \pi^2} \pdv{I_\mathrm{pol}^2}{\psi} + } +\end{aligned}$$ + + + +## References +1. M. Salewski, A.H. Nielsen, + *Plasma physics: lecture notes*, + 2021, unpublished. + diff --git a/source/know/concept/gram-schmidt-method/index.md b/source/know/concept/gram-schmidt-method/index.md new file mode 100644 index 0000000..483dd71 --- /dev/null +++ b/source/know/concept/gram-schmidt-method/index.md @@ -0,0 +1,49 @@ +--- +title: "Gram-Schmidt method" +date: 2021-02-22 +categories: +- Mathematics +- Algorithms +layout: "concept" +--- + +Given a set of linearly independent non-orthonormal vectors +$\ket{V_1}, \ket{V_2}, ...$ from a [Hilbert space](/know/concept/hilbert-space/), +the **Gram-Schmidt method** +turns them into an orthonormal set $\ket{n_1}, \ket{n_2}, ...$ as follows: + +1. Take the first vector $\ket{V_1}$ and normalize it to get $\ket{n_1}$: + + $$\begin{aligned} + \ket{n_1} = \frac{\ket{V_1}}{\sqrt{\inprod{V_1}{V_1}}} + \end{aligned}$$ + +2. Begin loop. Take the next non-orthonormal vector $\ket{V_j}$, and + subtract from it its projection onto every already-processed vector: + + $$\begin{aligned} + \ket{n_j'} = \ket{V_j} - \ket{n_1} \inprod{n_1}{V_j} - \ket{n_2} \inprod{n_2}{V_j} - ... - \ket{n_{j-1}} \inprod{n_{j-1}}{V_{j-1}} + \end{aligned}$$ + + This leaves only the part of $\ket{V_j}$ which is orthogonal to + $\ket{n_1}$, $\ket{n_2}$, etc. This why the input vectors must be + linearly independent; otherwise $\Ket{n_j'}$ may become zero at some + point. + +3. Normalize the resulting ortho*gonal* vector $\ket{n_j'}$ to make it + ortho*normal*: + + $$\begin{aligned} + \ket{n_j} = \frac{\ket{n_j'}}{\sqrt{\inprod{n_j'}{n_j'}}} + \end{aligned}$$ + +4. Loop back to step 2, taking the next vector $\ket{V_{j+1}}$. + +If you are unfamiliar with this notation, take a look at [Dirac notation](/know/concept/dirac-notation/). + + + +## References +1. R. Shankar, + *Principles of quantum mechanics*, 2nd edition, + Springer. diff --git a/source/know/concept/grand-canonical-ensemble/index.md b/source/know/concept/grand-canonical-ensemble/index.md new file mode 100644 index 0000000..85bf90a --- /dev/null +++ b/source/know/concept/grand-canonical-ensemble/index.md @@ -0,0 +1,74 @@ +--- +title: "Grand canonical ensemble" +date: 2021-07-11 +categories: +- Physics +- Thermodynamics +- Thermodynamic ensembles +layout: "concept" +--- + +The **grand canonical ensemble** or **μVT ensemble** +extends the [canonical ensemble](/know/concept/canonical-ensemble/) +by allowing the exchange of both energy $U$ and particles $N$ +with an external reservoir, +so that the conserved state functions are +the temperature $T$, the volume $V$, and the chemical potential $\mu$. + +The derivation is practically identical to that of the canonical ensemble. +We refer to the system of interest as $A$, +and the reservoir as $B$. +In total, $A\!+\!B$ has energy $U$ and population $N$. + +Let $c_B(U_B)$ be the number of $B$-microstates with energy $U_B$. +Then the probability that $A$ is in a specific microstate $s_A$ is as follows: + +$$\begin{aligned} + p(s) + = \frac{c_B\big(U - U_A(s_A), N - N_A(s_A)\big)}{\sum_{s_A} c_B\big(U \!-\! U_A(s_A), N \!-\! N_A(s_A)\big)} +\end{aligned}$$ + +Then, as for the canonical ensemble, +we assume $U_B \gg U_A$ and $N_B \gg N_A$, +and approximate $\ln{p(s_A)}$ +by Taylor-expanding $\ln{c_B}$ around $U_B = U$ and $N_B = N$. +The resulting probability distribution is known as the **Gibbs distribution**, +with $\beta \equiv 1/(kT)$: + +$$\begin{aligned} + \boxed{ + p(s_A) = \frac{1}{\mathcal{Z}} \exp\!\Big(\!-\! \beta \: \big( U_A(s_A) \!-\! \mu N_A(s_A) \big) \Big) + } +\end{aligned}$$ + +Where the normalizing **grand partition function** $\mathcal{Z}(\mu, V, T)$ is defined as follows: + +$$\begin{aligned} + \boxed{ + \mathcal{Z} \equiv \sum_{s_A}^{} \exp\!\Big(\!-\! \beta \: \big( U_A(s_A) - \mu N_A(s_A) \big) \Big) + } +\end{aligned}$$ + +In contrast to the canonical ensemble, +whose [thermodynamic potential](/know/concept/thermodynamic-potential/) +was the Helmholtz free energy $F$, +the grand canonical ensemble instead +minimizes the **grand potential** $\Omega$: + +$$\begin{aligned} + \boxed{ + \Omega(T, V, \mu) + \equiv - k T \ln{\mathcal{Z}} + = \Expval{U_A} - T S_A - \mu \Expval{N_A} + } +\end{aligned}$$ + +So $\mathcal{Z} = \exp(- \beta \Omega)$. +This is proven in the same way as for $F$ in the canonical ensemble. + + + +## References +1. H. Gould, J. Tobochnik, + *Statistical and thermal physics*, 2nd edition, + Princeton. diff --git a/source/know/concept/greens-functions/index.md b/source/know/concept/greens-functions/index.md new file mode 100644 index 0000000..48f1e76 --- /dev/null +++ b/source/know/concept/greens-functions/index.md @@ -0,0 +1,390 @@ +--- +title: "Green's functions" +date: 2021-11-03 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +In many-body quantum theory, a **Green's function** +can be any correlation function between two given operators, +although it is usually used to refer to the special case +where the operators are particle creation/annihilation operators +from the [second quantization](/know/concept/second-quantization/). + +They are somewhat related to +[fundamental solutions](/know/concept/fundamental-solution/), +which are also called *Green's functions*, +but in general they are not the same, +except in a special case, see below. + + +## Single-particle functions + +If the two operators are single-particle creation/annihilation operators, +then we get the **single-particle Green's functions**, +for which the symbol $G$ is used. + +The **time-ordered** or **causal Green's function** $G_{\nu \nu'}$ is as follows, +where $\mathcal{T}$ is the [time-ordered product](/know/concept/time-ordered-product/), +$\nu$ and $\nu'$ are single-particle states, +and $\hat{c}_\nu$ annihilates a particle from $\nu$, etc.: + +$$\begin{aligned} + \boxed{ + G_{\nu \nu'}(t, t') + \equiv -\frac{i}{\hbar} \Expval{\mathcal{T} \Big\{ \hat{c}_{\nu}(t) \: \hat{c}_{\nu'}^\dagger(t') \Big\}} + } +\end{aligned}$$ + +The expectation value $\Expval{}$ is +with respect to thermodynamic equilibrium. +This is sometimes in the [canonical ensemble](/know/concept/canonical-ensemble/) +(for some two-particle Green's functions, see below), +but usually in the [grand canonical ensemble](/know/concept/grand-canonical-ensemble/), +since we are adding/removing particles. +In the latter case, we assume that the chemical potential $\mu$ +is already included in the Hamiltonian $\hat{H}$. +Explicitly, for a complete set of many-particle states $\Ket{\Psi_n}$, we have: + +$$\begin{aligned} + G_{\nu \nu'}(t, t') + &= -\frac{i}{\hbar Z} \Tr\!\Big( \mathcal{T} \Big\{ \hat{c}_{\nu}(t) \: \hat{c}_{\nu'}^\dagger(t')\Big\} \: e^{- \beta \hat{H}} \Big) + \\ + &= -\frac{i}{\hbar Z} \sum_{n} + \Matrixel{\Psi_n}{\mathcal{T} \Big\{ \hat{c}_{\nu}(t) \: \hat{c}_{\nu'}^\dagger(t')\Big\} \: e^{- \beta \hat{H}}}{\Psi_n} +\end{aligned}$$ + +Arguably more prevalent are +the **retarded Green's function** $G_{\nu \nu'}^R$ +and the **advanced Green's function** $G_{\nu \nu'}^A$ +which are defined like so: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + G_{\nu \nu'}^R(t, t') + &\equiv -\frac{i}{\hbar} \Theta(t - t') \Expval{\comm{\hat{c}_{\nu}(t)}{\hat{c}_{\nu'}^\dagger(t')}_{\mp}} + \\ + G_{\nu \nu'}^A(t, t') + &\equiv \frac{i}{\hbar} \Theta(t' - t) \Expval{\comm{\hat{c}_{\nu}(t)}{\hat{c}_{\nu'}^\dagger(t')}_{\mp}} + \end{aligned} + } +\end{aligned}$$ + +Where $\Theta$ is a [Heaviside function](/know/concept/heaviside-step-function/), +and $[,]_{\mp}$ is a commutator for bosons, +and an anticommutator for fermions. +Depending on the context, +we could either be in the [Heisenberg picture](/know/concept/heisenberg-picture/) +or in the [interaction picture](/know/concept/interaction-picture/), +hence $\hat{c}_\nu$ and $\hat{c}_{\nu'}^\dagger$ are time-dependent. + +Furthermore, the **greater Green's function** $G_{\nu \nu'}^>$ +and **lesser Green's function** $G_{\nu \nu'}^<$ are: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + G_{\nu \nu'}^>(t, t') + &\equiv -\frac{i}{\hbar} \Expval{\hat{c}_{\nu}(t) \: \hat{c}_{\nu'}^\dagger(t')} + \\ + G_{\nu \nu'}^<(t, t') + &\equiv \mp \frac{i}{\hbar} \Expval{\hat{c}_{\nu'}^\dagger(t') \: \hat{c}_{\nu}(t)} + \end{aligned} + } +\end{aligned}$$ + +Where $-$ is for bosons, and $+$ for fermions. +With this, the causal, retarded and advanced Green's functions +can thus be expressed as follows: + +$$\begin{aligned} + G_{\nu \nu'}(t, t') + &= \Theta(t - t') \: G_{\nu \nu'}^>(t, t') + \Theta(t' - t) \: G_{\nu \nu'}^<(t, t') + \\ + G_{\nu \nu'}^R(t, t') + &= \Theta(t - t') \big( G_{\nu \nu'}^>(t, t') - G_{\nu \nu'}^<(t, t') \big) + \\ + G_{\nu \nu'}^A(t, t') + &= \Theta(t' - t) \big( G_{\nu \nu'}^<(t, t') - G_{\nu \nu'}^>(t, t') \big) +\end{aligned}$$ + +If the Hamiltonian involves interactions, +it might be more natural to use quantum field operators $\hat{\Psi}(\vb{r}, t)$ +instead of choosing a basis of single-particle states $\psi_\nu$. +In that case, instead of a label $\nu$, +we use the spin $s$ and position $\vb{r}$, leading to: + +$$\begin{aligned} + G_{ss'}(\vb{r}, t; \vb{r}', t') + &= -\frac{i}{\hbar} \Theta(t - t') \Expval{\mathcal{T}\Big\{ \hat{\Psi}_{s}(\vb{r}, t) \hat{\Psi}_{s'}^\dagger(\vb{r}', t') \Big\}} + \\ + &= \sum_{\nu \nu'} \psi_\nu(\vb{r}) \: \psi^*_{\nu'}(\vb{r}') \: G_{\nu \nu'}(t, t') +\end{aligned}$$ + +And analogously for $G_{ss'}^R$, $G_{ss'}^A$, $G_{ss'}^>$ and $G_{ss'}^<$. +Note that the time-dependence is given to the old $G_{\nu \nu'}$, +i.e. to $\hat{c}_\nu$ and $\hat{c}_{\nu'}^\dagger$, +because we are in the Heisenberg picture. + +If the Hamiltonian is time-independent, +then it can be shown that all the Green's functions +only depend on the time-difference $t - t'$: + +$$\begin{gathered} + G_{\nu \nu'}(t, t') = G_{\nu \nu'}(t - t') + \\ + G_{\nu \nu'}^R(t, t') = G_{\nu \nu'}^R(t - t') + \qquad \quad + G_{\nu \nu'}^A(t, t') = G_{\nu \nu'}^A(t - t') + \\ + G_{\nu \nu'}^>(t, t') = G_{\nu \nu'}^>(t - t') + \qquad \quad + G_{\nu \nu'}^<(t, t') = G_{\nu \nu'}^<(t - t') +\end{gathered}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-time-diff"/> +<label for="proof-time-diff">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-time-diff">Proof.</label> +We will prove that the thermal expectation value +$\expval{\hat{A}(t) \hat{B}(t')}$ only depends on $t - t'$ +for arbitrary $\hat{A}$ and $\hat{B}$, +and it trivially follows that the Green's functions do too. + +In (grand) canonical equilibrium, we know that the +[density operator](/know/concept/density-operator/) +$\hat{\rho}$ is as follows: + +$$\begin{aligned} + \hat{\rho} = \frac{1}{Z} \exp(- \beta \hat{H}) +\end{aligned}$$ + +The expected value of the product +of the time-independent operators $\hat{A}$ and $\hat{B}$ is then: + +$$\begin{aligned} + \expval{\hat{A}(t) \hat{B}(t')} + &= \frac{1}{Z} \Tr\!\big( \hat{\rho} \hat{A}(t) \hat{B}(t') \big) + \\ + &= \frac{1}{Z} \Tr\!\Big( e^{-\beta \hat{H}} e^{i t \hat{H} / \hbar} \hat{A} e^{-i t \hat{H} / \hbar} + e^{i t' \hat{H} / \hbar} \hat{B} e^{-i t' \hat{H} / \hbar} \Big) +\end{aligned}$$ + +Using that the trace $\Tr$ is invariant +under cyclic permutations of its argument, +and that all functions of $\hat{H}$ commute, we find: + +$$\begin{aligned} + \expval{\hat{A}(t) \hat{B}(t')} + = \frac{1}{Z} \Tr\!\Big( e^{-\beta \hat{H}} e^{i (t - t') \hat{H} / \hbar} \hat{A} e^{-i (t - t') \hat{H} / \hbar} \hat{B} \Big) +\end{aligned}$$ + +As expected, this only depends on the time difference $t - t'$, +because $\hat{H}$ is time-independent by assumption. +Note that thermodynamic equilibrium is crucial: +intuitively, if the system is not in equilibrium, +then it evolves in some transient time-dependent way. +</div> +</div> + +If the Hamiltonian is both time-independent and non-interacting, +then the time-dependence of $\hat{c}_\nu$ +can simply be factored out as +$\hat{c}_\nu(t) = \hat{c}_\nu \exp(- i \varepsilon_\nu t / \hbar)$. +Then the diagonal ($\nu = \nu'$) greater and lesser Green's functions +can be written in the form below, where $f_\nu$ is either +the [Fermi-Dirac distribution](/know/concept/fermi-dirac-distribution/) +or the [Bose-Einstein distribution](/know/concept/bose-einstein-distribution/). + +$$\begin{aligned} + G_{\nu \nu}^>(t, t') + &= -\frac{i}{\hbar} \Expval{\hat{c}_{\nu} \hat{c}_{\nu}^\dagger} \exp\!\big(\!-\! i \varepsilon_\nu (t \!-\! t') / \hbar \big) + \\ + &= -\frac{i}{\hbar} (1 - f_\nu) \exp\!\big(\!-\! i \varepsilon_\nu (t \!-\! t') / \hbar \big) + \\ + G_{\nu \nu}^<(t, t') + &= \mp \frac{i}{\hbar} \Expval{\hat{c}_{\nu}^\dagger \hat{c}_{\nu}} \exp\!\big(\!-\! i \varepsilon_\nu (t \!-\! t') / \hbar \big) + \\ + &= \mp \frac{i}{\hbar} f_\nu \exp\!\big(\!-\! i \varepsilon_\nu (t \!-\! t') / \hbar \big) +\end{aligned}$$ + + +## As fundamental solutions + +In the absence of interactions, +we know from the derivation of +[equation-of-motion theory](/know/concept/equation-of-motion-theory/) +that the equation of motion of $G^R(\vb{r}, t; \vb{r}', t')$ +is as follows (neglecting spin): + +$$\begin{aligned} + i \hbar \pdv{G^R}{t} + = \delta(\vb{r} \!-\! \vb{r}') \: \delta(t \!-\! t') + + \frac{i}{\hbar} \Theta(t \!-\! t') \Expval{\Comm{\comm{\hat{H}_0}{\hat{\Psi}(\vb{r}, t)}}{\hat{\Psi}^\dagger(\vb{r}', t')}} +\end{aligned}$$ + +If $\hat{H}_0$ only contains kinetic energy, +i.e. there is no external potential, +it can be shown that: + +$$\begin{aligned} + \comm{\hat{H}_0}{\hat{\Psi}(\vb{r})} + = \frac{\hbar^2}{2 m} \nabla^2 \hat{\Psi}(\vb{r}) +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-commH0"/> +<label for="proof-commH0">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-commH0">Proof.</label> +In the second quantization, +the Hamiltonian $\hat{H}_0$ is written like so: + +$$\begin{aligned} + \hat{H}_0 + &= - \frac{\hbar^2}{2 m} \sum_{\nu \nu'} \hat{c}_\nu^\dagger \hat{c}_{\nu'} \Inprod{\psi_\nu}{\nabla^2 \psi_{\nu'}} + \\ + &= - \frac{\hbar^2}{2 m} \sum_{\nu \nu'} \hat{c}_\nu^\dagger \hat{c}_{\nu'} \int \psi_\nu^*(\vb{r}') \: \nabla^2 \psi_{\nu'}(\vb{r}') \dd{\vb{r}'} + \\ + &= - \frac{\hbar^2}{2 m} + \int \Big( \sum_{\nu} \psi_\nu^*(\vb{r}') \hat{c}_\nu^\dagger \Big) \Big( \nabla^2 \sum_{\nu'} \psi_{\nu'}(\vb{r}') \hat{c}_{\nu'} \Big) \dd{\vb{r}'} + \\ + &= - \frac{\hbar^2}{2 m} + \int \hat{\Psi}^\dagger(\vb{r}') \: \nabla^2 \hat{\Psi}(\vb{r}') \dd{\vb{r}'} +\end{aligned}$$ + +We then insert this into the commutator that we want to prove, yielding: + +$$\begin{aligned} + \comm{\hat{H}_0}{\hat{\Psi}(\vb{r})} + &= - \frac{\hbar^2}{2 m} \int \Comm{\hat{\Psi}^\dagger(\vb{r}') \: \nabla^2 \hat{\Psi}(\vb{r}')}{\hat{\Psi}(\vb{r})} \dd{\vb{r}'} + \\ + &= - \frac{\hbar^2}{2 m} \int \hat{\Psi}^\dagger(\vb{r}') \Comm{\nabla^2 \hat{\Psi}(\vb{r}')}{\hat{\Psi}(\vb{r})} + + \Comm{\hat{\Psi}^\dagger(\vb{r}')}{\hat{\Psi}(\vb{r})} \nabla^2 \hat{\Psi}(\vb{r}') \dd{\vb{r}'} + \\ + &= - \frac{\hbar^2}{2 m} \sum_{\nu \nu' \nu''} + \Big( \hat{c}_\nu^\dagger \comm{\hat{c}_{\nu''}}{\hat{c}_{\nu'}} + \comm{\hat{c}_\nu^\dagger}{\hat{c}_{\nu'}} \hat{c}_{\nu''} \Big) + \psi_{\nu'}(\vb{r}) \int \psi_\nu^*(\vb{r}') \: \nabla^2 \psi_{\nu''}(\vb{r}') \dd{\vb{r}'} +\end{aligned}$$ + +When deriving equation-of-motion theory, +we already showed that the following identity +holds for both bosons and fermions: + +$$\begin{aligned} + \hat{c}_\nu^\dagger \comm{\hat{c}_{\nu''}}{\hat{c}_{\nu'}} + \comm{\hat{c}_\nu^\dagger}{\hat{c}_{\nu'}} \hat{c}_{\nu''} + = - \delta_{\nu \nu'} \hat{c}_{\nu''} +\end{aligned}$$ + +Such that the commutator can be significantly simplified to: + +$$\begin{aligned} + \comm{\hat{H}_0}{\hat{\Psi}(\vb{r})} + &= \frac{\hbar^2}{2 m} \sum_{\nu \nu'} \hat{c}_{\nu'} + \int \psi_\nu^*(\vb{r}') \: \psi_\nu(\vb{r}) \: \nabla^2 \psi_{\nu'}(\vb{r}') \dd{\vb{r}'} +\end{aligned}$$ + +We know that the $\psi_\nu$ form a *complete* basis, +which implies (see [Sturm-Liouville theory](/know/concept/sturm-liouville-theory/)): + +$$\begin{aligned} + \sum_{\nu} \psi_\nu^*(\vb{r}') \: \psi_\nu(\vb{r}) + = \delta(\vb{r} - \vb{r}') +\end{aligned}$$ + +With this, the commutator can be reduced even further as follows: + +$$\begin{aligned} + \comm{\hat{H}_0}{\hat{\Psi}(\vb{r})} + &= \frac{\hbar^2}{2 m} \sum_{\nu \nu'} \hat{c}_{\nu'} + \int \delta(\vb{r} - \vb{r}') \: \nabla^2 \psi_{\nu'}(\vb{r}') \dd{\vb{r}'} + \\ + &= \frac{\hbar^2}{2 m} \sum_{\nu'} \hat{c}_{\nu'} \nabla^2 \psi_{\nu'}(\vb{r}) + = \frac{\hbar^2}{2 m} \nabla^2 \hat{\Psi}(\vb{r}) +\end{aligned}$$ +</div> +</div> + +After substituting this into the equation of motion, +we recognize $G^R(\vb{r}, t; \vb{r}', t')$ itself: + +$$\begin{aligned} + i \hbar \pdv{G^R}{t} + &= \delta(\vb{r} \!-\! \vb{r}') \: \delta(t \!-\! t') + + \frac{i}{\hbar} \Theta(t \!-\! t') \Expval{\Comm{\frac{\hbar^2}{2 m} \nabla^2 \hat{\Psi}(\vb{r}, t)}{\hat{\Psi}^\dagger(\vb{r}', t')}} + \\ + &= \delta(\vb{r} \!-\! \vb{r}') \: \delta(t \!-\! t') - \frac{\hbar^2}{2 m} \nabla_\vb{r}^2 + \Big( \!-\! \frac{i}{\hbar} \Theta(t \!-\! t') \Expval{\Comm{\hat{\Psi}(\vb{r}, t)}{\hat{\Psi}^\dagger(\vb{r}', t')}} \Big) + \\ + &= \delta(\vb{r} \!-\! \vb{r}') \: \delta(t \!-\! t') + - \frac{\hbar^2}{2 m} \nabla_\vb{r}^2 G^R(\vb{r}, t; \vb{r}', t') +\end{aligned}$$ + +Rearranging this leads to the following, +which is the definition of a fundamental solution: + +$$\begin{aligned} + \Big( i \hbar \pdv{}{t}+ \frac{\hbar^2}{2 m} \nabla_\vb{r}^2 \Big) G^R(\vb{r}, t; \vb{r}', t') + &= \delta(\vb{r} \!-\! \vb{r}') \: \delta(t \!-\! t') +\end{aligned}$$ + +Therefore, the retarded Green's function +(and, it turns out, the advanced Green's function too) +is a fundamental solution of the Schrödinger equation +if there is no potential, +i.e. the Hamiltonian only contains kinetic energy. + + +## Two-particle functions + +We generalize the above to two arbitrary operators $\hat{A}$ and $\hat{B}$, +giving us the **two-particle Green's functions**, +or just **correlation functions**. +The **causal correlation function** $C_{AB}$, +the **retarded correlation function** $C_{AB}^R$ +and the **advanced correlation function** $C_{AB}^A$ are defined as follows +(in the Heisenberg picture): + +$$\begin{aligned} + \boxed{ + \begin{aligned} + C_{AB}(t, t') + &\equiv -\frac{i}{\hbar} \Expval{\mathcal{T}\Big\{\hat{A}(t) \hat{B}(t')\Big\}} + \\ + C_{AB}^R(t, t') + &\equiv -\frac{i}{\hbar} \Theta(t - t') \Expval{\comm{\hat{A}(t)}{\hat{B}(t')}_{\mp}} + \\ + C_{AB}^A(t, t') + &\equiv \frac{i}{\hbar} \Theta(t' - t) \Expval{\comm{\hat{A}(t)}{\hat{B}(t')}_{\mp}} + \end{aligned} + } +\end{aligned}$$ + +Where the expectation value $\Expval{}$ is taken of thermodynamic equilibrium. +The name *two-particle* comes from the fact that $\hat{A}$ and $\hat{B}$ +will often consist of a sum of products +of two single-particle creation/annihilation operators. + +Like for the single-particle Green's functions, +if the Hamiltonian is time-independent, +then it can be shown that the two-particle functions +only depend on the time-difference $t - t'$: + +$$\begin{aligned} + G_{\nu \nu'}(t, t') = G_{\nu \nu'}(t \!-\! t') + \qquad + G_{\nu \nu'}^R(t, t') = G_{\nu \nu'}^>(t \!-\! t') + \qquad + G_{\nu \nu'}^A(t, t') = G_{\nu \nu'}^<(t \!-\! t') +\end{aligned}$$ + + + +## References +1. H. Bruus, K. Flensberg, + *Many-body quantum theory in condensed matter physics*, + 2016, Oxford. diff --git a/source/know/concept/gronwall-bellman-inequality/index.md b/source/know/concept/gronwall-bellman-inequality/index.md new file mode 100644 index 0000000..5fd9f38 --- /dev/null +++ b/source/know/concept/gronwall-bellman-inequality/index.md @@ -0,0 +1,204 @@ +--- +title: "Grönwall-Bellman inequality" +date: 2021-11-07 +categories: +- Mathematics +layout: "concept" +--- + +Suppose we have a first-order ordinary differential equation +for some function $u(t)$, and that it can be shown from this equation +that the derivative $u'(t)$ is bounded as follows: + +$$\begin{aligned} + u'(t) + \le \beta(t) \: u(t) +\end{aligned}$$ + +Where $\beta(t)$ is known. +Then **Grönwall's inequality** states that the solution $u(t)$ is bounded: + +$$\begin{aligned} + \boxed{ + u(t) + \le u(0) \exp\!\bigg( \int_0^t \beta(s) \dd{s} \bigg) + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-original"/> +<label for="proof-original">Proof</label> +<div class="hidden"> +<label for="proof-original">Proof.</label> +We define $w(t)$ to equal the upper bounds above +on both $w'(t)$ and $w(t)$ itself: + +$$\begin{aligned} + w(t) + \equiv u(0) \exp\!\bigg( \int_0^t \beta(s) \dd{s} \bigg) + \quad \implies \quad + w'(t) + = \beta(t) \: w(t) +\end{aligned}$$ + +Where $w(0) = u(0)$. +The goal is to show the following for all $t$: + +$$\begin{aligned} + \frac{u(t)}{w(t)} \le 1 +\end{aligned}$$ + +For $t = 0$, this is trivial, since $w(0) = u(0)$ by definition. +For $t > 0$, we want $w(t)$ to grow at least as fast as $u(t)$ +in order to satisfy the inequality. +We thus calculate: + +$$\begin{aligned} + \dv{}{t}\bigg( \frac{u}{w} \bigg) + = \frac{u' w - u w'}{w^2} + = \frac{u' w - u \beta w}{w^2} + = \frac{u' - u \beta}{w} +\end{aligned}$$ + +Since $u' \le \beta u$ as a condition, +the above derivative is always negative. +</div> +</div> + +Grönwall's inequality can be generalized to non-differentiable functions. +Suppose we know: + +$$\begin{aligned} + u(t) + \le \alpha(t) + \int_0^t \beta(s) \: u(s) \dd{s} +\end{aligned}$$ + +Where $\alpha(t)$ and $\beta(t)$ are known. +Then the **Grönwall-Bellman inequality** states that: + +$$\begin{aligned} + \boxed{ + u(t) + \le \alpha(t) + \int_0^t \alpha(s) \: \beta(s) \exp\!\bigg( \int_s^t \beta(r) \dd{r} \bigg) \dd{s} + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-integral"/> +<label for="proof-integral">Proof</label> +<div class="hidden"> +<label for="proof-integral">Proof.</label> +We start by defining $w(t)$ as follows, +which will act as shorthand: + +$$\begin{aligned} + w(t) + \equiv \exp\!\bigg( \!-\!\! \int_0^t \beta(s) \dd{s} \bigg) \bigg( \int_0^t \beta(s) \: u(s) \dd{s} \bigg) +\end{aligned}$$ + +Its derivative $w'(t)$ is then straightforwardly calculated to be given by: + +$$\begin{aligned} + w'(t) + &= \bigg( \dv{}{t} \int_0^t \beta(s) \: u(s) \dd{s} - \beta(t)\int_0^t \beta(s) \: u(s) \dd{s} \bigg) + \exp\!\bigg( \!-\!\! \int_0^t \beta(s) \dd{s} \bigg) + \\ + &= \beta(t) \bigg( u(t) - \int_0^t \beta(s) \: u(s) \dd{s} \bigg) + \exp\!\bigg( \!-\!\! \int_0^t \beta(s) \dd{s} \bigg) +\end{aligned}$$ + +The parenthesized expression it bounded from above by $\alpha(t)$, +thanks to the condition that $u(t)$ is assumed to satisfy, +for the Grönwall-Bellman inequality to be true: + +$$\begin{aligned} + w'(t) + \le \alpha(t) \: \beta(t) \exp\!\bigg( \!-\!\! \int_0^t \beta(s) \dd{s} \bigg) +\end{aligned}$$ + +Integrating this to find $w(t)$ yields the following result: + +$$\begin{aligned} + w(t) + \le \int_0^t \alpha(s) \: \beta(s) \exp\!\bigg( \!-\!\! \int_0^s \beta(r) \dd{r} \bigg) \dd{s} +\end{aligned}$$ + +In the initial definition of $w(t)$, +we now move the exponential to the other side, +and rewrite it using the above inequality for $w(t)$: + +$$\begin{aligned} + \int_0^t \beta(s) \: u(s) \dd{s} + &= w(t) \exp\!\bigg( \int_0^t \beta(s) \dd{s} \bigg) + \\ + &\le \int_0^t \alpha(s) \: \beta(s) \exp\!\bigg( \int_0^t \beta(r) \dd{r} \bigg) \exp\!\bigg( \!-\!\! \int_0^s \beta(r) \dd{r} \bigg) \dd{s} + \\ + &\le \int_0^t \alpha(s) \: \beta(s) \exp\!\bigg( \int_s^t \beta(r) \dd{r} \bigg) +\end{aligned}$$ + +Insert this into the condition under which the Grönwall-Bellman inequality holds. +</div> +</div> + +In the special case where $\alpha(t)$ is non-decreasing with $t$, +the inequality reduces to: + +$$\begin{aligned} + \boxed{ + u(t) + \le \alpha(t) \exp\!\bigg( \int_0^t \beta(s) \dd{s} \bigg) + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-special"/> +<label for="proof-special">Proof</label> +<div class="hidden"> +<label for="proof-special">Proof.</label> +Starting from the "ordinary" Grönwall-Bellman inequality, +the fact that $\alpha(t)$ is non-decreasing tells us that +$\alpha(s) \le \alpha(t)$ for all $s \le t$, so: + +$$\begin{aligned} + u(t) + &\le \alpha(t) + \int_0^t \alpha(s) \: \beta(s) \exp\!\bigg( \int_s^t \beta(r) \dd{r} \bigg) \dd{s} + \\ + &\le \alpha(t) + \alpha(t) \int_0^t \beta(s) \exp\!\bigg( \int_s^t \beta(r) \dd{r} \bigg) \dd{s} +\end{aligned}$$ + +Now, consider the following straightfoward identity, involving the exponential: + +$$\begin{aligned} + \dv{}{s}\exp\!\bigg( \int_s^t \beta(r) \dd{r} \bigg) + &= - \beta(s) \exp\!\bigg( \int_s^t \beta(r) \dd{r} \bigg) +\end{aligned}$$ + +By inserting this into Grönwall-Bellman inequality, we arrive at: + +$$\begin{aligned} + u(t) + &\le \alpha(t) - \alpha(t) \int_0^t \dv{}{s}\exp\!\bigg( \int_s^t \beta(r) \dd{r} \bigg) \dd{s} + \\ + &\le \alpha(t) - \alpha(t) \bigg[ \int \dv{}{s}\exp\!\bigg( \int_s^t \beta(r) \dd{r} \bigg) \dd{s} \bigg]_{s = 0}^{s = t} +\end{aligned}$$ + +Where we have converted the outer integral from definite to indefinite. +Continuing: + +$$\begin{aligned} + u(t) + &\le \alpha(t) - \alpha(t) \bigg[ \exp\!\bigg( \int_s^t \beta(r) \dd{r} \bigg) \bigg]_{s = 0}^{s = t} + \\ + &\le \alpha(t) - \alpha(t) \exp\!\bigg( \int_t^t \beta(r) \dd{r} \bigg) + \alpha(t) \exp\!\bigg( \int_0^t \beta(r) \dd{r} \bigg) + \\ + &\le \alpha(t) - \alpha(t) + \alpha(t) \exp\!\bigg( \int_0^t \beta(r) \dd{r} \bigg) +\end{aligned}$$ +</div> +</div> + + + +## References +1. U.H. Thygesen, + *Lecture notes on diffusions and stochastic differential equations*, + 2021, Polyteknisk Kompendie. diff --git a/source/know/concept/guiding-center-theory/index.md b/source/know/concept/guiding-center-theory/index.md new file mode 100644 index 0000000..d429a50 --- /dev/null +++ b/source/know/concept/guiding-center-theory/index.md @@ -0,0 +1,516 @@ +--- +title: "Guiding center theory" +date: 2021-09-21 +categories: +- Physics +- Electromagnetism +- Plasma physics +layout: "concept" +--- + +When discussing the [Lorentz force](/know/concept/lorentz-force/), +we introduced the concept of *gyration*: +a particle in a uniform [magnetic field](/know/concept/magnetic-field/) $\vb{B}$ +*gyrates* in a circular orbit around a **guiding center**. +Here, we will generalize this result +to more complicated situations, +for example involving [electric fields](/know/concept/electric-field/). + +The particle's equation of motion +combines the Lorentz force $\vb{F}$ +with Newton's second law: + +$$\begin{aligned} + \vb{F} + = m \dv{\vb{u}}{t} + = q \big( \vb{E} + \vb{u} \cross \vb{B} \big) +\end{aligned}$$ + +We now allow the fields vary slowly in time and space. +We thus add deviations $\delta\vb{E}$ and $\delta\vb{B}$: + +$$\begin{aligned} + \vb{E} + \to \vb{E} + \delta\vb{E}(\vb{x}, t) + \qquad \quad + \vb{B} + \to \vb{B} + \delta\vb{B}(\vb{x}, t) +\end{aligned}$$ + +Meanwhile, the velocity $\vb{u}$ can be split into +the guiding center's motion $\vb{u}_{gc}$ +and the *known* Larmor gyration $\vb{u}_L$ around the guiding center, +such that $\vb{u} = \vb{u}_{gc} + \vb{u}_L$. +Inserting: + +$$\begin{aligned} + m \dv{}{t}\big( \vb{u}_{gc} + \vb{u}_L \big) + = q \big( \vb{E} + \delta\vb{E} + (\vb{u}_{gc} + \vb{u}_L) \cross (\vb{B} + \delta\vb{B}) \big) +\end{aligned}$$ + +We already know that $m \: \idv{\vb{u}_L}{t} = q \vb{u}_L \cross \vb{B}$, +which we subtract from the total to get: + +$$\begin{aligned} + m \dv{\vb{u}_{gc}}{t} + = q \big( \vb{E} + \delta\vb{E} + \vb{u}_{gc} \cross (\vb{B} + \delta\vb{B}) + \vb{u}_L \cross \delta\vb{B} \big) +\end{aligned}$$ + +This will be our starting point. +Before proceeding, we also define +the average of $\Expval{f}$ of a function $f$ over a single gyroperiod, +where $\omega_c$ is the cyclotron frequency: + +$$\begin{aligned} + \Expval{f} + \equiv \int_0^{2 \pi / \omega_c} f(t) \dd{t} +\end{aligned}$$ + +Assuming that gyration is much faster than the guiding center's motion, +we can use this average to approximately remove the finer dynamics, +and focus only on the guiding center. + + +## Uniform electric and magnetic field + +Consider the case where $\vb{E}$ and $\vb{B}$ are both uniform, +such that $\delta\vb{B} = 0$ and $\delta\vb{E} = 0$: + +$$\begin{aligned} + m \dv{\vb{u}_{gc}}{t} + = q \big( \vb{E} + \vb{u}_{gc} \cross \vb{B} \big) +\end{aligned}$$ + +Dotting this with the unit vector $\vu{b} \equiv \vb{B} / |\vb{B}|$ +makes all components perpendicular to $\vb{B}$ vanish, +including the cross product, +leaving only the (scalar) parallel components +$u_{gc\parallel}$ and $E_\parallel$: + +$$\begin{aligned} + m \dv{u_{gc\parallel}}{t} + = \frac{q}{m} E_{\parallel} +\end{aligned}$$ + +This simply describes a constant acceleration, +and is easy to integrate. +Next, the equation for $\vb{u}_{gc\perp}$ is found by +subtracting $u_{gc\parallel}$'s equation from the original: + +$$\begin{aligned} + m \dv{\vb{u}_{gc\perp}}{t} + = q (\vb{E} + \vb{u}_{gc} \cross \vb{B}) - q E_\parallel \vu{b} + = q (\vb{E}_\perp + \vb{u}_{gc\perp} \cross \vb{B}) +\end{aligned}$$ + +Keep in mind that $\vb{u}_{gc\perp}$ explicitly excludes gyration. +If we try to split $\vb{u}_{gc\perp}$ into a constant and a time-dependent part, +and choose the most convenient constant, +we notice that the only way to exclude gyration +is to demand that $\vb{u}_{gc\perp}$ does not depend on time. +Therefore: + +$$\begin{aligned} + 0 + = \vb{E}_\perp + \vb{u}_{gc\perp} \cross \vb{B} +\end{aligned}$$ + +To find $\vb{u}_{gc\perp}$, we take the cross product with $\vb{B}$, +and use the fact that $\vb{B} \cross \vb{E}_\perp = \vb{B} \cross \vb{E}$: + +$$\begin{aligned} + 0 + = \vb{B} \cross (\vb{E}_\perp + \vb{u}_{gc\perp} \cross \vb{B}) + = \vb{B} \cross \vb{E} + \vb{u}_{gc\perp} B^2 +\end{aligned}$$ + +Rearranging this shows that $\vb{u}_{gc\perp}$ is constant. +The guiding center drifts sideways at this speed, +hence it is called a **drift velocity** $\vb{v}_E$. +Curiously, $\vb{v}_E$ is independent of $q$: + +$$\begin{aligned} + \boxed{ + \vb{v}_E + = \frac{\vb{E} \cross \vb{B}}{B^2} + } +\end{aligned}$$ + +Drift is not specific to an electric field: +$\vb{E}$ can be replaced by a general force $\vb{F}/q$ without issues. +In that case, the resulting drift velocity $\vb{v}_F$ does depend on $q$: + +$$\begin{aligned} + \boxed{ + \vb{v}_F + = \frac{\vb{F} \cross \vb{B}}{q B^2} + } +\end{aligned}$$ + + +## Non-uniform magnetic field + +Next, consider a more general case, where $\vb{B}$ is non-uniform, +but $\vb{E}$ is still uniform: + +$$\begin{aligned} + m \dv{\vb{u}_{gc}}{t} + = q \big( \vb{E} + \vb{u}_{gc} \cross (\vb{B} + \delta\vb{B}) + \vb{u}_L \cross \delta\vb{B} \big) +\end{aligned}$$ + +Assuming the gyroradius $r_L$ is small compared to the variation of $\vb{B}$, +we set $\delta\vb{B}$ to the first-order term +of a Taylor expansion of $\vb{B}$ around $\vb{x}_{gc}$, +that is, $\delta\vb{B} = (\vb{x}_L \cdot \nabla) \vb{B}$. +We thus have: + +$$\begin{aligned} + m \dv{\vb{u}_{gc}}{t} + = q \big( \vb{E} + \vb{u}_{gc} \cross \vb{B} + + \vb{u}_{gc} \cross (\vb{x}_L \cdot \nabla) \vb{B} + + \vb{u}_L \cross (\vb{x}_L \cdot \nabla) \vb{B} \big) +\end{aligned}$$ + +We approximate this by taking the average over a single gyration, +as defined earlier: + +$$\begin{aligned} + m \dv{\vb{u}_{gc}}{t} + = q \big( \vb{E} + \vb{u}_{gc} \cross \vb{B} + + \vb{u}_{gc} \cross \Expval{ (\vb{x}_L \cdot \nabla) \vb{B} } + + \Expval{ \vb{u}_L \cross (\vb{x}_L \cdot \nabla) \vb{B} } \big) +\end{aligned}$$ + +Where we have used that $\Expval{\vb{u}_{gc}} = \vb{u}_{gc}$. +The two averaged expressions turn out to be: + +$$\begin{aligned} + \Expval{ (\vb{x}_L \cdot \nabla) \vb{B} } + = 0 + \qquad \quad + \Expval{ \vb{u}_L \cross (\vb{x}_L \cdot \nabla) \vb{B} } + \approx - \frac{u_L^2}{2 \omega_c} \nabla B +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-nonuniform-B-averages"/> +<label for="proof-nonuniform-B-averages">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-nonuniform-B-averages">Proof.</label> +We know what $\vb{x}_L$ is, +so we can write out $(\vb{x}_L \cdot \nabla) \vb{B}$ +for $\vb{B} = (B_x, B_y, B_z)$: + +$$\begin{aligned} + (\vb{x}_L \cdot \nabla) \vb{B} + = \frac{u_L}{\omega_c} + \begin{pmatrix} + \displaystyle \sin(\omega_c t) \pdv{B_x}{x} + \cos(\omega_c t) \pdv{B_x}{y} \\ + \displaystyle \sin(\omega_c t) \pdv{B_y}{x} + \cos(\omega_c t) \pdv{B_y}{y} \\ + \displaystyle \sin(\omega_c t) \pdv{B_z}{x} + \cos(\omega_c t) \pdv{B_z}{y} + \end{pmatrix} +\end{aligned}$$ + +Integrating $\sin$ and $\cos$ over their period yields zero, +so the average vanishes: + +$$\begin{aligned} + \Expval{ (\vb{x}_L \cdot \nabla) \vb{B} } + = 0 +\end{aligned}$$ + +Moving on, we write out $\vb{u}_L \cross (\vb{x}_L \cdot \nabla) \vb{B}$, +suppressing the arguments of $\sin$ and $\cos$: + +$$\begin{aligned} + \vb{u}_L \cross (\vb{x}_L \cdot \nabla) \vb{B} + &= \frac{u_L^2}{\omega_c} + \begin{pmatrix} + \cos \\ + - \sin \\ + 0 + \end{pmatrix} + \cross + \begin{pmatrix} + \displaystyle \pdv{B_x}{x} \sin + \pdv{B_x}{y} \cos \\ + \displaystyle \pdv{B_y}{x} \sin + \pdv{B_y}{y} \cos \\ + \displaystyle \pdv{B_z}{x} \sin + \pdv{B_z}{y} \cos + \end{pmatrix} + \\ + &= \frac{u_L^2}{\omega_c} + \begin{pmatrix} + \displaystyle - \pdv{B_z}{x} \sin^2 - \pdv{B_z}{y} \sin \cos \\ + \displaystyle - \pdv{B_z}{x} \sin \cos - \pdv{B_z}{y} \cos^2 \\ + \displaystyle \pdv{B_y}{x} \sin \cos + \pdv{B_y}{y} \cos^2 + \displaystyle + \pdv{B_x}{x} \sin^2 + \pdv{B_x}{y} \sin \cos + \end{pmatrix} +\end{aligned}$$ + +Integrating products of $\sin$ and $\cos$ over their period gives us the following: + +$$\begin{aligned} + \Expval{\cos^2} = \Expval{\sin^2} = \frac{1}{2} + \qquad \quad + \Expval{\sin \cos} = 0 +\end{aligned}$$ + +Inserting this tells us that the average +of $\vb{u}_L \cross (\vb{x}_L \cdot \nabla) \vb{B}$ is given by: + +$$\begin{aligned} + \Expval{ \vb{u}_L \cross (\vb{x}_L \cdot \nabla) \vb{B} } + &= \frac{u_L^2}{2 \omega_c} + \begin{pmatrix} + \displaystyle - \pdv{B_z}{x} \\ + \displaystyle - \pdv{B_z}{y} \\ + \displaystyle \pdv{B_y}{y} + \pdv{B_x}{x} + \end{pmatrix} +\end{aligned}$$ + +We use [Maxwell's equation](/know/concept/maxwells-equations/) $\nabla \cdot \vb{B} = 0$ +to rewrite the $z$-component, +and follow the convention that $\vb{B}$ +points mostly in the $z$-direction, +such that $B \equiv |\vb{B}| \approx B_z$: + +$$\begin{aligned} + \Expval{ \vb{u}_L \cross (\vb{x}_L \cdot \nabla) \vb{B} } + &= - \frac{u_L^2}{2 \omega_c} + \begin{pmatrix} + \displaystyle \pdv{B_z}{x} \\ + \displaystyle \pdv{B_z}{y} \\ + \displaystyle \pdv{B_z}{z} + \end{pmatrix} + \approx - \frac{u_L^2}{2 \omega_c} + \begin{pmatrix} + \displaystyle \pdv{B}{x} \\ + \displaystyle \pdv{B}{y} \\ + \displaystyle \pdv{B}{z} + \end{pmatrix} + = - \frac{u_L^2}{2 \omega_c} \nabla B +\end{aligned}$$ +</div> +</div> + +With this, the guiding center's equation of motion +is reduced to the following: + +$$\begin{aligned} + m \dv{\vb{u}_{gc}}{t} + = q \bigg( \vb{E} + \vb{u}_{gc} \cross \vb{B} - \frac{u_L^2}{2 \omega_c} \nabla B \bigg) +\end{aligned}$$ + +Let us now split $\vb{u}_{gc}$ into +components $\vb{u}_{gc\perp}$ and $u_{gc\parallel} \vu{b}$, +which are respectively perpendicular and parallel +to the magnetic unit vector $\vu{b}$, +such that $\vb{u}_{gc} = \vb{u}_{gc\perp} \!+\! u_{gc\parallel} \vu{b}$. +Consequently: + +$$\begin{aligned} + \dv{\vb{u}_{gc}}{t} + = \dv{\vb{u}_{gc\perp}}{t} + \dv{u_{gc\parallel}}{t} \vu{b} + u_{gc\parallel} \dv{\vu{b}}{t} +\end{aligned}$$ + +Inserting this into the guiding center's equation of motion, +we now have: + +$$\begin{aligned} + \dv{\vb{u}_{gc}}{t} + = m \bigg( \dv{\vb{u}_{gc\perp}}{t} + \dv{u_{gc\parallel}}{t} \vu{b} + u_{gc\parallel} \dv{\vu{b}}{t} \bigg) + = q \bigg( \vb{E} + \vb{u}_{gc} \cross \vb{B} - \frac{u_L^2}{2 \omega_c} \nabla B \bigg) +\end{aligned}$$ + +The derivative of $\vu{b}$ can be rewritten as follows, +where $R_c$ is the radius of the field's [curvature](/know/concept/curvature/), +and $\vb{R}_c$ is the corresponding vector from the center of curvature: + +$$\begin{aligned} + \dv{\vu{b}}{t} + \approx - u_{gc\parallel} \frac{\vb{R}_c}{R_c^2} +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-nonuniform-B-curvature"/> +<label for="proof-nonuniform-B-curvature">Proof</label> +<div class="hidden"> +<label for="proof-nonuniform-B-curvature">Proof.</label> +Assuming that $\vu{b}$ does not explicitly depend on time, +i.e. $\ipdv{\vu{b}}{t} = 0$, +we can rewrite the derivative using the chain rule: + +$$\begin{aligned} + \dv{\vu{b}}{t} + = \pdv{\vu{b}}{s} \dv{s}{t} + = u_{gc\parallel} \dv{\vu{b}}{s} +\end{aligned}$$ + +Where $\dd{s}$ is the arc length of the magnetic field line, +which is equal to the radius $R_c$ times the infinitesimal subtended angle $\dd{\theta}$: + +$$\begin{aligned} + \dd{s} + = R_c \dd{\theta} +\end{aligned}$$ + +Meanwhile, across this arc, $\vu{b}$ rotates by $\dd{\theta}$, +such that the tip travels a distance $|\dd{\vu{b}}|$: + +$$\begin{aligned} + |\!\dd{\vu{b}}\!| + = |\vu{b}| \dd{\theta} + = \dd{\theta} +\end{aligned}$$ + +Furthermore, the direction $\dd{\vu{b}}$ is always opposite to $\vu{R}_c$, +which is defined as the unit vector from the center of curvature to the base of $\vu{b}$: + +$$\begin{aligned} + \dd{\vu{b}} + = - \vu{R}_c \dd{\theta} +\end{aligned}$$ + +Combining these expressions for $\dd{s}$ and $\dd{\vu{b}}$, +we find the following derivative: + +$$\begin{aligned} + \dv{\vu{b}}{s} + = - \frac{\vu{R}_c \dd{\theta}}{R_c \dd{\theta}} + = - \frac{\vu{R}_c}{R_c} + = - \frac{\vb{R}_c}{R_c^2} +\end{aligned}$$ +</div> +</div> + +With this, we arrive at the following equation of motion +for the guiding center: + +$$\begin{aligned} + m \bigg( \dv{\vb{u}_{gc\perp}}{t} + \dv{u_{gc\parallel}}{t} \vu{b} - u_{gc\parallel}^2 \frac{\vb{R}_c}{R_c} \bigg) + = q \bigg( \vb{E} + \vb{u}_{gc} \cross \vb{B} - \frac{u_L^2}{2 \omega_c} \nabla B \bigg) +\end{aligned}$$ + +Since both $\vb{R}_c$ and any cross product with $\vb{B}$ +will always be perpendicular to $\vb{B}$, +we can split this equation into perpendicular and parallel components like so: + +$$\begin{aligned} + m \dv{\vb{u}_{gc\perp}}{t} + &= q \vb{E}_{\perp} - \frac{q u_L^2}{2 \omega_c} \nabla_{\!\perp} B + m u_{gc\parallel}^2 \frac{\vb{R}_c}{R_c} + q \vb{u}_{gc} \cross \vb{B} + \\ + m \dv{u_{gc\parallel}}{t} + &= q E_{\parallel} - \frac{q u_L^2}{2 \omega_c} \nabla_{\!\parallel} B +\end{aligned}$$ + +The parallel part simply describes an acceleration. +The perpendicular part is more interesting: +we rewrite it as follows, defining an effective force $\vb{F}_{\!\perp}$: + +$$\begin{aligned} + m \dv{\vb{u}_{gc\perp}}{t} + = \vb{F}_{\!\perp} + q \vb{u}_{gc} \cross \vb{B} + \qquad \quad + \vb{F}_{\!\perp} + \equiv q \vb{E}_\perp + m u_{gc\parallel}^2 \frac{\vb{R}_c}{R_c} - \frac{q u_L^2}{2 \omega_c} \nabla_{\!\perp} B +\end{aligned}$$ + +To solve this, we make a crude approximation now, and improve it later. +We thus assume that $\vb{u}_{gc\perp}$ is constant in time, +such that the equation reduces to: + +$$\begin{aligned} + 0 + \approx \vb{F}_{\!\perp} + q \vb{u}_{gc} \cross \vb{B} + = \vb{F}_{\!\perp} + q \vb{u}_{gc\perp} \cross \vb{B} +\end{aligned}$$ + +This is analogous to the previous case of a uniform electric field, +with $q \vb{E}$ replaced by $\vb{F}_{\!\perp}$, +so it is also solved by crossing with $\vb{B}$ in front, +yielding a drift: + +$$\begin{aligned} + \vb{u}_{gc\perp} + \approx \vb{v}_F + \equiv \frac{\vb{F}_{\!\perp} \cross \vb{B}}{q B^2} +\end{aligned}$$ + +From the definition of $\vb{F}_{\!\perp}$, +this total $\vb{v}_F$ can be split into three drifts: +the previously seen electric field drift $\vb{v}_E$, +the **curvature drift** $\vb{v}_c$, +and the **grad-$\vb{B}$ drift** $\vb{v}_{\nabla B}$: + +$$\begin{aligned} + \boxed{ + \vb{v}_c + = \frac{m u_{gc\parallel}^2}{q} \frac{\vb{R}_c \cross \vb{B}}{R_c^2 B^2} + } + \qquad \quad + \boxed{ + \vb{v}_{\nabla B} + = \frac{u_L^2}{2 \omega_c} \frac{\vb{B} \cross \nabla B}{B^2} + } +\end{aligned}$$ + +Such that $\vb{v}_F = \vb{v}_E + \vb{v}_c + \vb{v}_{\nabla B}$. +We are still missing a correction, +since we neglected the time dependence of $\vb{u}_{gc\perp}$ earlier. +This correction is called $\vb{v}_p$, +where $\vb{u}_{gc\perp} \approx \vb{v}_F + \vb{v}_p$. +We revisit the perpendicular equation, which now reads: + +$$\begin{aligned} + m \dv{}{t}\big( \vb{v}_F + \vb{v}_p \big) + = \vb{F}_{\!\perp} + q \big( \vb{v}_F + \vb{v}_p \big) \cross \vb{B} +\end{aligned}$$ + +We assume that $\vb{v}_F$ varies much faster than $\vb{v}_p$, +such that $\idv{}{\vb{v}p}{t}$ is negligible. +In addition, from the derivation of $\vb{v}_F$, +we know that $\vb{F}_{\!\perp} + q \vb{v}_F \cross \vb{B} = 0$, +leaving only: + +$$\begin{aligned} + m \dv{\vb{v}_F}{t} + = q \vb{v}_p \cross \vb{B} +\end{aligned}$$ + +To isolate this for $\vb{v}_p$, +we take the cross product with $\vb{B}$ in front, +like earlier. +We thus arrive at the following correction, +known as the **polarization drift** $\vb{v}_p$: + +$$\begin{aligned} + \boxed{ + \vb{v}_p + = - \frac{m}{q B^2} \dv{\vb{v}_F}{t} \cross \vb{B} + } +\end{aligned}$$ + +In many cases $\vb{v}_E$ dominates $\vb{v}_F$, +so in some literature $\vb{v}_p$ is approximated as follows: + +$$\begin{aligned} + \vb{v}_p + \approx - \frac{m}{q B^2} \dv{\vb{v}_E}{t} \cross \vb{B} + = - \frac{m}{q B^2} \Big( \dv{}{t}(\vb{E}_\perp \cross \vb{B}) \Big) \cross \vb{B} + = - \frac{m}{q B^2} \dv{\vb{E}_\perp}{t} +\end{aligned}$$ + +The polarization drift stands out from the others: +it has the opposite sign, +it is proportional to $m$, +and it is often only temporary. +Therefore, it is also called the **inertia drift**. + + + +## References +1. F.F. Chen, + *Introduction to plasma physics and controlled fusion*, + 3rd edition, Springer. +2. M. Salewski, A.H. Nielsen, + *Plasma physics: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/hagen-poiseuille-equation/index.md b/source/know/concept/hagen-poiseuille-equation/index.md new file mode 100644 index 0000000..fc2975a --- /dev/null +++ b/source/know/concept/hagen-poiseuille-equation/index.md @@ -0,0 +1,197 @@ +--- +title: "Hagen-Poiseuille equation" +date: 2021-04-13 +categories: +- Physics +- Fluid mechanics +- Fluid dynamics +layout: "concept" +--- + +The **Hagen-Poiseuille equation**, or simply the **Poiseuille equation**, +describes the flow of a fluid with nonzero [viscosity](/know/concept/viscosity/) +through a cylindrical pipe. +Due to its viscosity, the fluid clings to the sides, +limiting the amount that can pass through, for a pipe with radius $R$. + +Consider the [Navier-Stokes equations](/know/concept/navier-stokes-equations/) +of an incompressible fluid with spatially uniform density $\rho$. +Assuming that the flow is steady $\ipdv{\va{v}}{t} = 0$, +and that gravity is negligible $\va{g} = 0$, we get: + +$$\begin{aligned} + (\va{v} \cdot \nabla) \va{v} + = - \frac{\nabla p}{\rho} + \nu \nabla^2 \va{v} + \qquad \quad + \nabla \cdot \va{v} = 0 +\end{aligned}$$ + +Into this, we insert the ansatz $\va{v} = \vu{e}_z \: v_z(r)$, +where $\vu{e}_z$ is the $z$-axis' unit vector. +In other words, we assume that the flow velocity depends only on $r$; +not on $\phi$ or $z$. +Plugging this into the Navier-Stokes equations, +$\nabla \cdot \va{v}$ is trivially zero, +and in the other equation we multiply out $\rho$, yielding this, +where $\eta = \rho \nu$ is the dynamic viscosity: + +$$\begin{aligned} + \nabla p + = \vu{e}_z \: \eta \nabla^2 v_z +\end{aligned}$$ + +Because only $\vu{e}_z$ appears on the right-hand side, +only the $z$-component of $\nabla p$ can be nonzero. +However, $v_z(r)$ is a function of $r$, not $z$! +The left thus only depends on $z$, and the right only on $r$, +meaning that both sides must equal a constant, +which we call $-G$: + +$$\begin{aligned} + \dv{p}{z} + = -G + \qquad \quad + \eta \frac{1}{r} \dv{}{r}\Big( r \dv{v_z}{r} \Big) + = - G +\end{aligned}$$ + +The former equation, for $p(z)$, is easy to solve. +We get an integration constant $p(0)$: + +$$\begin{aligned} + p(z) + = p(0) - G z +\end{aligned}$$ + +This gives meaning to the **pressure gradient** $G$: +for a pipe of length $L$, +it describes the pressure difference $\Delta p = p(0) - p(L)$ +that is driving the fluid, +i.e. $G = \Delta p / L$ + +As for the latter equation, for $v_z(r)$, +we start by integrating it once, introducing a constant $A$: + +$$\begin{aligned} + \dv{}{r}\Big( r \dv{v_z}{r} \Big) + = - \frac{G}{\eta} r + \quad \implies \quad + \dv{v_z}{r} + = - \frac{G}{2 \eta} r + \frac{A}{r} +\end{aligned}$$ + +Integrating this one more time, +thereby introducing another constant $B$, +we arrive at: + +$$\begin{aligned} + v_z + = - \frac{G}{4 \eta} r^2 + A \ln{r} + B +\end{aligned}$$ + +The velocity must be finite at $r = 0$, so we set $A = 0$. +Furthermore, the Navier-Stokes equation's *no-slip* condition +demands that $v_z = 0$ at the boundary $r = R$, +so $B = G R^2 / (4 \eta)$. +This brings us to the **Poiseuille solution** for $v_z(r)$: + +$$\begin{aligned} + \boxed{ + v_z(r) + = \frac{G}{4 \eta} (R^2 - r^2) + } +\end{aligned}$$ + +How much fluid can pass through the pipe per unit time? +This is denoted by the **volumetric flow rate** $Q$, +which is the integral of $v_z$ over the circular cross-section: + +$$\begin{aligned} + Q + = 2 \pi \int_0^R v_z(r) \: r \dd{r} + = \frac{\pi G}{2 \eta} \int_0^R R^2 r - r^3 \dd{r} + = \frac{\pi G}{2 \eta} \bigg[ \frac{R^2 r^2}{2} - \frac{r^4}{4} \bigg]_0^R +\end{aligned}$$ + +We thus arrive at the main Hagen-Poiseuille equation, +which predicts $Q$ for a given setup: + +$$\begin{aligned} + \boxed{ + Q + = \frac{\pi G R^4}{8 \eta} + } +\end{aligned}$$ + +Consequently, the average flow velocity $\Expval{v_z}$ +is simply $Q$ divided by the cross-sectional area: + +$$\begin{aligned} + \Expval{v_z} + = \frac{Q}{\pi R^2} + = \frac{G R^2}{8 \eta} +\end{aligned}$$ + +The fluid's viscous stickiness means it exerts a drag force $D$ +on the pipe as it flows. For a pipe of length $L$ and radius $R$, +we calculate $D$ by multiplying the internal area $2 \pi R L$ +by the [shear stress](/know/concept/cauchy-stress-tensor/) +$-\sigma_{zr}$ on the wall +(i.e. the wall applies $\sigma_{zr}$, the fluid responds with $- \sigma_{zr}$): + +$$\begin{aligned} + D + = - 2 \pi R L \: \sigma_{zr} \big|_{r = R} + = - 2 \pi R L \eta \dv{v_z}{r}\Big|_{r = R} + = 2 \pi R L \eta \frac{G R}{2 \eta} + = \pi R^2 L G +\end{aligned}$$ + +We would like to get rid of $G$ for being impractical, +so we substitute $R^2 G = 8 \eta \Expval{v_z}$, yielding: + +$$\begin{aligned} + \boxed{ + D + = 8 \pi \eta L \Expval{v_z} + } +\end{aligned}$$ + +Due to this drag, the pressure difference $\Delta p = p(0) - p(L)$ +does work on the fluid, at a rate $P$, +since power equals force (i.e. pressure times area) times velocity: + +$$\begin{aligned} + P + = 2 \pi \int_0^R \Delta p \: v_z(r) \: r \dd{r} +\end{aligned}$$ + +Because $\Delta p$ is independent of $r$, +we get the same integral we used to calculate $Q$. +Then, thanks to the fact that $\Delta p = G L$ +and $Q = \pi R^2 \Expval{v_z}$, it follows that: + +$$\begin{aligned} + P + = \Delta p \: Q + = G L \pi R^2 \Expval{v_z} + = D \Expval{v_z} +\end{aligned}$$ + +In conclusion, the power $P$, +needed to drive a fluid through the pipe at a rate $Q$, +is given by: + +$$\begin{aligned} + \boxed{ + P + = 8 \pi \eta L \Expval{v_z}^2 + } +\end{aligned}$$ + + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/hamiltonian-mechanics/index.md b/source/know/concept/hamiltonian-mechanics/index.md new file mode 100644 index 0000000..610f8bd --- /dev/null +++ b/source/know/concept/hamiltonian-mechanics/index.md @@ -0,0 +1,308 @@ +--- +title: "Hamiltonian mechanics" +date: 2021-07-03 +categories: +- Physics +- Classical mechanics +layout: "concept" +--- + +**Hamiltonian mechanics** is an alternative formulation of classical mechanics, +which equivalent to Newton's laws, +but often mathematically advantageous. +It is built on the shoulders of [Lagrangian mechanics](/know/concept/lagrangian-mechanics/), +which is in turn built on [variational calculus](/know/concept/calculus-of-variations/). + + +## Definitions + +In Lagrangian mechanics, use a Lagrangian $L$, +which depends on position $q(t)$ and velocity $\dot{q}(t)$, +to define the momentum $p(t)$ as a derived quantity. +Hamiltonian mechanics switches the roles of $\dot{q}$ and $p$: +the **Hamiltonian** $H$ is a function of $q$ and $p$, +and the velocity $\dot{q}$ is derived from it: + +$$\begin{aligned} + \pdv{L(q, \dot{q})}{\dot{q}} = p + \qquad \quad + \pdv{H(q, p)}{p} \equiv \dot{q} +\end{aligned}$$ + +Conveniently, this switch turns out to be +[Legendre transformation](/know/concept/legendre-transform/): +$H$ is the Legendre transform of $L$, +with $p = \partial L / \partial \dot{q}$ taken as +the coordinate to replace $\dot{q}$. +Therefore: + +$$\begin{aligned} + \boxed{ + H(q, p) \equiv \dot{q} \: p - L(q, \dot{q}) + } +\end{aligned}$$ + +This almost always works, +because $L$ is usually a second-order polynomial of $\dot{q}$, +and thus convex as required for Legendre transformation. +In the above expression, +$\dot{q}$ must be rewritten in terms of $p$ and $q$, +which is trivial, since $p$ is proportional to $\dot{q}$ by definition. + +The Hamiltonian $H$ also has a direct physical meaning: +for a mass $m$, and for $L = T - V$, +it is straightforward to show that $H$ represents the total energy $T + V$: + +$$\begin{aligned} + H + = \dot{q} \: p - L + = m \dot{q}^2 - L + = 2 T - (T - V) + = T + V +\end{aligned}$$ + +Just as Lagrangian mechanics, +Hamiltonian mechanics scales well for large systems. +Its definition is generalized as follows to $N$ objects, +where $p$ is shorthand for $p_1, ..., p_N$: + +$$\begin{aligned} + \boxed{ + H(q, p) + \equiv \bigg( \sum_{n = 1}^N \dot{q}_n \: p_n \bigg) - L(q, \dot{q}) + } +\end{aligned}$$ + +The positions and momenta $(q, p)$ form a phase space, +i.e. they fully describe the state. + +An extremely useful concept in Hamiltonian mechanics +is the **Poisson bracket** (PB), +which is a binary operation on two quantities $A(q, p)$ and $B(q, p)$, +denoted by $\{A, B\}$: + +$$\begin{aligned} + \boxed{ + \{ A, B \} + \equiv \sum_{n = 1}^N \Big( \pdv{A}{q_n} \pdv{B}{p_n} - \pdv{A}{p_n} \pdv{B}{q_n} \Big) + } +\end{aligned}$$ + + +## Canonical equations + +Lagrangian mechanics has a single Euler-Lagrange equation per object, +yielding $N$ second-order equations of motion in total. +In contrast, Hamiltonian mechanics has $2 N$ first-order equations of motion, +known as **Hamilton's canonical equations**: + +$$\begin{aligned} + \boxed{ + - \pdv{H}{q_n} = \dot{p}_n + \qquad + \pdv{H}{p_n} = \dot{q}_n + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-canoneq"/> +<label for="proof-canoneq">Proof</label> +<div class="hidden"> +<label for="proof-canoneq">Proof.</label> +For the first equation, +we differentiate $H$ with respect to $q_n$, +and use the chain rule: + +$$\begin{aligned} + \pdv{H}{q_n} + &= \pdv{}{q_n}\Big( \sum_{j} \dot{q}_j \: p_j - L \Big) + \\ + &= \sum_{j} \bigg( \Big( \dot{q}_j \pdv{p_j}{q_n} + p_j \pdv{\dot{q}_j}{q_n} \Big) + - \Big( \pdv{L}{q_n} + \pdv{L}{\dot{q}_j} \pdv{\dot{q}_j}{q_n} \Big) \bigg) + \\ + &= \sum_{j} \Big( p_j \pdv{\dot{q}_j}{q_n} - \pdv{L}{q_n} - p_j \pdv{\dot{q}_j}{q_n} \Big) + = - \pdv{L}{q_n} +\end{aligned}$$ + +We use the Euler-Lagrange equation here, +leading to the desired equation: + +$$\begin{aligned} + - \pdv{L}{q_n} = - \dv{}{t}\Big( \pdv{L}{\dot{q}_n} \Big) = - \dv{p_n}{t} = - \dot{p}_n +\end{aligned}$$ + +The second equation is somewhat trivial, +since $H$ is defined to satisfy it in the first place. +Nevertheless, we can prove it by brute force, +using the same approach as above: + +$$\begin{aligned} + \pdv{H}{p_n} + &= \pdv{}{p_n}\Big( \sum_{j} \dot{q}_j \: p_j - L \Big) + \\ + &= \sum_{j} \bigg( \Big( \dot{q}_j \pdv{p_j}{p_n} + p_j \pdv{\dot{q}_j}{p_n} \Big) + - \Big( \pdv{L}{q_j} \pdv{q_j}{p_n} + \pdv{L}{\dot{q}_j} \pdv{\dot{q}_j}{p_n} \Big) \bigg) + \\ + &= \dot{q}_n + \sum_{j} \Big( p_j \pdv{\dot{q}_j}{p_n} + - 0 \pdv{L}{q_j} - p_j \pdv{\dot{q}_j}{p_n} \Big) + = \dot{q}_n +\end{aligned}$$ +</div> +</div> + +Just like in Lagrangian mechanics, if $H$ does not explicitly contain $q_n$, +then $q_n$ is called a **cyclic coordinate**, and leads to the conservation of $p_n$: + +$$\begin{aligned} + \dot{p}_n = - \pdv{H}{q_n} = 0 + \quad \implies \quad + p_n = \mathrm{conserved} +\end{aligned}$$ + +Of course, there may be other conserved quantities. +Generally speaking, the $t$-derivative of an arbitrary quantity $A(q, p, t)$ is as follows, +where $\ipdv{}{t}$ is a "soft" derivative +(only affects explicit occurrences of $t$), +and $\idv{}{t}$ is a "hard" derivative +(also affects implicit $t$ inside $q$ and $p$): + +$$\begin{aligned} + \boxed{ + \dv{A}{t} + = \{ A, H \} + \pdv{A}{t} + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-diff-t"/> +<label for="proof-diff-t">Proof</label> +<div class="hidden"> +<label for="proof-diff-t">Proof.</label> +We differentiate via the multivariate chain rule, +insert the canonical equations, +and eventually recognize the PB definition: + +$$\begin{aligned} + \dv{A}{t} + &= \sum_{n} \Big( \pdv{A}{q_n} \pdv{q_n}{t} + \pdv{A}{p_n} \pdv{p_n}{t} \Big) + \pdv{A}{t} + \\ + &= \sum_{n} \Big( \pdv{A}{q_n} \dot{q}_n + \pdv{A}{p_n} \dot{p}_n \Big) + \pdv{A}{t} + \\ + &= \sum_{n} \Big( \pdv{A}{q_n} \pdv{H}{p_n} - \pdv{A}{p_n} \pdv{H}{q_n} \Big) + \pdv{A}{t} +\end{aligned}$$ +</div> +</div> + +Assuming that $H$ does not explicitly depend on $t$, +the above property naturally leads us to an alternative +way of writing Hamilton's canonical equations: + +$$\begin{aligned} + \dot{q}_n = \{ q_n, H \} + \qquad \quad + \dot{p}_n = \{ p_n, H \} +\end{aligned}$$ + + + +## Canonical coordinates + +So far, we have assumed that the phase space coordinates $(q, p)$ +are the *positions* and *canonical momenta*, respectively, +and that led us to Hamilton's canonical equations. + +In theory, we could make a transformation of the following general form: + +$$\begin{aligned} + q \to Q(q, p) + \qquad \quad + p \to P(q, p) +\end{aligned}$$ + +However, most choices of $(Q, P)$ would not preserve Hamilton's equations. +Any $(Q, P)$ that do keep this form +are known as **canonical coordinates**, +and the corresponding transformation is a **canonical transformation**. +That is, any $(Q, P)$ that satisfy: + +$$\begin{aligned} + - \pdv{H}{Q_n} = \dot{P}_n + \qquad \quad + \pdv{H}{P_n} = \dot{Q}_n +\end{aligned}$$ + +Then we might as well write $H(q, p)$ as $H(Q, P)$. +So, which $(Q, P)$ fulfill this? +It turns out that the following must be satisfied for all $n, j$, +where $\delta_{nj}$ is the Kronecker delta: + +$$\begin{aligned} + \boxed{ + \{ Q_n, Q_j \} = \{ P_n, P_j \} = 0 + \qquad + \{ Q_n, P_j \} = \delta_{nj} + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-cantrans"/> +<label for="proof-cantrans">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-cantrans">Proof.</label> +Assuming that $Q_n$, $P_n$ and $H$ do not explicitly depend on $t$, +we use our expression for the $t$-derivative of an arbitrary quantity, +and apply the multivariate chain rule to it: + +$$\begin{aligned} + \dot{Q}_n + &= \{Q_n, H\} + = \sum_{n} \bigg( \pdv{Q_n}{q_n} \pdv{H}{p_n} - \pdv{Q_n}{p_n} \pdv{H}{q_n} \bigg) + \\ + &= \sum_{n, j} \bigg( \pdv{Q_n}{q_n} \Big( \pdv{H}{Q_j} \pdv{Q_j}{p_n} + \pdv{H}{P_j} \pdv{P_j}{p_n} \Big) + - \pdv{Q_n}{p_n} \Big( \pdv{H}{Q_j} \pdv{Q_j}{q_n} + \pdv{H}{P_j} \pdv{P_j}{q_n} \Big) \bigg) + \\ + &= \sum_{n, j} \bigg( \pdv{H}{Q_j} \Big( \pdv{Q_n}{q_n} \pdv{Q_j}{p_n} - \pdv{Q_n}{p_n} \pdv{Q_j}{q_n} \Big) + + \pdv{H}{P_j} \Big( \pdv{Q_n}{q_n} \pdv{P_j}{p_n} - \pdv{Q_n}{p_n} \pdv{P_j}{q_n} \Big) \bigg) + \\ + &= \sum_{j} \bigg( \pdv{H}{Q_j} \{Q_n, Q_j\} + \pdv{H}{P_j} \{Q_n, P_j\} \bigg) +\end{aligned}$$ + +This is equivalent to Hamilton's equation $\dot{Q}_n = \ipdv{H}{P_n}$ +if and only if $\{Q_n, Q_j\} = 0$ for all $n$ and $j$, +and if $\{Q_n, P_j\} = \delta_{nj}$. + +Next, we do the exact same thing with $P_n$ instead of $Q_n$, +giving an analogous result: + +$$\begin{aligned} + \dot{P}_n + &= \{P_n, H\} + = \sum_{n} \bigg( \pdv{P_n}{q_n} \pdv{H}{p_n} - \pdv{P_n}{p_n} \pdv{H}{q_n} \bigg) + \\ + &= \sum_{n, j} \bigg( \pdv{P_n}{q_n} \Big( \pdv{H}{Q_j} \pdv{Q_j}{p_n} + \pdv{H}{P_j} \pdv{P_j}{p_n} \Big) + - \pdv{P_n}{p_n} \Big( \pdv{H}{Q_j} \pdv{Q_j}{q_n} + \pdv{H}{P_j} \pdv{P_j}{q_n} \Big) \bigg) + \\ + &= \sum_{n, j} \bigg( \pdv{H}{Q_j} \Big( \pdv{P_n}{q_n} \pdv{Q_j}{p_n} - \pdv{P_n}{p_n} \pdv{Q_j}{q_n} \Big) + + \pdv{H}{P_j} \Big( \pdv{P_n}{q_n} \pdv{P_j}{p_n} - \pdv{P_n}{p_n} \pdv{P_j}{q_n} \Big) \bigg) + \\ + &= \sum_{j} \bigg( \pdv{H}{Q_j} \{P_n, Q_j\} + \pdv{H}{P_j} \{P_n, P_j\} \bigg) +\end{aligned}$$ + +Which is equivalent to Hamilton's equation $\dot{P}_n = -\ipdv{H}{Q_n}$ +if and only if $\{P_n, P_j\} = 0$, +and $\{Q_n, P_j\} = - \delta_{nj}$. +The PB is anticommutative, +i.e. $\{A, B\} = - \{B, A\}$. +</div> +</div> + +If you have experience with quantum mechanics, +the latter equation should look suspiciously similar +to the *canonical commutation relation* $[\hat{Q}, \hat{P}] = i \hbar$. + + + +## References +1. R. Shankar, + *Principles of quantum mechanics*, 2nd edition, + Springer. diff --git a/source/know/concept/harmonic-oscillator/index.md b/source/know/concept/harmonic-oscillator/index.md new file mode 100644 index 0000000..f17203b --- /dev/null +++ b/source/know/concept/harmonic-oscillator/index.md @@ -0,0 +1,287 @@ +--- +title: "Harmonic oscillator" +date: 2021-06-02 +categories: +- Physics +- Mathematics +layout: "concept" +--- + +A **harmonic oscillator** obeys +the simple 1D version of [Hooke's law](/know/concept/hookes-law/): +to displace the system away from its equilibrium, +the needed force $F_d(x)$ scales linearly with the displacement $x(t)$: + +$$\begin{aligned} + F_d(x) = k x +\end{aligned}$$ + +Where $k$ is a system-specific proportionality constant, +called the **spring constant**, +since a spring is a good example of a harmonic oscillator, +at least for small displacements. +Hooke's law is also often stated for +the restoring force $F_r(x)$ instead: + +$$\begin{aligned} + F_r(x) = - k x +\end{aligned}$$ + +Let a mass $m$ be attached to the end of the spring. +After displacing it, we let it go $F_d = 0$, +so Newton's second law for the restoring force $F_r$ demands that: + +$$\begin{aligned} + F_r = m x'' +\end{aligned}$$ + +But $F_r = - k x$, +meaning $m x'' = - k x$, +leading to the following equation for $x(t)$: + +$$\begin{aligned} + \boxed{ + x'' + \omega_0^2 x = 0 + } +\end{aligned}$$ + +Where $\omega_0 \equiv \sqrt{k / m}$ is the **natural frequency** of the system. +This differential equation has the following general solution: + +$$\begin{aligned} + \boxed{ + x(t) + = C_1 \sin(\omega_0 t) + C_2 \cos(\omega_0 t) + } +\end{aligned}$$ + +Where $C_1$ and $C_2$ are constants determined by the initial conditions. +For example, for $x(0) = 1$ and $x'(0) = 0$, the solution becomes: + +$$\begin{aligned} + x(t) = \cos(\omega_0 t) +\end{aligned}$$ + +When using [Lagrangian](/know/concept/lagrangian-mechanics/) +or Hamiltonian mechanics, +we need to know the potential energy $V(x)$ +added to the system by a displacement to $x$. +This equals the work done by the displacement, +and is therefore given by: + +$$\begin{aligned} + V(x) = \int_0^x F_d(x) \:dx = \frac{1}{2} k x^2 = \frac{1}{2} m \omega_0^2 x^2 +\end{aligned}$$ + + +## Damped oscillation + +If there is a **friction force** $F_f$ affecting the system, +then the oscillation amplitude will decrease, +or it might not oscillate at all. +We define $F_f$ using a **viscous damping coefficient** $c$: + +$$\begin{aligned} + F_f = - c x' +\end{aligned}$$ + +Both $F_r$ and $F_f$ are acting on the system, +so Newton's second law states that: + +$$\begin{aligned} + m x'' = - c x' - k x +\end{aligned}$$ + +This can be rewritten in the following conventional form +by defining the **damping coefficient** $\zeta \equiv c / (2 \sqrt{m k})$, +which determines the expected behaviour of the system: + +$$\begin{aligned} + \boxed{ + x'' + 2 \zeta \omega_0 x' + \omega_0^2 x = 0 + } +\end{aligned}$$ + +The general solution is found from the roots $u$ of the auxiliary quadratic equation: + +$$\begin{aligned} + u^2 + 2 \zeta \omega_0 u + \omega_0^2 = 0 +\end{aligned}$$ + +The discriminant $D = 4 \zeta^2 \omega_0^2 - 4 \omega_0^2$ +tells us that the behaviour changes substantially +depending on the damping coefficient $\zeta$, +with three possibilities: $\zeta < 1$ or $\zeta = 1$ or $\zeta > 1$. + +If $\zeta < 1$, there is **underdamping**: +the system oscillates with exponentially decaying +amplitude and reduced frequency $\omega_1 \equiv \omega_0 \sqrt{1 - \zeta^2}$. +The general solution is: + +$$\begin{aligned} + \boxed{ + x(t) + = \big( C_1 \sin(\omega_1 t) + C_2 \cos(\omega_1 t) \big) \exp(- \zeta \omega_0 t) + } +\end{aligned}$$ + +If $\zeta = 1$, there is **critical damping**: +the system returns to its equilibrium point in minimum time. +The general solution is given by: + +$$\begin{aligned} + \boxed{ + x(t) + = \big( C_1 + C_2 t \big) \exp(- \zeta \omega_0 t) + } +\end{aligned}$$ + +If $\zeta > 1$, there is **overdamping**: +the system returns to equilibrium slowly. +The general solution is as follows, +where $\omega_1 \equiv \omega_0 \sqrt{\zeta^2 - 1}$: + +$$\begin{aligned} + \boxed{ + x(t) + = \big( C_1 \exp(\omega_1 t) + C_2 \exp(- \omega_1 t) \big) \exp(- \zeta \omega_0 t) + } +\end{aligned}$$ + + +## Forced oscillation + +In the differential equations given above, +the right-hand side has always been zero, +meaning that the oscillator is not affected by any external forces. +What if we put a function there? + +$$\begin{aligned} + x'' + 2 \zeta \omega_0 x' + \omega_0^2 x = f(t) +\end{aligned}$$ + +Obviously, there exist infinitely many $f(t)$ to choose from, +and each needs a separate analysis. +However, there is one type of $f(t)$ that deserves special mention, +namely sinusoids: + +$$\begin{aligned} + \boxed{ + x'' + 2 \zeta \omega_0 x' + \omega_0^2 x = \frac{F}{m} \cos(\omega t + \chi) + } +\end{aligned}$$ + +Where $F$ is a constant force, $\chi$ is an arbitrary phase, +and the frequency $\omega$ is not necessarily $\omega_0$. +We solve this case for $x(t)$ in detail. +Consider the complex version of the equation: + +$$\begin{aligned} + X'' + 2 \zeta \omega_0 X' + \omega_0^2 X = \frac{F}{m} \exp\!\big(i (\omega t + \chi)\big) +\end{aligned}$$ + +Then $x(t) = \Real\{X(t)\}$. +Inserting the ansatz $X(t) = C \exp(i \omega t)$, +for some constant $C$: + +$$\begin{aligned} + - C \omega^2 + C 2 i \zeta \omega_0 \omega + C \omega_0^2 = \frac{F}{m} \exp(i \chi) +\end{aligned}$$ + +Where $\exp(i \omega t)$ has already been divided out. +We isolate this equation for $C$: + +$$\begin{aligned} + C + = \frac{F}{m \big((\omega_0^2 - \omega^2) + 2 i \zeta \omega_0 \omega\big)} \exp(i \chi) + = \frac{F \big((\omega_0^2 - \omega^2) - 2 i \zeta \omega_0 \omega\big)} + {m \big((\omega_0^2 - \omega^2)^2 + 4 \zeta^2 \omega_0^2 \omega^2\big)} + \exp(i \chi) +\end{aligned}$$ + +We would like to rewrite this in polar form $C = r \exp(i \theta)$, +which turns out to be as follows: + +$$\begin{aligned} + C + &= \frac{F}{m \sqrt{(\omega_0^2 - \omega^2)^2 + 4 \zeta^2 \omega_0^2 \omega^2}} + \exp\!\bigg(i \chi - i \arctan\!\Big(\frac{2 \zeta \omega_0 \omega}{\omega_0^2 - \omega^2}\Big)\bigg) +\end{aligned}$$ + +For brevity, let us define the **impedance** $Z$ +and the **phase shift** $\phi$ +in the following way: + +$$\begin{aligned} + Z + \equiv \sqrt{(\omega_0^2 - \omega^2)^2 / \omega^2 + 4 \zeta^2 \omega_0^2} + \qquad \quad + \phi + \equiv \arctan\!\Big(\frac{2 \zeta \omega_0 \omega}{\omega_0^2 - \omega^2}\Big) +\end{aligned}$$ + +Returning to the original ansatz $X(t) = C \exp(i \omega t)$, +we take its real part to find $x(t)$: + +$$\begin{aligned} + \boxed{ + x(t) + = \frac{F}{m \omega Z} \sin(\omega t + \chi - \phi) + } +\end{aligned}$$ + +Two things are noteworthy here. +Firstly, $f(t)$ and $x(t)$ are out of phase by $\phi$; there is some lag. +This is caused by damping, because if $\zeta = 0$, it disappears $\phi = 0$. + +Secondly, the amplitude of $x(t)$ depends on $\omega$ and $\omega_0$. +This brings us to **resonance**, +where the amplitude can become extremely large. +Actually, resonance has two subtly different definitions, +depending on which one of $\omega$ and $\omega_0$ is a free parameter, +and which one is fixed. + +If the natural $\omega_0$ is fixed and the driving $\omega$ is variable, +we find for which $\omega$ resonance occurs by minimizing the amplitude denominator $\omega Z$. +We thus find: + +$$\begin{aligned} + 0 + = \dv{(\omega Z)}{\omega} + = \frac{- 4 \omega_0^2 \omega + 4 \omega^3 + 8 \zeta^2 \omega_0^2 \omega}{2 \sqrt{(\omega_0^2 - \omega^2)^2 + 4 \zeta^2 \omega_0^2 \omega^2}} + \quad \implies \quad + \boxed{ + \omega = \omega_0 \sqrt{1 - 2 \zeta^2} + } +\end{aligned}$$ + +Meaning the resonant $\omega$ is lower than $\omega_0$, +and resonance can only occur if $\zeta < 1 / \sqrt{2}$. + +However, if the driving $\omega$ is fixed and the natural is $\omega_0$ is variable, +the problem is bit more subtle: +the damping coefficient $\zeta = c / (2 m \omega_0)$ +depends on $\omega_0$. +This leads us to: + +$$\begin{aligned} + 0 + = \dv{(\omega Z)}{\omega_0} + = \frac{4 \omega_0^3 - 4 \omega^2 \omega_0}{2 \sqrt{(\omega_0^2 - \omega^2)^2 + c^2 \omega^2 / m^2}} + \quad \implies \quad + \boxed{ + \omega_0 = \omega + } +\end{aligned}$$ + +Surprisingly, the damping does not affect $\omega_0$, if $\omega$ is given. +However, in both cases, the damping *does* matter for the eventual amplitude: +$c \to 0$ leads to $x \to \infty$, +and resonance disappears or becomes negligible for $c \to \infty$. + + + +## References +1. M.L. Boas, + *Mathematical methods in the physical sciences*, 2nd edition, + Wiley. diff --git a/source/know/concept/heaviside-step-function/index.md b/source/know/concept/heaviside-step-function/index.md new file mode 100644 index 0000000..30b5f5d --- /dev/null +++ b/source/know/concept/heaviside-step-function/index.md @@ -0,0 +1,96 @@ +--- +title: "Heaviside step function" +date: 2021-02-25 +categories: +- Mathematics +- Physics +layout: "concept" +--- + +The **Heaviside step function** $\Theta(t)$, +is a discontinuous function used for enforcing causality +or for representing a signal switched on at $t = 0$. +It is defined as: + +$$\begin{aligned} + \boxed{ + \Theta(t) = + \begin{cases} + 0 & \mathrm{if}\: t < 0 \\ + 1 & \mathrm{if}\: t > 1 + \end{cases} + } +\end{aligned}$$ + +The value of $\Theta(t \!=\! 0)$ varies between definitions; +common choices are $0$, $1$ and $1/2$. +In practice, this rarely matters, and some authors even +change their definition on the fly for convenience. +For physicists, $\Theta(0) = 1$ is generally best, such that: + +$$\begin{aligned} + \boxed{ + \forall n \in \mathbb{R}: \Theta^n(t) = \Theta(t) + } +\end{aligned}$$ + +Unsurprisingly, the first-order derivative of $\Theta(t)$ is +the [Dirac delta function](/know/concept/dirac-delta-function/): + +$$\begin{aligned} + \boxed{ + \Theta'(t) = \delta(t) + } +\end{aligned}$$ + +The [Fourier transform](/know/concept/fourier-transform/) +of $\Theta(t)$ is as follows, +where $\pv{}$ is the Cauchy principal value, +$A$ and $s$ are constants from the FT's definition, +and $\mathrm{sgn}$ is the signum function: + +$$\begin{aligned} + \boxed{ + \tilde{\Theta}(\omega) + = \frac{A}{|s|} \Big( \pi \delta(\omega) + i \: \mathrm{sgn}(s) \pv{\frac{1}{\omega}} \Big) + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-fourier"/> +<label for="proof-fourier">Proof</label> +<div class="hidden"> +<label for="proof-fourier">Proof.</label> +In this case, it is easiest to use $\Theta(0) = 1/2$, +such that the Heaviside step function can be expressed +using the signum function $\mathrm{sgn}(t)$: + +$$\begin{aligned} + \Theta(t) = \frac{1}{2} + \frac{\mathrm{sgn}(t)}{2} +\end{aligned}$$ + +We then take the Fourier transform, +where $A$ and $s$ are constants from its definition: + +$$\begin{aligned} + \tilde{\Theta}(\omega) + = \hat{\mathcal{F}}\{\Theta(t)\} + = \frac{A}{2} \Big( \int_{-\infty}^\infty \exp(i s \omega t) \dd{t} + \int_{-\infty}^\infty \mathrm{sgn}(t) \exp(i s \omega t) \dd{t} \Big) +\end{aligned}$$ + +The first term is proportional to the Dirac delta function. +The second integral is problematic, so we take the Cauchy principal value $\pv{}$ +and look up the integral: + +$$\begin{aligned} + \tilde{\Theta}(\omega) + &= A \pi \delta(s \omega) + \frac{A}{2} \pv{\int_{-\infty}^\infty \mathrm{sgn}(t) \exp(i s \omega t) \dd{t}} + = \frac{A}{|s|} \pi \delta(\omega) + i \frac{A}{s} \pv{\frac{1}{\omega}} +\end{aligned}$$ +</div> +</div> + +The use of $\pv{}$ without an integral is an abuse of notation, +and means that this result only makes sense when wrapped in an integral. +Formally, $\pv{\{1 / \omega\}}$ is a [Schwartz distribution](/know/concept/schwartz-distribution/). + diff --git a/source/know/concept/heisenberg-picture/index.md b/source/know/concept/heisenberg-picture/index.md new file mode 100644 index 0000000..b6c49d7 --- /dev/null +++ b/source/know/concept/heisenberg-picture/index.md @@ -0,0 +1,115 @@ +--- +title: "Heisenberg picture" +date: 2021-02-24 +categories: +- Quantum mechanics +- Physics +layout: "concept" +--- + +The **Heisenberg picture** is an alternative formulation of quantum +mechanics, and is equivalent to the traditionally-taught Schrödinger equation. + +In the Schrödinger picture, the operators (observables) are fixed +(as long as they do not depend on time), while the state +$\Ket{\psi_S(t)}$ changes according to the Schrödinger equation, +which can be written using the generator of translations $\hat{U}(t)$ like so, +for a time-independent $\hat{H}_S$: + +$$\begin{aligned} + \Ket{\psi_S(t)} = \hat{U}(t) \Ket{\psi_S(0)} + \qquad \quad + \boxed{ + \hat{U}(t) \equiv \exp\!\bigg(\!-\! i \frac{\hat{H}_S t}{\hbar} \bigg) + } +\end{aligned}$$ + +In contrast, the Heisenberg picture reverses the roles: +the states $\Ket{\psi_H}$ are invariant, +and instead the operators vary with time. +An advantage of this is that the basis states remain the same. + +Given a Schrödinger-picture state $\Ket{\psi_S(t)}$, and operator +$\hat{L}_S(t)$ which may or may not depend on time, they can be +converted to the Heisenberg picture by the following change of basis: + +$$\begin{aligned} + \boxed{ + \Ket{\psi_H} \equiv \Ket{\psi_S(0)} + \qquad + \hat{L}_H(t) \equiv \hat{U}^\dagger(t) \: \hat{L}_S(t) \: \hat{U}(t) + } +\end{aligned}$$ + +Since $\hat{U}(t)$ is unitary, the expectation value of a given operator is unchanged: + +$$\begin{aligned} + \expval{\hat{L}_H} + &= \matrixel{\psi_H}{\hat{L}_H(t)}{\psi_H} + = \matrixel{\psi_S(0)}{\hat{U}^\dagger(t) \: \hat{L}_S(t) \: \hat{U}(t)}{\psi_S(0)} + \\ + &= \matrixel{\hat{U}(t) \psi_S(0)}{\hat{L}_S(t)}{\hat{U}(t) \psi_S(0)} + = \matrixel{\psi_S(t)}{\hat{L}_S}{\psi_S(t)} + = \expval{\hat{L}_S} +\end{aligned}$$ + +The Schrödinger and Heisenberg pictures therefore respectively +correspond to active and passive transformations by $\hat{U}(t)$ +in [Hilbert space](/know/concept/hilbert-space/). +The two formulations are thus entirely equivalent, +and can be derived from one another, +as will be shown shortly. + +In the Heisenberg picture, the states are constant, +so the time-dependent Schrödinger equation is not directly useful. +Instead, we will use it derive a new equation for $\hat{L}_H(t)$. +The key is that the generator $\hat{U}(t)$ is defined from the Schrödinger equation: + +$$\begin{aligned} + \dv{}{t}\hat{U}(t) = - \frac{i}{\hbar} \hat{H}_S(t) \: \hat{U}(t) +\end{aligned}$$ + +Where $\hat{H}_S(t)$ may depend on time. We differentiate the definition of +$\hat{L}_H(t)$ and insert the other side of the Schrödinger equation +when necessary: + +$$\begin{aligned} + \dv{}{\hat{L}H}{t} + &= \dv{\hat{U}^\dagger}{t} \hat{L}_S \hat{U} + + \hat{U}^\dagger \hat{L}_S \dv{\hat{U}}{t} + + \hat{U}^\dagger \dv{\hat{L}_S}{t} \hat{U} + \\ + &= \frac{i}{\hbar} \hat{U}^\dagger \hat{H}_S (\hat{U} \hat{U}^\dagger) \hat{L}_S \hat{U} + - \frac{i}{\hbar} \hat{U}^\dagger \hat{L}_S (\hat{U} \hat{U}^\dagger) \hat{H}_S \hat{U} + + \Big( \dv{\hat{L}_S}{t} \Big)_H + \\ + &= \frac{i}{\hbar} \hat{H}_H \hat{L}_H + - \frac{i}{\hbar} \hat{L}_H \hat{H}_H + + \Big( \dv{\hat{L}_S}{t} \Big)_H + = \frac{i}{\hbar} \comm{\hat{H}_H}{\hat{L}_H} + \Big( \dv{\hat{L}_S}{t} \Big)_H +\end{aligned}$$ + +We thus get the equation of motion for operators in the Heisenberg picture: + +$$\begin{aligned} + \boxed{ + \dv{}{t}\hat{L}_H(t) = \frac{i}{\hbar} \comm{\hat{H}_H(t)}{\hat{L}_H(t)} + \Big( \dv{}{t}\hat{L}_S(t) \Big)_H + } +\end{aligned}$$ + +This equation is closer to classical mechanics than the Schrödinger picture: +inserting the position $\hat{X}$ and momentum $\hat{P} = - i \hbar \: \idv{}{\hat{X}}$ +gives the following Newton-style equations: + +$$\begin{aligned} + \dv{\hat{X}}{t} + &= \frac{i}{\hbar} \comm{\hat{H}}{\hat{X}} + = \frac{\hat{P}}{m} + \\ + \dv{\hat{P}}{t} + &= \frac{i}{\hbar} \comm{\hat{H}}{\hat{P}} + = - \dv{V(\hat{X})}{\hat{X}} +\end{aligned}$$ + +For a proof, see [Ehrenfest's theorem](/know/concept/ehrenfests-theorem/), +which is closely related to the Heisenberg picture. diff --git a/source/know/concept/hellmann-feynman-theorem/index.md b/source/know/concept/hellmann-feynman-theorem/index.md new file mode 100644 index 0000000..6b458db --- /dev/null +++ b/source/know/concept/hellmann-feynman-theorem/index.md @@ -0,0 +1,91 @@ +--- +title: "Hellmann-Feynman theorem" +date: 2021-11-29 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +Consider the time-independent Schrödinger equation, +where the Hamiltonian $\hat{H}$ depends on a general parameter $\lambda$, +whose meaning or type we will not specify: + +$$\begin{aligned} + \hat{H}(\lambda) \Ket{\psi_n(\lambda)} + = E_n(\lambda) \Ket{\psi_n(\lambda)} +\end{aligned}$$ + +Assuming all eigenstates $\Ket{\psi_n}$ are normalized, +this gives us the following basic relation: + +$$\begin{aligned} + \matrixel{\psi_m}{\hat{H}}{\psi_n} + = E_n \Inprod{\psi_m}{\psi_n} + = \delta_{mn} E_n +\end{aligned}$$ + +We differentiate this with respect to $\lambda$, +which could be a scalar or a vector. +This yields: + +$$\begin{aligned} + \delta_{mn} \nabla_\lambda E_n + &= \nabla_\lambda \matrixel{\psi_m}{\hat{H}}{\psi_n} + \\ + &= \matrixel{\nabla_\lambda \psi_m}{\hat{H}}{\psi_n} + + \matrixel{\psi_m}{\nabla_\lambda \hat{H}}{\psi_n} + + \matrixel{\psi_m}{\hat{H}}{\nabla_\lambda \psi_n} + \\ + &= E_m \Inprod{\psi_m}{\nabla_\lambda \psi_n} + E_n \Inprod{\nabla_\lambda \psi_m}{\psi_n} + \matrixel{\psi_m}{\nabla_\lambda \hat{H}}{\psi_n} +\end{aligned}$$ + +In order to simplify this, +we differentiate the orthogonality relation +$\Inprod{\psi_m}{\psi_n} = \delta_{mn}$, +which ends up telling us that +$\Inprod{\nabla_\lambda \psi_m}{\psi_n} = - \Inprod{\psi_m}{\nabla_\lambda \psi_n}$: + +$$\begin{aligned} + 0 + = \nabla_\lambda \delta_{mn} + = \nabla_\lambda \Inprod{\psi_m}{\psi_n} + = \Inprod{\nabla_\lambda \psi_m}{\psi_n} + \Inprod{\psi_m}{\nabla_\lambda \psi_n} +\end{aligned}$$ + +Using this result to replace $\Inprod{\nabla_\lambda \psi_m}{\psi_n}$ +in the previous equation leads to: + +$$\begin{aligned} + \delta_{mn} \nabla_\lambda E_n + &= (E_m - E_n) \Inprod{\psi_m}{\nabla_\lambda \psi_n} + \matrixel{\psi_m}{\nabla_\lambda \hat{H}}{\psi_n} +\end{aligned}$$ + +For $m = n$, we therefore arrive at the **Hellmann-Feynman theorem**, +which is useful when doing numerical calculations +to minimize energies with respect to $\lambda$: + +$$\begin{aligned} + \boxed{ + \nabla_\lambda E_n + = \matrixel{\psi_n}{\nabla_\lambda \hat{H}}{\psi_n} + } +\end{aligned}$$ + +While for $m \neq n$, we get the **Epstein generalization** +of the Hellmann-Feynman theorem, which is for example relevant for +the [Berry phase](/know/concept/berry-phase/): + +$$\begin{aligned} + \boxed{ + (E_n - E_m) \Inprod{\psi_m}{\nabla_\lambda \psi_n} + = \matrixel{\psi_m}{\nabla_\lambda \hat{H}}{\psi_n} + } +\end{aligned}$$ + + + +## References +1. G. Grosso, G.P. Parravicini, + *Solid state physics*, + 2nd edition, Elsevier. diff --git a/source/know/concept/hermite-polynomials/index.md b/source/know/concept/hermite-polynomials/index.md new file mode 100644 index 0000000..17e61df --- /dev/null +++ b/source/know/concept/hermite-polynomials/index.md @@ -0,0 +1,94 @@ +--- +title: "Hermite polynomials" +date: 2021-09-08 +categories: +- Mathematics +- Statistics +layout: "concept" +--- + +The **Hermite polynomials** are a set of functions +that appear in physics and statistics, +although slightly different definitions are used in those fields. + + +## Physicists' definition + +The **Hermite equation** is an eigenvalue problem for $n$, +and the Hermite polynomials $H_n(x)$ are its eigenfunctions $u(x)$, +subject to the boundary condition that $u$ grows at most polynomially, +in which case the eigenvalues $n$ are non-negative integers: + +$$\begin{aligned} + \boxed{ + u'' - 2 x u' + 2 n u = 0 + } +\end{aligned}$$ + +The $n$th-order Hermite polynomial $H_n(x)$ +is therefore as follows, according to physicists: + +$$\begin{aligned} + H_n(x) + &= (-1)^n \exp(x^2) \dvn{n}{}{x}\exp(- x^2) + \\ + &= \Big( 2 x - \dv{}{x}\Big)^n 1 +\end{aligned}$$ + +This form is known as a *Rodrigues' formula*. +The first handful of Hermite polynomials are: + +$$\begin{gathered} + H_0(x) = 1 + \qquad \quad + H_1(x) = 2 x + \qquad \quad + H_2(x) = 4 x^2 - 2 + \\ + H_3(x) = 8 x^3 - 12 x + \qquad \quad + H_4(x) = 16 x^4 - 48 x^2 + 12 +\end{gathered}$$ + +And then more $H_n$ can be computed quickly +using the following recurrence relation: + +$$\begin{aligned} + \boxed{ + H_{n + 1}(x) = 2 x H_n(x) - 2n H_{n-1}(x) + } +\end{aligned}$$ + +They (almost) form an *Appell sequence*, +meaning their derivatives are like so: + +$$\begin{aligned} + \boxed{ + \dvn{k}{}{x}H_n(x) + = 2^k \frac{n!}{(n - k)!} H_{n - k}(x) + } +\end{aligned}$$ + +Importantly, all $H_n$ are orthogonal with respect to the weight function $w(x) \equiv \exp(- x^2)$: + +$$\begin{aligned} + \boxed{ + \Inprod{H_n}{w H_m} + \equiv \int_{-\infty}^\infty H_n(x) \: H_m(x) \: w(x) \dd{x} + = \sqrt{\pi} 2^n n! \: \delta_{nm} + } +\end{aligned}$$ + +Where $\delta_{nm}$ is the Kronecker delta. +Finally, they form a basis in the [Hilbert space](/know/concept/hilbert-space/) +of all functions $f(x)$ for which $\Inprod{f}{w f}$ is finite. +This means that every such $f$ can be expanded in $H_n$: + +$$\begin{aligned} + \boxed{ + f(x) + = \sum_{n = 0}^\infty a_n H_n(x) + = \sum_{n = 0}^\infty \frac{\Inprod{H_n}{w f}}{\Inprod{H_n}{w H_n}} H_n(x) + } +\end{aligned}$$ + diff --git a/source/know/concept/hilbert-space/index.md b/source/know/concept/hilbert-space/index.md new file mode 100644 index 0000000..d2b9770 --- /dev/null +++ b/source/know/concept/hilbert-space/index.md @@ -0,0 +1,196 @@ +--- +title: "Hilbert space" +date: 2021-02-22 +categories: +- Mathematics +- Quantum mechanics +layout: "concept" +--- + +A **Hilbert space**, also called an **inner product space**, is an +abstract **vector space** with a notion of length and angle. + + +## Vector space + +An abstract **vector space** $\mathbb{V}$ is a generalization of the +traditional concept of vectors as "arrows". It consists of a set of +objects called **vectors** which support the following (familiar) +operations: + ++ **Vector addition**: the sum of two vectors $V$ and $W$, denoted $V + W$. ++ **Scalar multiplication**: product of a vector $V$ with a scalar $a$, denoted $a V$. + +In addition, for a given $\mathbb{V}$ to qualify as a proper vector +space, these operations must obey the following axioms: + ++ **Addition is associative**: $U + (V + W) = (U + V) + W$ ++ **Addition is commutative**: $U + V = V + U$ ++ **Addition has an identity**: there exists a $\mathbf{0}$ such that $V + 0 = V$ ++ **Addition has an inverse**: for every $V$ there exists $-V$ so that $V + (-V) = 0$ ++ **Multiplication is associative**: $a (b V) = (a b) V$ ++ **Multiplication has an identity**: There exists a $1$ such that $1 V = V$ ++ **Multiplication is distributive over scalars**: $(a + b)V = aV + bV$ ++ **Multiplication is distributive over vectors**: $a (U + V) = a U + a V$ + +A set of $N$ vectors $V_1, V_2, ..., V_N$ is **linearly independent** if +the only way to satisfy the following relation is to set all the scalar coefficients $a_n = 0$: + +$$\begin{aligned} + \mathbf{0} = \sum_{n = 1}^N a_n V_n +\end{aligned}$$ + +In other words, these vectors cannot be expressed in terms of each +other. Otherwise, they would be **linearly dependent**. + +A vector space $\mathbb{V}$ has **dimension** $N$ if only up to $N$ of +its vectors can be linearly indepedent. All other vectors in +$\mathbb{V}$ can then be written as a **linear combination** of these $N$ **basis vectors**. + +Let $\vu{e}_1, ..., \vu{e}_N$ be the basis vectors, then any +vector $V$ in the same space can be **expanded** in the basis according to +the unique weights $v_n$, known as the **components** of $V$ +in that basis: + +$$\begin{aligned} + V = \sum_{n = 1}^N v_n \vu{e}_n +\end{aligned}$$ + +Using these, the vector space operations can then be implemented as follows: + +$$\begin{gathered} + V = \sum_{n = 1} v_n \vu{e}_n + \quad + W = \sum_{n = 1} w_n \vu{e}_n + \\ + \quad \implies \quad + V + W = \sum_{n = 1}^N (v_n + w_n) \vu{e}_n + \qquad + a V = \sum_{n = 1}^N a v_n \vu{e}_n +\end{gathered}$$ + + +## Inner product + +A given vector space $\mathbb{V}$ can be promoted to a **Hilbert space** +or **inner product space** if it supports an operation $\Inprod{U}{V}$ +called the **inner product**, which takes two vectors and returns a +scalar, and has the following properties: + ++ **Skew symmetry**: $\Inprod{U}{V} = (\Inprod{V}{U})^*$, where ${}^*$ is the complex conjugate. ++ **Positive semidefiniteness**: $\Inprod{V}{V} \ge 0$, and $\Inprod{V}{V} = 0$ if $V = \mathbf{0}$. ++ **Linearity in second operand**: $\Inprod{U}{(a V + b W)} = a \Inprod{U}{V} + b \Inprod{U}{W}$. + +The inner product describes the lengths and angles of vectors, and in +Euclidean space it is implemented by the dot product. + +The **magnitude** or **norm** $|V|$ of a vector $V$ is given by +$|V| = \sqrt{\Inprod{V}{V}}$ and represents the real positive length of $V$. +A **unit vector** has a norm of 1. + +Two vectors $U$ and $V$ are **orthogonal** if their inner product +$\Inprod{U}{V} = 0$. If in addition to being orthogonal, $|U| = 1$ and +$|V| = 1$, then $U$ and $V$ are known as **orthonormal** vectors. + +Orthonormality is desirable for basis vectors, so if they are +not already like that, it is common to manually turn them into a new +orthonormal basis using e.g. the [Gram-Schmidt method](/know/concept/gram-schmidt-method). + +As for the implementation of the inner product, it is given by: + +$$\begin{gathered} + V = \sum_{n = 1}^N v_n \vu{e}_n + \quad + W = \sum_{n = 1}^N w_n \vu{e}_n + \\ + \quad \implies \quad + \Inprod{V}{W} = \sum_{n = 1}^N \sum_{m = 1}^N v_n^* w_m \Inprod{\vu{e}_n}{\vu{e}_j} +\end{gathered}$$ + +If the basis vectors $\vu{e}_1, ..., \vu{e}_N$ are already +orthonormal, this reduces to: + +$$\begin{aligned} + \Inprod{V}{W} = \sum_{n = 1}^N v_n^* w_n +\end{aligned}$$ + +As it turns out, the components $v_n$ are given by the inner product +with $\vu{e}_n$, where $\delta_{nm}$ is the Kronecker delta: + +$$\begin{aligned} + \Inprod{\vu{e}_n}{V} = \sum_{m = 1}^N \delta_{nm} v_m = v_n +\end{aligned}$$ + + +## Infinite dimensions + +As the dimensionality $N$ tends to infinity, things may or may not +change significantly, depending on whether $N$ is **countably** or +**uncountably** infinite. + +In the former case, not much changes: the infinitely many **discrete** +basis vectors $\vu{e}_n$ can all still be made orthonormal as usual, +and as before: + +$$\begin{aligned} + V = \sum_{n = 1}^\infty v_n \vu{e}_n +\end{aligned}$$ + +A good example of such a countably-infinitely-dimensional basis are the +solution eigenfunctions of a [Sturm-Liouville problem](/know/concept/sturm-liouville-theory/). + +However, if the dimensionality is uncountably infinite, the basis +vectors are **continuous** and cannot be labeled by $n$. For example, all +complex functions $f(x)$ defined for $x \in [a, b]$ which +satisfy $f(a) = f(b) = 0$ form such a vector space. +In this case $f(x)$ is expanded as follows, where $x$ is a basis vector: + +$$\begin{aligned} + f(x) = \int_a^b \Inprod{x}{f} \dd{x} +\end{aligned}$$ + +Similarly, the inner product $\Inprod{f}{g}$ must also be redefined as +follows: + +$$\begin{aligned} + \Inprod{f}{g} = \int_a^b f^*(x) \: g(x) \dd{x} +\end{aligned}$$ + +The concept of orthonormality must be also weakened. A finite function +$f(x)$ can be normalized as usual, but the basis vectors $x$ themselves +cannot, since each represents an infinitesimal section of the real line. + +The rationale in this case is that action of the identity operator $\hat{I}$ must +be preserved, which is given here in [Dirac notation](/know/concept/dirac-notation/): + +$$\begin{aligned} + \hat{I} = \int_a^b \Ket{\xi} \Bra{\xi} \dd{\xi} +\end{aligned}$$ + +Applying the identity operator to $f(x)$ should just give $f(x)$ again: + +$$\begin{aligned} + f(x) = \Inprod{x}{f} = \matrixel{x}{\hat{I}}{f} + = \int_a^b \Inprod{x}{\xi} \Inprod{\xi}{f} \dd{\xi} + = \int_a^b \Inprod{x}{\xi} f(\xi) \dd{\xi} +\end{aligned}$$ + +Since we want the latter integral to reduce to $f(x)$, it is plain to see that +$\Inprod{x}{\xi}$ can only be a [Dirac delta function](/know/concept/dirac-delta-function/), +i.e $\Inprod{x}{\xi} = \delta(x - \xi)$: + +$$\begin{aligned} + \int_a^b \Inprod{x}{\xi} f(\xi) \dd{\xi} + = \int_a^b \delta(x - \xi) f(\xi) \dd{\xi} + = f(x) +\end{aligned}$$ + +Consequently, $\Inprod{x}{\xi} = 0$ if $x \neq \xi$ as expected for an +orthogonal set of vectors, but if $x = \xi$ the inner product +$\Inprod{x}{\xi}$ is infinite, unlike earlier. + +Technically, because the basis vectors $x$ cannot be normalized, they +are not members of a Hilbert space, but rather of a superset called a +**rigged Hilbert space**. Such vectors have no finite inner product with +themselves, but do have one with all vectors from the actual Hilbert +space. diff --git a/source/know/concept/holomorphic-function/index.md b/source/know/concept/holomorphic-function/index.md new file mode 100644 index 0000000..17bd5a6 --- /dev/null +++ b/source/know/concept/holomorphic-function/index.md @@ -0,0 +1,189 @@ +--- +title: "Holomorphic function" +date: 2021-02-25 +categories: +- Mathematics +- Complex analysis +layout: "concept" +--- + +In complex analysis, a complex function $f(z)$ of a complex variable $z$ +is called **holomorphic** or **analytic** if it is complex differentiable in the +neighbourhood of every point of its domain. +This is a very strong condition. + +As a result, holomorphic functions are infinitely differentiable and +equal their Taylor expansion at every point. In physicists' terms, +they are extremely "well-behaved" throughout their domain. + +More formally, a given function $f(z)$ is holomorphic in a certain region +if the following limit exists for all $z$ in that region, +and for all directions of $\Delta z$: + +$$\begin{aligned} + \boxed{ + f'(z) = \lim_{\Delta z \to 0} \frac{f(z + \Delta z) - f(z)}{\Delta z} + } +\end{aligned}$$ + +We decompose $f$ into the real functions $u$ and $v$ of real variables $x$ and $y$: + +$$\begin{aligned} + f(z) = f(x + i y) = u(x, y) + i v(x, y) +\end{aligned}$$ + +Since we are free to choose the direction of $\Delta z$, we choose $\Delta x$ and $\Delta y$: + +$$\begin{aligned} + f'(z) + &= \lim_{\Delta x \to 0} \frac{f(z + \Delta x) - f(z)}{\Delta x} + = \pdv{u}{x} + i \pdv{v}{x} + \\ + &= \lim_{\Delta y \to 0} \frac{f(z + i \Delta y) - f(z)}{i \Delta y} + = \pdv{v}{y} - i \pdv{u}{y} +\end{aligned}$$ + +For $f(z)$ to be holomorphic, these two results must be equivalent. +Because $u$ and $v$ are real by definition, +we thus arrive at the **Cauchy-Riemann equations**: + +$$\begin{aligned} + \boxed{ + \pdv{u}{x} = \pdv{v}{y} + \qquad + \pdv{v}{x} = - \pdv{u}{y} + } +\end{aligned}$$ + +Therefore, a given function $f(z)$ is holomorphic if and only if its real +and imaginary parts satisfy these equations. This gives an idea of how +strict the criteria are to qualify as holomorphic. + + +## Integration formulas + +Holomorphic functions satisfy **Cauchy's integral theorem**, which states +that the integral of $f(z)$ over any closed curve $C$ in the complex plane is zero, +provided that $f(z)$ is holomorphic for all $z$ in the area enclosed by $C$: + +$$\begin{aligned} + \boxed{ + \oint_C f(z) \dd{z} = 0 + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-int-theorem"/> +<label for="proof-int-theorem">Proof</label> +<div class="hidden"> +<label for="proof-int-theorem">Proof.</label> +Just like before, we decompose $f(z)$ into its real and imaginary parts: + +$$\begin{aligned} + \oint_C f(z) \dd{z} + &= \oint_C (u + i v) \dd{(x + i y)} + = \oint_C (u + i v) \:(\dd{x} + i \dd{y}) + \\ + &= \oint_C u \dd{x} - v \dd{y} + i \oint_C v \dd{x} + u \dd{y} +\end{aligned}$$ + +Using Green's theorem, we integrate over the area $A$ enclosed by $C$: + +$$\begin{aligned} + \oint_C f(z) \dd{z} + &= - \iint_A \pdv{v}{x} + \pdv{u}{y} \dd{x} \dd{y} + i \iint_A \pdv{u}{x} - \pdv{v}{y} \dd{x} \dd{y} +\end{aligned}$$ + +Since $f(z)$ is holomorphic, $u$ and $v$ satisfy the Cauchy-Riemann +equations, such that the integrands disappear and the final result is zero. +</div> +</div> + +An interesting consequence is **Cauchy's integral formula**, which +states that the value of $f(z)$ at an arbitrary point $z_0$ is +determined by its values on an arbitrary contour $C$ around $z_0$: + +$$\begin{aligned} + \boxed{ + f(z_0) = \frac{1}{2 \pi i} \oint_C \frac{f(z)}{z - z_0} \dd{z} + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-int-formula"/> +<label for="proof-int-formula">Proof</label> +<div class="hidden"> +<label for="proof-int-formula">Proof.</label> +Thanks to the integral theorem, we know that the shape and size +of $C$ is irrelevant. Therefore we choose it to be a circle with radius $r$, +such that the integration variable becomes $z = z_0 + r e^{i \theta}$. Then +we integrate by substitution: + +$$\begin{aligned} + \frac{1}{2 \pi i} \oint_C \frac{f(z)}{z - z_0} \dd{z} + &= \frac{1}{2 \pi i} \int_0^{2 \pi} f(z) \frac{i r e^{i \theta}}{r e^{i \theta}} \dd{\theta} + = \frac{1}{2 \pi} \int_0^{2 \pi} f(z_0 + r e^{i \theta}) \dd{\theta} +\end{aligned}$$ + +We may choose an arbitrarily small radius $r$, such that the contour approaches $z_0$: + +$$\begin{aligned} + \lim_{r \to 0}\:\: \frac{1}{2 \pi} \int_0^{2 \pi} f(z_0 + r e^{i \theta}) \dd{\theta} + &= \frac{f(z_0)}{2 \pi} \int_0^{2 \pi} \dd{\theta} + = f(z_0) +\end{aligned}$$ +</div> +</div> + +Similarly, **Cauchy's differentiation formula**, +or **Cauchy's integral formula for derivatives** +gives all derivatives of a holomorphic function as follows, +and also guarantees their existence: + +$$\begin{aligned} + \boxed{ + f^{(n)}(z_0) + = \frac{n!}{2 \pi i} \oint_C \frac{f(z)}{(z - z_0)^{n + 1}} \dd{z} + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-diff-formula"/> +<label for="proof-diff-formula">Proof</label> +<div class="hidden"> +<label for="proof-diff-formula">Proof.</label> +By definition, the first derivative $f'(z)$ of a +holomorphic function exists and is: + +$$\begin{aligned} + f'(z_0) + = \lim_{z \to z_0} \frac{f(z) - f(z_0)}{z - z_0} +\end{aligned}$$ + +We evaluate the numerator using Cauchy's integral theorem as follows: + +$$\begin{aligned} + f'(z_0) + &= \lim_{z \to z_0} \frac{1}{z - z_0} + \bigg( \frac{1}{2 \pi i} \oint_C \frac{f(\zeta)}{\zeta - z} \dd{\zeta} - \frac{1}{2 \pi i} \oint_C \frac{f(\zeta)}{\zeta - z_0} \dd{\zeta} \bigg) + \\ + &= \frac{1}{2 \pi i} \lim_{z \to z_0} \frac{1}{z - z_0} + \oint_C \frac{f(\zeta)}{\zeta - z} - \frac{f(\zeta)}{\zeta - z_0} \dd{\zeta} + \\ + &= \frac{1}{2 \pi i} \lim_{z \to z_0} \frac{1}{z - z_0} + \oint_C \frac{f(\zeta) (z - z_0)}{(\zeta - z)(\zeta - z_0)} \dd{\zeta} +\end{aligned}$$ + +This contour integral converges uniformly, so we may apply the limit on the inside: + +$$\begin{aligned} + f'(z_0) + &= \frac{1}{2 \pi i} \oint_C \Big( \lim_{z \to z_0} \frac{f(\zeta)}{(\zeta - z)(\zeta - z_0)} \Big) \dd{\zeta} + = \frac{1}{2 \pi i} \oint_C \frac{f(\zeta)}{(\zeta - z_0)^2} \dd{\zeta} +\end{aligned}$$ + +Since the second-order derivative $f''(z)$ is simply the derivative of $f'(z)$, +this proof works inductively for all higher orders $n$. +</div> +</div> + diff --git a/source/know/concept/hookes-law/index.md b/source/know/concept/hookes-law/index.md new file mode 100644 index 0000000..57ab27f --- /dev/null +++ b/source/know/concept/hookes-law/index.md @@ -0,0 +1,239 @@ +--- +title: "Hooke's law" +date: 2021-04-02 +categories: +- Physics +- Continuum physics +layout: "concept" +--- + +In its simplest form, **Hooke's law** dictates that +changing the length of an elastic object requires +a force that is proportional the desired length difference. +In its most general form, it gives a linear relationship +between the [Cauchy stress tensor](/know/concept/cauchy-stress-tensor/) $\hat{\sigma}$ +to the [Cauchy strain tensor](/know/concept/cauchy-strain-tensor/) $\hat{u}$. + +Importantly, all forms of Hooke's law are only valid for small deformations, +since the stress-strain relationship becomes nonlinear otherwise. + + +## Simple form + +The simple form of the law is traditionally quoted for springs, +since they have a spring constant $k$ giving the ratio +between the force $F$ and extension $x$: + +$$\begin{aligned} + \boxed{ + F + = k x + } +\end{aligned}$$ + +In general, all solids are elastic for small extensions, +and therefore also obey Hooke's law. +In light of this fact, we replace the traditional spring +with a rod of length $L$ and cross-section $A$. + +The constant $k$ depends on, among several things, +the spring's length $L$ and cross-section $A$, +so for our generalization, we want a new parameter +to describe the proportionality independently of the rod's dimensions. +To achieve this, we realize that the force $F$ is spread across $A$, +and that the extension $x$ should be take relative to $L$. + +$$\begin{aligned} + \frac{F}{A} + = \Big( k \frac{L}{A} \Big) \frac{x}{L} +\end{aligned}$$ + +The force-per-area $F/A$ on a solid is the definition of **stress**, +and the relative elongation $x/L$ is the defintion of **strain**. +If $F$ acts along the $x$-axis, we can then write: + +$$\begin{aligned} + \boxed{ + \sigma_{xx} + = E u_{xx} + } +\end{aligned}$$ + +Where the proportionality constant $E$, +known as the **elastic modulus** or **Young's modulus**, +is the general material parameter that we wanted: + +$$\begin{aligned} + E + = k \frac{L}{A} +\end{aligned}$$ + +Due to the microscopic structure of some (usually crystalline) materials, +$E$ might be dependent on the direction of the force $F$. +For simplicity, we only consider **isotropic** materials, +which have the same properties measured from any direction. + +However, we are still missing something. +When a spring is pulled, +it becomes narrower as its coils move apart, +and this effect is also seen when stretching solids in general: +if we pull our rod along the $x$-axis, we expect it to deform in $y$ and $z$ as well. +This is described by **Poisson's ratio** $\nu$: + +$$\begin{aligned} + \boxed{ + \nu + \equiv - \frac{u_{yy}}{u_{xx}} + } +\end{aligned}$$ + +Note that $u_{yy} = u_{zz}$ because the material is assumed to be isotropic. +Intuitively, you may expect that the volume of the object is conserved, +but for most materials that is not accurate. + +In summary, for our example case with a force $F = T A$ pulling at the rod +along the $x$-axis, the full stress and strain tensors are given by: + +$$\begin{aligned} + \hat{\sigma} = + \begin{bmatrix} + T & 0 & 0 \\ + 0 & 0 & 0 \\ + 0 & 0 & 0 + \end{bmatrix} + \qquad + \hat{u} = + \begin{bmatrix} + T/E & 0 & 0 \\ + 0 & -\nu T/E & 0 \\ + 0 & 0 & -\nu T/E + \end{bmatrix} +\end{aligned}$$ + + +## General isotropic form + +The general form of Hooke's law is a linear relationship +between the stress and strain tensors: + +$$\begin{aligned} + \boxed{ + \hat{\sigma} + = 2 \mu \: \hat{u} + \lambda \Tr(\hat{u}) \: \hat{1} + } +\end{aligned}$$ + +Where $\Tr{}$ is the trace. +This is often written in index notation, +with the Kronecker delta $\delta_{ij}$: + +$$\begin{aligned} + \boxed{ + \sigma_{ij} + = 2 \mu u_{ij} + \lambda \delta_{ij} \sum_{k} u_{kk} + } +\end{aligned}$$ + +The constants $\mu$ and $\lambda$ are called the **Lamé coefficients**, +and are related to $E$ and $\nu$ in a way we can derive +by returning to the example with a tension $T = F/A$ along $x$. +For $\sigma_{xx}$, we have: + +$$\begin{aligned} + T + = \sigma_{xx} + &= 2 \mu u_{xx} + \lambda (u_{xx} + u_{yy} + u_{zz}) + \\ + &= \frac{2 \mu}{E} T + \frac{\lambda}{E} T - \frac{\nu \lambda}{E} (T + T) + \\ + &= \frac{T}{E} \Big( 2 \mu + \lambda (1 - 2 \nu) \Big) +\end{aligned}$$ + +Meanwhile, the other diagonal stresses $\sigma_{yy} = \sigma_{zz}$ +are expressed in terms of the strain like so: + +$$\begin{aligned} + 0 + = \sigma_{yy} + &= 2 \mu u_{yy} + \lambda (u_{xx} + u_{yy} + u_{zz}) + \\ + &= - \frac{2 \nu \mu}{E} T + \frac{\lambda}{E} T - \frac{\nu \lambda}{E} (T + T) + \\ + &= \frac{E}{T} \Big( \!-\! 2 \nu \mu + \lambda (1 - 2 \nu) \Big) +\end{aligned}$$ + +After dividing out superfluous factors from the two preceding equations, +we arrive at: + +$$\begin{aligned} + E + = 2 \mu + \lambda (1 - 2 \nu) + \qquad \quad + 2 \nu \mu + = \lambda (1 - 2 \nu) +\end{aligned}$$ + +Solving this system of equations for the Lamé coefficients +yields the following result: + +$$\begin{aligned} + \boxed{ + \lambda + = \frac{E \nu}{(1 - 2 \nu)(1 + \nu)} + \qquad \quad + \mu + = \frac{E}{2 (1 + \nu)} + } +\end{aligned}$$ + +Which can straightforwardly be inverted +to express $E$ and $\nu$ as a function of $\mu$ and $\lambda$: + +$$\begin{aligned} + \boxed{ + E + = \mu \frac{3 \lambda + 2 \mu}{\lambda + \mu} + \qquad \quad + \nu + = \frac{\lambda}{2 (\lambda + \mu)} + } +\end{aligned}$$ + +Hooke's law itself can also be inverted, +i.e. we can express the strain as a function of stress. +First, observe that the trace of the stress tensor satisfies: + +$$\begin{aligned} + \Tr(\hat{\sigma}) + = \sum_{i} \sigma_{ii} + = 2 \mu \sum_{i} u_{ii} + \lambda \sum_{i} \sum_{k} u_{kk} + = (2 \mu + 3 \lambda) \sum_{i} u_{ii} +\end{aligned}$$ + +Inserting this into Hooke's law +yields an equation that only contains one strain component $u_{ij}$: + +$$\begin{aligned} + \sigma_{ij} + = 2 \mu u_{ij} + \frac{\lambda}{2 \mu + 3 \lambda} \delta_{ij} \sum_{k} \sigma_{kk} +\end{aligned}$$ + +Which is therefore trivial to isolate for $u_{ij}$, +leading us to Hooke's inverted law: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + u_{ij} + &= \frac{\sigma_{ij}}{2 \mu} - \frac{\lambda}{2 \mu (3 \lambda + 2 \mu)} \delta_{ij} \sum_{k} \sigma_{kk} + \\ + &= \frac{1 + \nu}{E} \sigma_{ij} - \frac{\nu}{E} \delta_{ij} \sum_{k} \sigma_{kk} + \end{aligned} + } +\end{aligned}$$ + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/hydrostatic-pressure/index.md b/source/know/concept/hydrostatic-pressure/index.md new file mode 100644 index 0000000..4add09e --- /dev/null +++ b/source/know/concept/hydrostatic-pressure/index.md @@ -0,0 +1,211 @@ +--- +title: "Hydrostatic pressure" +date: 2021-03-12 +categories: +- Physics +- Fluid mechanics +- Fluid statics +layout: "concept" +--- + +The pressure $p$ inside a fluid at rest, +the so-called **hydrostatic pressure**, +is an important quantity. +Here we will properly define it, +and derive the equilibrium condition for the fluid to be at rest, +both with and without an arbitrary gravity field. + + +## Without gravity + +Inside the fluid, we can imagine small arbitrary partition surfaces, +with normal vector $\vu{n}$ and area $\dd{S}$, +yielding the following vector element $\dd{\va{S}}$: + +$$\begin{aligned} + \dd{\va{S}} + = \vu{n} \dd{S} +\end{aligned}$$ + +The orientation of these surfaces does not matter. +The **pressure** $p(\va{r})$ is defined as the force-per-area +of these tiny surface elements: + +$$\begin{aligned} + \dd{\va{F}} + = - p(\va{r}) \dd{\va{S}} +\end{aligned}$$ + +The negative sign is there because a positive pressure is conventionally defined +to push from the positive (normal) side of $\dd{\va{S}}$ to the negative side. +The total force $\va{F}$ on a larger surface inside the fluid is +then given by the surface integral over many adjacent $\dd{\va{S}}$: + +$$\begin{aligned} + \va{F} + = - \int_S p(\va{r}) \dd{\va{S}} +\end{aligned}$$ + +If we now consider a *closed* surface, +which encloses a "blob" of the fluid, +then we can use the divergence theorem to get a volume integral: + +$$\begin{aligned} + \va{F} + = - \oint_S p \dd{\va{S}} + = - \int_V \nabla p \dd{V} +\end{aligned}$$ + +Since the total force on the blob is simply the sum of the forces $\dd{\va{F}}$ +on all its constituent volume elements $\dd{V}$, +we arrive at the following relation: + +$$\begin{aligned} + \boxed{ + \dd{\va{F}} + = - \nabla p \dd{V} + } +\end{aligned}$$ + +If the fluid is at rest, then all forces on the blob cancel out +(otherwise it would move). +Since we are currently neglecting all forces other than pressure, +this is equivalent to demanding that $\dd{\va{F}} = 0$, +which implies that $\nabla p = 0$, i.e. the pressure is constant. + +$$\begin{aligned} + \boxed{ + \nabla p = 0 + } +\end{aligned}$$ + + +## With gravity + +If we include gravity, then, +in addition to the pressure's *contact force* $\va{F}_p$ from earlier, +there is also a *body force* $\va{F}_g$ acting on +the arbitrary blob $V$ of fluid enclosed by $S$: + +$$\begin{aligned} + \va{F}_g + = \int_V \rho \va{g} \dd{V} +\end{aligned}$$ + +Where $\rho$ is the fluid's density (which need not be constant) +and $\va{g}$ is the gravity field given in units of force-per-mass. +For a fluid at rest, these forces must cancel out: + +$$\begin{aligned} + \va{F} + = \va{F}_g + \va{F}_p + = \int_V \rho \va{g} - \nabla p \dd{V} + = 0 +\end{aligned}$$ + +Since this a single integral over an arbitrary volume, +it implies that every point of the fluid must +locally satisfy the following equilibrium condition: + +$$\begin{aligned} + \boxed{ + \nabla p + = \rho \va{g} + } +\end{aligned}$$ + +On Earth (or another body with strong gravity), +it is reasonable to treat $\va{g}$ as only pointing in the downward $z$-direction, +in which case the above condition turns into: + +$$\begin{aligned} + p + = \rho g_0 z +\end{aligned}$$ + +Where $g_0$ is the magnitude of the $z$-component of $\va{g}$. +We can generalize the equilibrium condition by treating +the gravity field as the gradient of the gravitational potential $\Phi$: + +$$\begin{aligned} + \va{g}(\va{r}) + = - \nabla \Phi(\va{r}) +\end{aligned}$$ + +With this, the equilibrium condition is turned into the following equation: + +$$\begin{aligned} + \boxed{ + \nabla \Phi + \frac{\nabla p}{\rho} + = 0 + } +\end{aligned}$$ + +In practice, the density $\rho$ of the fluid +may be a function of the pressure $p$ (compressibility) +and/or temperature $T$ (thermal expansion). +We will tackle the first complication, but neglect the second, +i.e. we assume that the temperature is equal across the fluid. + +We then define the **pressure potential** $w(p)$ as +the indefinite integral of the density: + +$$\begin{aligned} + w(p) + \equiv \int \frac{1}{\rho(p)} \dd{p} +\end{aligned}$$ + +Using this, we can rewrite the equilibrium condition as a single gradient like so: + +$$\begin{aligned} + 0 + = \nabla \Phi + \frac{\nabla p}{\rho} + = \nabla \Phi + \dv{w}{p} \nabla p + = \nabla \Big( \Phi + w(p) \Big) +\end{aligned}$$ + +From this, let us now define the +**effective gravitational potential** $\Phi^*$ as follows: + +$$\begin{aligned} + \Phi^* \equiv \Phi + w(p) +\end{aligned}$$ + +This results in the cleanest form yet of the equilibrium condition, namely: + +$$\begin{aligned} + \boxed{ + \nabla \Phi^* + = 0 + } +\end{aligned}$$ + +At every point in the fluid, despite $p$ being variable, +the force that is applied by the pressure must have the same magnitude in all directions at that point. +This statement is known as **Pascal's law**, +and is due to the fact that all forces must cancel out +for an arbitrary blob: + +$$\begin{aligned} + \va{F} + = \va{F}_g + \va{F}_p + = 0 +\end{aligned}$$ + +Let the blob be a cube with side $a$. +Now, $\va{F}_p$ is a contact force, +meaning it acts on the surface, and is thus proportional to $a^2$, +however, $\va{F}_g$ is a body force, +meaning it acts on the volume, and is thus proportional to $a^3$. +Since we are considering a *point* in the fluid, +$a$ is infinitesimally small, +so that $\va{F}_p$ dominates $\va{F}_g$. +Consequently, at equilibrium, $\va{F}_p$ must cancel out by itself, +which means that the pressure is the same in all directions. + + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/imaginary-time/index.md b/source/know/concept/imaginary-time/index.md new file mode 100644 index 0000000..5dc9264 --- /dev/null +++ b/source/know/concept/imaginary-time/index.md @@ -0,0 +1,173 @@ +--- +title: "Imaginary time" +date: 2021-11-11 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +Let $\hat{A}_S$ and $\hat{B}_S$ be time-independent in the Schrödinger picture. +Then, in the [Heisenberg picture](/know/concept/heisenberg-picture/), +consider the following expectation value +with respect to thermodynamic equilibium +(as found in [Green's functions](/know/concept/greens-functions/) for example): + +$$\begin{aligned} + \expval{\hat{A}_H(t) \hat{B}_H(t')} + &= \frac{1}{Z} \Tr\!\Big( \exp(-\beta \hat{H}_{0,S}(t)) \: \hat{A}_H(t) \: \hat{B}_H(t') \Big) +\end{aligned}$$ + +Where the "simple" Hamiltonian $\hat{H}_{0,S}$ is time-independent. +Suppose a (maybe time-dependent) "difficult" $\hat{H}_{1,S}$ is added, +so that the total Hamiltonian is $\hat{H}_S = \hat{H}_{0,S} + \hat{H}_{1,S}$. +Then it is easier to consider the expectation value +in the [interaction picture](/know/concept/interaction-picture/): + +$$\begin{aligned} + \expval{\hat{A}_H(t) \hat{B}_H(t')} + &= \frac{1}{Z} \Tr\!\Big( \exp(-\beta \hat{H}_S(t)) \: \hat{K}_I(0, t) \hat{A}_I(t) \hat{K}_I(t, t') \hat{B}_I(t') \hat{K}_I(t', 0) \Big) +\end{aligned}$$ + +Where $\hat{K}_I(t, t_0)$ is the time evolution operator of $\hat{H}_{1,S}$. +In front, we have $\exp(-\beta \hat{H}_S(t))$, +while $\hat{K}_I$ is an exponential of an integral of $\hat{H}_{1,I}$, so we are stuck. +Keep in mind that exponentials of operators +cannot just be factorized, i.e. in general +$\exp(\hat{A} \!+\! \hat{B}) \neq \exp(\hat{A}) \exp(\hat{B})$ + +To get around this, a useful mathematical trick is +to use an **imaginary time** variable $\tau$ instead of the real time $t$. +Fixing a $t$, we "redefine" the interaction picture along the imaginary axis: + +$$\begin{aligned} + \boxed{ + \hat{A}_I(\tau) + \equiv \exp\!\bigg(\frac{\tau \hat{H}_{0,S}}{\hbar}\bigg) \: \hat{A}_S \: \exp\!\bigg( \!-\! \frac{\tau \hat{H}_{0,S}}{\hbar}\bigg) + } +\end{aligned}$$ + +Ironically, $\tau$ is real; the point is that this formula +comes from the real-time definition by replacing $t \to -i \tau$. +The Heisenberg and Schrödinger pictures can be redefined in the same way. + +In fact, by substituting $t \to -i \tau$, +all the key results of the interaction picture can be updated, +for example the Schrödinger equation for $\Ket{\psi_S(\tau)}$ becomes: + +$$\begin{aligned} + \hbar \dv{}{t}\Ket{\psi_S(\tau)} + = - \hat{H}_S \Ket{\psi_S(\tau)} + \quad \implies \quad + \Ket{\psi_S(\tau)} + = \exp\!\bigg( \!-\! \frac{\tau \hat{H}_S}{\hbar} \bigg) \Ket{\psi_H} +\end{aligned}$$ + +And the interaction picture's time evolution operator $\hat{K}_I$ +turns out to be given by: + +$$\begin{aligned} + \boxed{ + \hat{K}_I(\tau, \tau_0) + = \mathcal{T} \bigg\{ \exp\!\bigg( \!-\! \frac{1}{\hbar} \int_{\tau_0}^\tau \hat{H}_{1,I}(\tau') \dd{\tau'} \bigg) \bigg\} + } +\end{aligned}$$ + +Where $\mathcal{T}$ is the +[time-ordered product](/know/concept/time-ordered-product/) +with respect to $\tau$. +This operator works as expected: + +$$\begin{aligned} + \Ket{\psi_I(\tau)} + = \hat{K}_I(\tau, \tau_0) \Ket{\psi_I(\tau_0)} +\end{aligned}$$ + +Where $\Ket{\psi_I(\tau)}$ is related to +the Schrödinger and Heisenberg pictures as follows: + +$$\begin{aligned} + \Ket{\psi_I(\tau)} + \equiv \exp\!\bigg(\frac{\tau \hat{H}_{0,S}}{\hbar}\bigg) \Ket{\psi_S(\tau)} + = \exp\!\bigg(\frac{\tau \hat{H}_{0,S}}{\hbar}\bigg) \exp\!\bigg( \!-\! \frac{\tau \hat{H}_S}{\hbar}\bigg) \Ket{\psi_H} +\end{aligned}$$ + +It is interesting to combine this definition +with the action of time evolution $\hat{K}_I(\tau, \tau_0)$: + +$$\begin{aligned} + \Ket{\psi_I(\tau)} + &= \hat{K}_I(\tau, \tau_0) \Ket{\psi_I(\tau_0)} + \\ + \exp\!\bigg(\frac{\tau \hat{H}_{0,S}}{\hbar}\bigg) \exp\!\bigg( \!-\! \frac{\tau \hat{H}_S}{\hbar}\bigg) \Ket{\psi_H} + &= \hat{K}_I(\tau, \tau_0) \exp\!\bigg(\frac{\tau_0 \hat{H}_{0,S}}{\hbar}\bigg) \exp\!\bigg( \!-\! \frac{\tau_0 \hat{H}_S}{\hbar}\bigg) \Ket{\psi_H} +\end{aligned}$$ + +Rearranging this leads to the following useful +alternative expression for $\hat{K}_I(\tau, \tau_0)$: + +$$\begin{aligned} + \boxed{ + \hat{K}_I(\tau, \tau_0) + = \exp\!\bigg(\frac{\tau \hat{H}_{0,S}}{\hbar}\bigg) + \exp\!\bigg(\!-\! \frac{(\tau \!-\! \tau_0) \hat{H}_{S}}{\hbar}\bigg) + \exp\!\bigg(\!-\! \frac{\tau_0 \hat{H}_{0,S}}{\hbar}\bigg) + } +\end{aligned}$$ + +Returning to our initial example, +we can set $\tau = \hbar \beta$ and $\tau_0 = 0$, +so $\hat{K}_I(\tau, \tau_0)$ becomes: + +$$\begin{aligned} + \hat{K}_I(\hbar \beta, 0) + &= \exp\!\big(\beta \hat{H}_{0,S}\big) \exp\!\big(\!-\! \beta \hat{H}_{S}\big) + \\ + \implies \quad + \exp\!\big(\!-\! \beta \hat{H}_{S}\big) + &= \exp\!\big(\!-\! \beta \hat{H}_{0,S}\big) \hat{K}_I(\hbar \beta, 0) +\end{aligned}$$ + +Using the easily-shown fact that +$\hat{K}_I(\hbar \beta, 0) \hat{K}_I(0, \tau) = \hat{K}_I(\hbar \beta, \tau)$, +we can therefore rewrite the thermodynamic expectation value like so: + +$$\begin{aligned} + \expval{\hat{A}_H(\tau) \hat{B}_H(\tau')} + &= \frac{1}{Z} \Tr\!\Big(\! \exp(-\beta \hat{H}_{0,S}) \hat{K}_I(\hbar \beta, \tau) + \hat{A}_I(\tau) \hat{K}_I(\tau, \tau') \hat{B}_I(\tau') \hat{K}_I(\tau', 0) \!\Big) +\end{aligned}$$ + +We now introduce a time-ordering $\mathcal{T}$, +letting us reorder the (bosonic) $\hat{K}_I$-operators inside, +and thereby reduce the expression considerably: + +$$\begin{aligned} + \Expval{\mathcal{T}\Big\{\hat{A}_H \hat{B}_H\Big\}} + &= \frac{1}{Z} \Tr\!\Big( \mathcal{T} \Big\{ \hat{K}_I(\hbar \beta, \tau) \hat{K}_I(\tau, \tau') \hat{K}_I(\tau', 0) + \hat{A}_I(\tau) \hat{B}_I(\tau') \Big\} \exp(-\beta \hat{H}_{0,S}) \Big) + \\ + &= \frac{1}{Z} \Tr\!\Big( \mathcal{T}\Big\{ \hat{K}_I(\hbar \beta, 0) \hat{A}_I(\tau) \hat{B}_I(\tau') \Big\} \exp(-\beta \hat{H}_{0,S}) \Big) +\end{aligned}$$ + +Where $Z = \Tr\!\big(\exp(-\beta \hat{H}_S)\big) = \Tr\!\big(\hat{K}_I(\hbar \beta, 0) \exp(-\beta \hat{H}_{0,S})\big)$. +If we now define $\Expval{}_0$ as the expectation value with respect +to the unperturbed equilibrium involving only $\hat{H}_{0,S}$, +we arrive at the following way of writing this time-ordered expectation: + +$$\begin{aligned} + \boxed{ + \Expval{\mathcal{T}\Big\{\hat{A}_H \hat{B}_H\Big\}} + = \frac{\Expval{\mathcal{T}\Big\{ \hat{K}_I(\hbar \beta, 0) \hat{A}_I(\tau) \hat{B}_I(\tau') \Big\}}_0}{\Expval{\hat{K}_I(\hbar \beta, 0)}_0} + } +\end{aligned}$$ + +For another application of imaginary time, +see e.g. the [Matsubara Green's function](/know/concept/matsubara-greens-function/). + + + +## References +1. H. Bruus, K. Flensberg, + *Many-body quantum theory in condensed matter physics*, + 2016, Oxford. diff --git a/source/know/concept/impulse-response/index.md b/source/know/concept/impulse-response/index.md new file mode 100644 index 0000000..65849aa --- /dev/null +++ b/source/know/concept/impulse-response/index.md @@ -0,0 +1,81 @@ +--- +title: "Impulse response" +date: 2021-03-09 +categories: +- Mathematics +- Physics +layout: "concept" +--- + +The **impulse response** $u_p(t)$ of a system whose behaviour is described +by a linear operator $\hat{L}$, is defined as the reponse of the system +when forced by the [Dirac delta function](/know/concept/dirac-delta-function/) $\delta(t)$: + +$$\begin{aligned} + \boxed{ + \hat{L} \{ u_p(t) \} = \delta(t) + } +\end{aligned}$$ + +This can be used to find the response $u(t)$ of $\hat{L}$ to +*any* forcing function $f(t)$, i.e. not only $\delta(t)$, +by simply taking the convolution with $u_p(t)$: + +$$\begin{aligned} + \hat{L} \{ u(t) \} = f(t) + \quad \implies \quad + \boxed{ + u(t) = (f * u_p)(t) + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-main"/> +<label for="proof-main">Proof</label> +<div class="hidden"> +<label for="proof-main">Proof.</label> +Starting from the definition of $u_p(t)$, +we shift the argument by some constant $\tau$, +and multiply both sides by the constant $f(\tau)$: + +$$\begin{aligned} + \hat{L} \{ u_p(t - \tau) \} &= \delta(t - \tau) + \\ + \hat{L} \{ f(\tau) \: u_p(t - \tau) \} &= f(\tau) \: \delta(t - \tau) +\end{aligned}$$ + +Where $f(\tau)$ can be moved inside using the +linearity of $\hat{L}$. Integrating over $\tau$ then gives us: + +$$\begin{aligned} + \int_0^\infty \hat{L} \{ f(\tau) \: u_p(t - \tau) \} \dd{\tau} + &= \int_0^\infty f(\tau) \: \delta(t - \tau) \dd{\tau} + = f(t) +\end{aligned}$$ + +The integral and $\hat{L}$ are operators of different variables, so we reorder them: + +$$\begin{aligned} + \hat{L} \int_0^\infty f(\tau) \: u_p(t - \tau) \dd{\tau} + &= (f * u_p)(t) = \hat{L}\{ u(t) \} = f(t) +\end{aligned}$$ +</div> +</div> + +This is useful for solving initial value problems, +because any initial condition can be satisfied +due to the linearity of $\hat{L}$, +by choosing the initial values of the homogeneous solution $\hat{L}\{ u_h(t) \} = 0$ +such that the total solution $(f * u_p)(t) + u_h(t)$ +has the desired values. + +Meanwhile, for boundary value problems, +the related [fundamental solution](/know/concept/fundamental-solution/) +is preferable. + + + +## References +1. O. Bang, + *Applied mathematics for physicists: lecture notes*, 2019, + unpublished. diff --git a/source/know/concept/index.md b/source/know/concept/index.md new file mode 100644 index 0000000..69b8ca9 --- /dev/null +++ b/source/know/concept/index.md @@ -0,0 +1,33 @@ +--- +title: "List of concepts" +date: 2021-02-22 +layout: "default" +--- + +# List of concepts + +{% assign by_letter = site.pages + | where_exp: "item", "item.layout == 'concept'" + | group_by_exp: "item", "item.title | truncate: 1, ''" + | sort: "name" +%} + +This is an alphabetical list of the concepts in this knowledge base. + +<div style="text-align: center;"> +‐ +{% for letter in by_letter %} +<a href="#{{ letter.name }}">{{ letter.name }}</a> +‐ +{% endfor %} +</div> + +{% for letter in by_letter %} +<h2 id="{{ letter.name }}">{{ letter.name }}</h2> +<ul> + {% assign items = letter.items | sort: "title" %} + {% for item in items %} + <li><a href="{{ item.url }}">{{ item.title }}</a></li> + {% endfor %} +</ul> +{% endfor %} diff --git a/source/know/concept/interaction-picture/index.md b/source/know/concept/interaction-picture/index.md new file mode 100644 index 0000000..3912b46 --- /dev/null +++ b/source/know/concept/interaction-picture/index.md @@ -0,0 +1,211 @@ +--- +title: "Interaction picture" +date: 2021-09-13 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +The **interaction picture** or **Dirac picture** +is an alternative formulation of quantum mechanics, +equivalent to both the Schrödinger picture +and the [Heisenberg picture](/know/concept/heisenberg-picture/). + +Recall that Schrödinger lets states $\Ket{\psi_S(t)}$ evolve in time, +but keeps operators $\hat{L}_S$ fixed (except for explicit time dependence). +Meanwhile, Heisenberg keeps states $\Ket{\psi_H}$ fixed, +and puts all time dependence on the operators $\hat{L}_H(t)$. + +However, in the interaction picture, +both the states $\Ket{\psi_I(t)}$ and the operators $\hat{L}_I(t)$ +evolve in $t$. +This might seem unnecessarily complicated, +but it turns out be convenient when considering +a time-dependent "perturbation" $\hat{H}_{1,S}$ +to a time-independent Hamiltonian $\hat{H}_{0,S}$: + +$$\begin{aligned} + \hat{H}_S(t) + = \hat{H}_{0,S} + \hat{H}_{1,S}(t) +\end{aligned}$$ + +With $\hat{H}_S(t)$ the full Schrödinger Hamiltonian. +We define the unitary conversion operator: + +$$\begin{aligned} + \boxed{ + \hat{U}(t) + \equiv \exp\!\bigg( i \frac{\hat{H}_{0,S} t}{\hbar} \bigg) + } +\end{aligned}$$ + +The interaction-picture states $\Ket{\psi_I(t)}$ and operators $\hat{L}_I(t)$ +are then defined to be: + +$$\begin{aligned} + \boxed{ + \Ket{\psi_I(t)} + \equiv \hat{U}(t) \Ket{\psi_S(t)} + \qquad + \hat{L}_I(t) + \equiv \hat{U}(t) \: \hat{L}_S(t) \: \hat{U}{}^\dagger(t) + } +\end{aligned}$$ + + +## Equations of motion + +To find the equation of motion for $\Ket{\psi_I(t)}$, +we differentiate it and multiply by $i \hbar$: + +$$\begin{aligned} + i \hbar \dv{}{t}\Ket{\psi_I} + &= i \hbar \Big( \dv{\hat{U}}{t} \Ket{\psi_S} + \hat{U} \dv{}{t}\Ket{\psi_S} \Big) + \\ + &= i \hbar \Big( i \frac{\hat{H}_{0,S}}{\hbar} \Big) \hat{U} \Ket{\psi_S} + \hat{U} \Big( i \hbar \dv{}{t}\Ket{\psi_S} \Big) +\end{aligned}$$ + +We insert the Schrödinger equation into the second term, +and use $\comm{\hat{U}}{\hat{H}_{0,S}} = 0$: + +$$\begin{aligned} + i \hbar \dv{}{t}\Ket{\psi_I} + &= - \hat{H}_{0,S} \hat{U} \Ket{\psi_S} + \hat{U} \hat{H}_S \Ket{\psi_S} + \\ + &= \hat{U} \big( \!-\! \hat{H}_{0,S} + \hat{H}_S \big) \Ket{\psi_S} + \\ + &= \hat{U} \big( \hat{H}_{1,S} \big) \hat{U}{}^\dagger \hat{U} \Ket{\psi_S} +\end{aligned}$$ + +Which leads to an analogue of the Schrödinger equation, +with $\hat{H}_{1,I} = \hat{U} \hat{H}_{1,S} \hat{U}{}^\dagger$: + +$$\begin{aligned} + \boxed{ + i \hbar \dv{}{t}\Ket{\psi_I(t)} + = \hat{H}_{1,I}(t) \Ket{\psi_I(t)} + } +\end{aligned}$$ + +Next, we do the same with an operator $\hat{L}_I$ +to find a description of its evolution in time: + +$$\begin{aligned} + \dv{}{t}\hat{L}_I + &= \dv{\hat{U}}{t} \hat{L}_S \hat{U}{}^\dagger + \hat{U} \hat{L}_S \dv{\hat{U}{}^\dagger}{t} + \hat{U} \dv{\hat{L}_S}{t} \hat{U}{}^\dagger + \\ + &= \frac{i}{\hbar} \hat{U} \hat{H}_{0,S} \big( \hat{U}{}^\dagger \hat{U} \big) \hat{L}_S \hat{U}{}^\dagger + - \frac{i}{\hbar} \hat{U} \hat{L}_S \big( \hat{U}{}^\dagger \hat{U} \big) \hat{H}_{0,S} \hat{U}{}^\dagger + + \Big( \dv{\hat{L}_S}{t} \Big)_I + \\ + &= \frac{i}{\hbar} \hat{H}_{0,I} \hat{L}_I + - \frac{i}{\hbar} \hat{L}_I \hat{H}_{0,I} + + \Big( \dv{\hat{L}_S}{t} \Big)_I + = \frac{i}{\hbar} \comm{\hat{H}_{0,I}}{\hat{L}_I} + \Big( \dv{\hat{L}_S}{t} \Big)_I +\end{aligned}$$ + +The result is analogous to the equation of motion in the Heisenberg picture: + +$$\begin{aligned} + \boxed{ + \dv{}{t}\hat{L}_I(t) + = \frac{i}{\hbar} \comm{\hat{H}_{0,I}(t)}{\hat{L}_I(t)} + \Big( \dv{}{t}\hat{L}_S(t) \Big)_I + } +\end{aligned}$$ + + +## Time evolution operator + +Recall that an alternative form of the Schrödinger equation is as follows, +where a **time evolution operator** or +**generator of translations in time** $K_S(t, t_0)$ +brings $\Ket{\psi_S}$ from time $t_0$ to $t$: + +$$\begin{aligned} + \Ket{\psi_S(t)} + = \hat{K}_S(t, t_0) \Ket{\psi_S(t_0)} + \qquad \quad + \hat{K}_S(t, t_0) + \equiv \exp\!\Big( \!-\! i \frac{\hat{H}_S (t - t_0)}{\hbar} \Big) +\end{aligned}$$ + +We want to find an analogous operator in the interaction picture, satisfying: + +$$\begin{aligned} + \Ket{\psi_I(t)} + \equiv \hat{K}_I(t, t_0) \Ket{\psi_I(t_0)} +\end{aligned}$$ + +Inserting this definition into the equation of motion for $\Ket{\psi_I}$ yields +an equation for $\hat{K}_I$, with the logical boundary condition $\hat{K}_I(t_0, t_0) = 1$: + +$$\begin{aligned} + i \hbar \dv{}{t}\Big( \hat{K}_I(t, t_0) \Ket{\psi_I(t_0)} \Big) + &= \hat{H}_{1,I}(t) \Big( \hat{K}_I(t, t_0) \Ket{\psi_I(t_0)} \Big) + \\ + i \hbar \dv{}{t}\hat{K}_I(t, t_0) + &= \hat{H}_{1,I}(t) \hat{K}_I(t, t_0) +\end{aligned}$$ + +We turn this into an integral equation +by integrating both sides from $t_0$ to $t$: + +$$\begin{aligned} + i \hbar \int_{t_0}^t \dv{}{t'}K_I(t', t_0) \dd{t'} + = \int_{t_0}^t \hat{H}_{1,I}(t') \hat{K}_I(t', t_0) \dd{t'} +\end{aligned}$$ + +After evaluating the left integral, +we see an expression for $\hat{K}_I$ as a function of $\hat{K}_I$ itself: + +$$\begin{aligned} + K_I(t, t_0) + = 1 + \frac{1}{i \hbar} \int_{t_0}^t \hat{H}_{1,I}(t') \hat{K}_I(t', t_0) \dd{t'} +\end{aligned}$$ + +By recursively inserting $\hat{K}_I$ once, we get a longer expression, +still with $\hat{K}_I$ on both sides: + +$$\begin{aligned} + K_I(t, t_0) + = 1 + \frac{1}{i \hbar} \int_{t_0}^t \hat{H}_{1,I}(t') \dd{t'} + + \frac{1}{(i \hbar)^2} \int_{t_0}^t \hat{H}_{1,I}(t') \int_{t_0}^{t'} \hat{H}_{1,I}(t'') \hat{K}_I(t'', t_0) \dd{t''} \dd{t'} +\end{aligned}$$ + +And so on. Note the ordering of the integrals and integrands: +upon closer inspection, we see that the $n$th term is +a [time-ordered product](/know/concept/time-ordered-product/) $\mathcal{T}$ +of $n$ factors $\hat{H}_{1,I}$: + +$$\begin{aligned} + \hat{K}_I(t, t_0) + &= 1 + \int_{t_0}^t \hat{H}_{1,I}(t_1) \dd{t_1} + + \frac{1}{2} \int_{t_0}^{t} \int_{t_0}^{t_1} \mathcal{T} \Big\{ \hat{H}_{1,I}(t_1) \hat{H}_{1,I}(t_2) \Big\} \dd{t_1} \dd{t_2} + + \: ... + \\ + &= 1 + \sum_{n = 1}^\infty \frac{1}{n!} \frac{1}{(i \hbar)^n} + \int_{t_0}^{t} \cdots \int_{t_0}^{t_n} \mathcal{T} \Big\{ \hat{H}_{1,I}(t_1) \cdots \hat{H}_{1,I}(t_n) \Big\} \dd{t_1} \cdots \dd{t_n} + \\ + &= \sum_{n = 0}^\infty \frac{1}{n!} \frac{1}{(i \hbar)^n} + \mathcal{T} \bigg\{ \bigg( \int_{t_0}^{t} \hat{H}_{1,I}(t') \dd{t'} \bigg)^n \bigg\} +\end{aligned}$$ + +This construction is occasionally called the **Dyson series**. +We recognize the well-known Taylor expansion of $\exp(x)$, +leading us to a final expression for $\hat{K}_I$: + +$$\begin{aligned} + \boxed{ + \hat{K}_I(t, t_0) + = \mathcal{T} \bigg\{ \exp\!\bigg( \frac{1}{i \hbar} \int_{t_0}^t \hat{H}_{1,I}(t') \dd{t'} \bigg) \bigg\} + } +\end{aligned}$$ + + + +## References +1. H. Bruus, K. Flensberg, + *Many-body quantum theory in condensed matter physics*, + 2016, Oxford. + diff --git a/source/know/concept/ion-sound-wave/index.md b/source/know/concept/ion-sound-wave/index.md new file mode 100644 index 0000000..48a727d --- /dev/null +++ b/source/know/concept/ion-sound-wave/index.md @@ -0,0 +1,261 @@ +--- +title: "Ion sound wave" +date: 2021-10-31 +categories: +- Physics +- Plasma physics +- Plasma waves +- Perturbation +layout: "concept" +--- + +In a plasma, electromagnetic interactions allow +compressional longitudinal waves to propagate +at lower temperatures and pressures +than would be possible in a neutral gas. + +We start from the [two-fluid model's](/know/concept/two-fluid-equations/) momentum equations, +rewriting the [electric field](/know/concept/electric-field/) $\vb{E} = - \nabla \phi$ +and the pressure gradient $\nabla p = \gamma k_B T \nabla n$, +and arguing that $m_e \approx 0$ because $m_e \ll m_i$: + +$$\begin{aligned} + m_i n_i \frac{\mathrm{D} \vb{u}_i}{\mathrm{D} t} + &= - q_i n_i \nabla \phi - \gamma_i k_B T_i \nabla n_i + \\ + 0 + &= - q_e n_e \nabla \phi - \gamma_e k_B T_e \nabla n_e +\end{aligned}$$ + +Note that we neglect ion-electron collisions, +and allow for separate values of $\gamma$. +We split $n_i$, $n_e$, $\vb{u}_i$ and $\phi$ into an equilibrium +(subscript $0$) and a perturbation (subscript $1$): + +$$\begin{aligned} + n_i + = n_{i0} + n_{i1} + \qquad + n_e + = n_{e0} + n_{e1} + \qquad + \vb{u}_i + = \vb{u}_{i0} + \vb{u}_{i1} + \qquad + \phi + = \phi_0 + \phi_1 +\end{aligned}$$ + +Where the perturbations $n_{i1}$, $n_{e1}$, $\vb{u}_{i1}$ and $\phi_1$ are tiny, +and the equilibrium components $n_{i0}$, $n_{e0}$, $\vb{u}_{i0}$ and $\phi_0$ +by definition satisfy: + +$$\begin{aligned} + \pdv{n_{i0}}{t} = 0 + \qquad + \frac{\mathrm{D} \vb{u}_{i0}}{\mathrm{D} t} = 0 + \qquad + \nabla n_{i0} = \nabla n_{e0} = 0 + \qquad + \vb{u}_{i0} = 0 + \qquad + \phi_0 = 0 +\end{aligned}$$ + +Inserting this decomposition into the momentum equations +yields new equations. +Note that we will implicitly use $\vb{u}_{i0} = 0$ +to pretend that the [material derivative](/know/concept/material-derivative/) +$\mathrm{D}/\mathrm{D} t$ is linear: + +$$\begin{aligned} + m_i (n_{i0} \!+\! n_{i1}) \frac{\mathrm{D} (\vb{u}_{i0} \!+\! \vb{u}_{i1})}{\mathrm{D} t} + &= - q_i (n_{i0} \!+\! n_{i1}) \nabla (\phi_0 \!+\! \phi_1) - \gamma_i k_B T_i \nabla (n_{i0} \!+\! n_{i1}) + \\ + 0 + &= - q_e (n_{e0} \!+\! n_{e1}) \nabla (\phi_0 \!+\! \phi_1) - \gamma_e k_B T_e \nabla (n_{e0} \!+\! n_{e1}) +\end{aligned}$$ + +Using the defined properties of the equilibrium components +$n_{i0}$, $n_{e0}$, $\vb{u}_{i0}$ and $\phi_0$, +and neglecting all products of perturbations for being small, +this reduces to: + +$$\begin{aligned} + m_i n_{i0} \pdv{\vb{u}_{i1}}{t} + &= - q_i n_{i0} \nabla \phi_1 - \gamma_i k_B T_i \nabla n_{i1} + \\ + 0 + &= - q_e n_{e0} \nabla \phi_1 - \gamma_e k_B T_e \nabla n_{e1} +\end{aligned}$$ + +Because we are interested in linear waves, +we make the following plane-wave ansatz: + +$$\begin{aligned} + n_{i1}(\vb{r}, t) + &= n_{i1} \exp\!(i \vb{k} \cdot \vb{r} - i \omega t) + \\ + n_{e1}(\vb{r}, t) + &= n_{e1} \exp\!(i \vb{k} \cdot \vb{r} - i \omega t) + \\ + \vb{u}_{i1}(\vb{r}, t) + &= \vb{u}_{i1} \exp\!(i \vb{k} \cdot \vb{r} - i \omega t) + \\ + \phi_1(\vb{r}, t) + &= \phi_1 \,\,\exp\!(i \vb{k} \cdot \vb{r} - i \omega t) +\end{aligned}$$ + +Which we then insert into the momentum equations for the ions and electrons: + +$$\begin{aligned} + - i \omega m_i n_{i0} \vb{u}_{i1} + &= - i \vb{k} q_i n_{i0} \phi_1 - i \vb{k} \gamma_i k_B T_i n_{i1} + \\ + 0 + &= - i \vb{k} q_e n_{e0} \phi_1 - i \vb{k} \gamma_e k_B T_e n_{e1} +\end{aligned}$$ + +The electron equation can easily be rearranged +to get a relation between $n_{e1}$ and $n_{e0}$: + +$$\begin{aligned} + i \vb{k} \gamma_e k_B T_e n_{e1} + = - i \vb{k} q_e n_{e0} \phi_1 + \quad \implies \quad + n_{e1} + = - \frac{q_e \phi_1}{\gamma_e k_B T_e} n_{e0} +\end{aligned}$$ + +Due to their low mass, the electrons' heat conductivity +can be regarded as infinite compared to the ions'. +In that case, all electron gas compression is isothermal, +meaning it obeys the ideal gas law $p_e = n_e k_B T_e$, so that $\gamma_e = 1$. +Note that this yields the first-order term of a Taylor expansion +of the [Boltzmann relation](/know/concept/boltzmann-relation/). + +At equilibrium, quasi-neutrality demands that $n_{i0} = n_{e0} = n_0$, +so we can rearrange the above relation to $n_0 = - k_B T_e n_{e1} / (q_e \phi_1)$, +which we insert into the ion equation to get: + +$$\begin{gathered} + i \omega m_i \frac{k_B T_e n_{e1}}{q_e \phi_1} \vb{u}_{i1} + = - i q_i \frac{k_B T_e n_{e1}}{q_e \phi_1} \phi_1 \vb{k} - i \gamma_i k_B T_i n_{i1} \vb{k} + \\ + \implies \qquad + \omega m_i \frac{T_e n_{e1}}{q_e \phi_1} \vb{k} \cdot \vb{u}_{i1} + = T_e n_{e1} |\vb{k}|^2 - \gamma_i T_i n_{i1} |\vb{k}|^2 +\end{gathered}$$ + +Where we have taken the dot product with $\vb{k}$, +and used that $q_i / q_e = -1$. +In order to simplify this equation, +we turn to the two-fluid ion continuity relation: + +$$\begin{aligned} + 0 + &= \pdv{(n_{i0} \!+\! n_{i1})}{t} + \nabla \cdot \Big( (n_{i0} \!+\! n_{i1}) (\vb{u}_{i0} \!+\! \vb{u}_{i1}) \Big) + \approx \pdv{n_{i1}}{t} + n_{i0} \nabla \cdot \vb{u}_{i1} +\end{aligned}$$ + +Then we insert our plane-wave ansatz, +and substitute $n_{i0} = n_0$ as before, yielding: + +$$\begin{aligned} + 0 + = - i \omega n_{i1} + i n_{i0} \vb{k} \cdot \vb{u}_{i1} + \quad \implies \quad + \vb{k} \cdot \vb{u}_{i1} + = \omega \frac{n_{i1}}{n_{i0}} + = \omega \frac{q_e n_{i1} \phi_1}{k_B T_e n_{e1}} +\end{aligned}$$ + +Substituting this in the ion momentum equation +leads us to a dispersion relation $\omega(\vb{k})$: + +$$\begin{gathered} + \omega^2 m_i \frac{T_e n_{e1}}{q_e \phi_1} \frac{q_e n_{i1} \phi_1}{k_B T_e n_{e1}} + = \omega^2 m_i \frac{n_{i1}}{k_B} + = |\vb{k}|^2 \big( T_e n_{e1} - \gamma_i T_i n_{i1} \big) + \\ + \implies \qquad + \omega^2 + = \frac{|\vb{k}|^2}{m_i} \Big( k_B T_e \frac{n_{e1}}{n_{i1}} - \gamma_i k_B T_i \Big) +\end{gathered}$$ + +Finally, we would like to find an expression for $n_{e1} / n_{i1}$. +It cannot be $1$, because then $\phi_1$ could not be nonzero, +according to [Gauss' law](/know/concept/maxwells-equations/). +Nevertheless, authors often ignore this fact, +thereby making the so-called **plasma approximation**. +We will not, and therefore turn to Gauss' law: + +$$\begin{aligned} + \varepsilon_0 \nabla \cdot \vb{E} + = - \varepsilon_0 \nabla^2 \phi_1 + = q_i n_i - q_e n_e + = - q_e (n_{i1} - n_{e1}) +\end{aligned}$$ + +One final time, we insert our plane-wave ansatz, +and use our Boltzmann-like relation between $n_{e1}$ and $n_{e0}$ +to substitute $\phi_1 = - k_B T_e n_{e1} / (q_e n_{e0})$: + +$$\begin{gathered} + q_e (n_{e1} - n_{i1}) + = |\vb{k}|^2 \varepsilon_0 \phi_1 + = - |\vb{k}|^2 \varepsilon_0 \frac{k_B T_e n_{e1}}{q_e n_{e0}} + \\ + \implies \qquad + n_{i1} + = n_{e1} + |\vb{k}|^2 \varepsilon_0 \frac{k_B T_e n_{e1}}{q_e^2 n_{e0}} + = n_{e1} \big( 1 + |\vb{k}|^2 \lambda_{De}^2 \big) +\end{gathered}$$ + +Where $\lambda_{De}$ is the electron [Debye length](/know/concept/debye-length/). +We thus reach the following dispersion relation, +which governs **ion sound waves** or **ion acoustic waves**: + +$$\begin{aligned} + \boxed{ + \omega^2 + = \frac{|\vb{k}|^2}{m_i} \bigg( \frac{k_B T_e}{1 + |\vb{k}|^2 \lambda_{De}^2} + \gamma_i k_B T_i \bigg) + } +\end{aligned}$$ + +The aforementioned plasma approximation is valid if $|\vb{k}| \lambda_{De} \ll 1$, +which is often reasonable, +in which case this dispersion relation reduces to: + +$$\begin{aligned} + \omega^2 + = \frac{|\vb{k}|^2}{m_i} \bigg( k_B T_e + \gamma_i k_B T_i \bigg) +\end{aligned}$$ + +The phase velocity $v_s$ of these waves, +i.e. the speed of sound, is then given by: + +$$\begin{aligned} + \boxed{ + v_s + = \frac{\omega}{k} + = \sqrt{\frac{k_B T_e}{m_i} + \frac{\gamma_i k_B T_i}{m_i}} + } +\end{aligned}$$ + +Curiously, unlike a neutral gas, +this velocity is nonzero even if $T_i = 0$, +meaning that the waves still exist then. +In fact, usually the electron temperature $T_e$ dominates $T_e \gg T_i$, +even though the main feature of these waves +is that they involve ion density fluctuations $n_{i1}$. + + + +## References +1. F.F. Chen, + *Introduction to plasma physics and controlled fusion*, + 3rd edition, Springer. +2. M. Salewski, A.H. Nielsen, + *Plasma physics: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/ito-integral/index.md b/source/know/concept/ito-integral/index.md new file mode 100644 index 0000000..da3c706 --- /dev/null +++ b/source/know/concept/ito-integral/index.md @@ -0,0 +1,268 @@ +--- +title: "Itō integral" +date: 2021-11-06 +categories: +- Mathematics +- Stochastic analysis +layout: "concept" +--- + +The **Itō integral** offers a way to integrate +a given [stochastic process](/know/concept/stochastic-process/) $G_t$ +with respect to a [Wiener process](/know/concept/wiener-process/) $B_t$, +which is also a stochastic process. +The Itō integral $I_t$ of $G_t$ is defined as follows: + +$$\begin{aligned} + \boxed{ + I_t + \equiv \int_a^b G_t \dd{B_t} + \equiv \lim_{h \to 0} \sum_{t = a}^{t = b} G_t \big(B_{t + h} - B_t\big) + } +\end{aligned}$$ + +Where have partitioned the time interval $[a, b]$ into steps of size $h$. +The above integral exists if $G_t$ and $B_t$ are adapted +to a common filtration $\mathcal{F}_t$, +and $\mathbf{E}[G_t^2]$ is integrable for $t \in [a, b]$. +If $I_t$ exists, $G_t$ is said to be **Itō-integrable** with respect to $B_t$. + + +## Motivation + +Consider the following simple first-order differential equation for $X_t$, +for some function $f$: + +$$\begin{aligned} + \dv{X_t}{t} + = f(X_t) +\end{aligned}$$ + +This can be solved numerically using the explicit Euler scheme +by discretizing it with step size $h$, +which can be applied recursively, leading to: + +$$\begin{aligned} + X_{t+h} + \approx X_{t} + f(X_t) \: h + \quad \implies \quad + X_t + \approx X_0 + \sum_{s = 0}^{s = t} f(X_s) \: h +\end{aligned}$$ + +In the limit $h \to 0$, this leads to the following unsurprising integral for $X_t$: + +$$\begin{aligned} + \int_0^t f(X_s) \dd{s} + = \lim_{h \to 0} \sum_{s = 0}^{s = t} f(X_s) \: h +\end{aligned}$$ + +In contrast, consider the *stochastic differential equation* below, +where $\xi_t$ represents white noise, +which is informally the $t$-derivative +of the Wiener process $\xi_t = \idv{B_t}{t}$: + +$$\begin{aligned} + \dv{X_t}{t} + = g(X_t) \: \xi_t +\end{aligned}$$ + +Now $X_t$ is not deterministic, +since $\xi_t$ is derived from a random variable $B_t$. +If $g = 1$, we expect $X_t = X_0 + B_t$. +With this in mind, we introduce the **Euler-Maruyama scheme**: + +$$\begin{aligned} + X_{t+h} + &= X_t + g(X_t) \: (\xi_{t+h} - \xi_t) \: h + \\ + &= X_t + g(X_t) \: (B_{t+h} - B_t) +\end{aligned}$$ + +We would like to turn this into an integral for $X_t$, as we did above. +Therefore, we state: + +$$\begin{aligned} + X_t + = X_0 + \int_0^t g(X_s) \dd{B_s} +\end{aligned}$$ + +This integral is *defined* as below, +analogously to the first, but with $h$ replaced by +the increment $B_{t+h} \!-\! B_t$ of a Wiener process. +This is an Itō integral: + +$$\begin{aligned} + \int_0^t g(X_s) \dd{B_s} + \equiv \lim_{h \to 0} \sum_{s = 0}^{s = t} g(X_s) \big(B_{s + h} - B_s\big) +\end{aligned}$$ + +For more information about applying the Itō integral in this way, +see the [Itō calculus](/know/concept/ito-calculus/). + + +## Properties + +Since $G_t$ and $B_t$ must be known (i.e. $\mathcal{F}_t$-adapted) +in order to evaluate the Itō integral $I_t$ at any given $t$, +it logically follows that $I_t$ is also $\mathcal{F}_t$-adapted. + +Because the Itō integral is defined as the limit of a sum of linear terms, +it inherits this linearity. +Consider two Itō-integrable processes $G_t$ and $H_t$, +and two constants $v, w \in \mathbb{R}$: + +$$\begin{aligned} + \int_a^b v G_t + w H_t \dd{B_t} + = v\! \int_a^b G_t \dd{B_t} +\: w\! \int_a^b H_t \dd{B_t} +\end{aligned}$$ + +By adding multiple summations, +the Itō integral clearly satisfies, for $a < b < c$: + +$$\begin{aligned} + \int_a^c G_t \dd{B_t} + = \int_a^b G_t \dd{B_t} + \int_b^c G_t \dd{B_t} +\end{aligned}$$ + +A more interesting property is the **Itō isometry**, +which expresses the expectation of the square of an Itō integral of $G_t$ +as a simpler "ordinary" integral of the expectation of $G_t^2$ +(which exists by the definition of Itō-integrability): + +$$\begin{aligned} + \boxed{ + \mathbf{E} \bigg( \int_a^b G_t \dd{B_t} \bigg)^2 + = \int_a^b \mathbf{E} \big[ G_t^2 \big] \dd{t} + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-isometry"/> +<label for="proof-isometry">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-isometry">Proof.</label> +We write out the left-hand side of the Itō isometry, +where eventually $h \to 0$: + +$$\begin{aligned} + \mathbf{E} \bigg[ \sum_{t = a}^{t = b} G_t (B_{t + h} \!-\! B_t) \bigg]^2 + &= \sum_{t = a}^{t = b} \sum_{s = a}^{s = b} \mathbf{E} \bigg[ G_t G_s (B_{t + h} \!-\! B_t) (B_{s + h} \!-\! B_s) \bigg] +\end{aligned}$$ + +In the particular case $t \ge s \!+\! h$, +a given term of this summation can be rewritten +as follows using the *law of total expectation* +(see [conditional expectation](/know/concept/conditional-expectation/)): + +$$\begin{aligned} + \mathbf{E} \Big[ G_t G_s (B_{t + h} \!-\! B_t) (B_{s + h} \!-\! B_s) \Big] + = \mathbf{E} \bigg[ \mathbf{E} \Big[ G_t G_s (B_{t + h} \!-\! B_t) (B_{s + h} \!-\! B_s) \Big| \mathcal{F}_t \Big] \bigg] +\end{aligned}$$ + +Recall that $G_t$ and $B_t$ are adapted to $\mathcal{F}_t$: +at time $t$, we have information $\mathcal{F}_t$, +which includes knowledge of the realized values $G_t$ and $B_t$. +Since $t \ge s \!+\! h$ by assumption, we can simply factor out the known quantities: + +$$\begin{aligned} + \mathbf{E} \Big[ G_t G_s (B_{t + h} \!-\! B_t) (B_{s + h} \!-\! B_s) \Big] + = \mathbf{E} \bigg[ G_t G_s (B_{s + h} \!-\! B_s) \: \mathbf{E} \Big[ (B_{t + h} \!-\! B_t) \Big| \mathcal{F}_t \Big] \bigg] +\end{aligned}$$ + +However, $\mathcal{F}_t$ says nothing about +the increment $(B_{t + h} \!-\! B_t) \sim \mathcal{N}(0, h)$, +meaning that the conditional expectation is zero: + +$$\begin{aligned} + \mathbf{E} \Big[ G_t G_s (B_{t + h} \!-\! B_t) (B_{s + h} \!-\! B_s) \Big] + = 0 + \qquad \mathrm{for}\; t \ge s + h +\end{aligned}$$ + +By swapping $s$ and $t$, the exact same result can be obtained for $s \ge t \!+\! h$: + +$$\begin{aligned} + \mathbf{E} \Big[ G_t G_s (B_{t + h} \!-\! B_t) (B_{s + h} \!-\! B_s) \Big] + = 0 + \qquad \mathrm{for}\; s \ge t + h +\end{aligned}$$ + +This leaves only one case which can be nonzero: $[t, t\!+\!h] = [s, s\!+\!h]$. +Applying the law of total expectation again yields: + +$$\begin{aligned} + \mathbf{E} \bigg[ \sum_{t = a}^{t = b} G_t (B_{t + h} \!-\! B_t) \bigg]^2 + &= \sum_{t = a}^{t = b} \mathbf{E} \Big[ G_t^2 (B_{t + h} \!-\! B_t)^2 \Big] + \\ + &= \sum_{t = a}^{t = b} \mathbf{E} \bigg[ \mathbf{E} \Big[ G_t^2 (B_{t + h} \!-\! B_t)^2 \Big| \mathcal{F}_t \Big] \bigg] +\end{aligned}$$ + +We know $G_t$, and the expectation value of $(B_{t+h} \!-\! B_t)^2$, +since the increment is normally distributed, is simply the variance $h$: + +$$\begin{aligned} + \mathbf{E} \bigg[ \sum_{t = a}^{t = b} G_t (B_{t + h} \!-\! B_t) \bigg]^2 + &= \sum_{t = a}^{t = b} \mathbf{E} \big[ G_t^2 \big] h + \longrightarrow + \int_a^b \mathbf{E} \big[ G_t^2 \big] \dd{t} +\end{aligned}$$ +</div> +</div> + +Furthermore, Itō integrals are [martingales](/know/concept/martingale/), +meaning that the average noise contribution is zero, +which makes intuitive sense, +since true white noise cannot be biased. + +<div class="accordion"> +<input type="checkbox" id="proof-martingale"/> +<label for="proof-martingale">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-martingale">Proof.</label> +We will prove that an arbitrary Itō integral $I_t$ is a martingale. +Using additivity, we know that the increment $I_t \!-\! I_s$ +is as follows, given information $\mathcal{F}_s$: + +$$\begin{aligned} + \mathbf{E} \big[ I_t \!-\! I_s | \mathcal{F}_s \big] + = \mathbf{E} \bigg[ \int_s^t G_u \dd{B_u} \bigg| \mathcal{F}_s \bigg] + = \lim_{h \to 0} \sum_{u = s}^{u = t} \mathbf{E} \Big[ G_u (B_{u + h} \!-\! B_u) \Big| \mathcal{F}_s \Big] +\end{aligned}$$ + +We rewrite this [conditional expectation](/know/concept/conditional-expectation/) +using the *tower property* for some $\mathcal{F}_u \supset \mathcal{F}_s$, +such that $G_u$ and $B_u$ are known, but $B_{u+h} \!-\! B_u$ is not: + +$$\begin{aligned} + \mathbf{E} \big[ I_t \!-\! I_s | \mathcal{F}_s \big] + &= \lim_{h \to 0} \sum_{u = s}^{u = t} + \mathbf{E} \bigg[ \mathbf{E} \Big[ G_u (B_{u + h} \!-\! B_u) \Big| \mathcal{F}_u \Big] \bigg| \mathcal{F}_s \bigg] + = 0 +\end{aligned}$$ + +We now have everything we need to calculate $\mathbf{E} [ I_t | \mathcal{F_s} ]$, +giving the martingale property: + +$$\begin{aligned} + \mathbf{E} \big[ I_t | \mathcal{F}_s \big] + = \mathbf{E} \big[ I_s | \mathcal{F}_s \big] + \mathbf{E} \big[ I_t \!-\! I_s | \mathcal{F}_s \big] + = I_s + \mathbf{E} \big[ I_t \!-\! I_s | \mathcal{F}_s \big] + = I_s +\end{aligned}$$ + +For the existence of $I_t$, +we need $\mathbf{E}[G_t^2]$ to be integrable over the target interval, +so from the Itō isometry we have $\mathbf{E}[I]^2 < \infty$, +and therefore $\mathbf{E}[I] < \infty$, +so $I_t$ has all the properties of a Martingale, +since it is trivially $\mathcal{F}_t$-adapted. +</div> +</div> + + + +## References +1. U.H. Thygesen, + *Lecture notes on diffusions and stochastic differential equations*, + 2021, Polyteknisk Kompendie. diff --git a/source/know/concept/ito-process/index.md b/source/know/concept/ito-process/index.md new file mode 100644 index 0000000..4379215 --- /dev/null +++ b/source/know/concept/ito-process/index.md @@ -0,0 +1,361 @@ +--- +title: "Itō process" +date: 2021-11-06 +categories: +- Mathematics +- Stochastic analysis +layout: "concept" +--- + +Given two [stochastic processes](/know/concept/stochastic-process/) +$F_t$ and $G_t$, consider the following random variable $X_t$, +where $B_t$ is the [Wiener process](/know/concept/wiener-process/), +i.e. Brownian motion: + +$$\begin{aligned} + X_t + = X_0 + \int_0^t F_s \dd{s} + \int_0^t G_s \dd{B_s} +\end{aligned}$$ + +Where the latter is an [Itō integral](/know/concept/ito-integral/), +assuming $G_t$ is Itō-integrable. +We call $X_t$ an **Itō process** if $F_t$ is locally integrable, +and the initial condition $X_0$ is known, +i.e. $X_0$ is $\mathcal{F}_0$-measurable, +where $\mathcal{F}_t$ is the filtration +to which $F_t$, $G_t$ and $B_t$ are adapted. +The above definition of $X_t$ is often abbreviated as follows, +where $X_0$ is implicit: + +$$\begin{aligned} + \dd{X_t} + = F_t \dd{t} + G_t \dd{B_t} +\end{aligned}$$ + +Typically, $F_t$ is referred to as the **drift** of $X_t$, +and $G_t$ as its **intensity**. +Because the Itō integral of $G_t$ is a +[martingale](/know/concept/martingale/), +it does not contribute to the mean of $X_t$: + +$$\begin{aligned} + \mathbf{E}[X_t] + = \int_0^t \mathbf{E}[F_s] \dd{s} +\end{aligned}$$ + +Now, consider the following **Itō stochastic differential equation** (SDE), +where $\xi_t = \idv{B_t}{t}$ is white noise, +informally treated as the $t$-derivative of $B_t$: + +$$\begin{aligned} + \dv{X_t}{t} + = f(X_t, t) + g(X_t, t) \: \xi_t +\end{aligned}$$ + +An Itō process $X_t$ is said to satisfy this equation +if $f(X_t, t) = F_t$ and $g(X_t, t) = G_t$, +in which case $X_t$ is also called an **Itō diffusion**. +All Itō diffusions are [Markov processes](/know/concept/markov-process/), +since only the current value of $X_t$ determines the future, +and $B_t$ is also a Markov process. + + +## Itō's lemma + +Classically, given $y \equiv h(x(t), t)$, +the chain rule of differentiation states that: + +$$\begin{aligned} + \dd{y} + = \pdv{h}{t} \dd{t} + \pdv{h}{x} \dd{x} +\end{aligned}$$ + +However, for a stochastic process $Y_t \equiv h(X_t, t)$, +where $X_t$ is an Itō process, +the chain rule is modified to the following, +known as **Itō's lemma**: + +$$\begin{aligned} + \boxed{ + \dd{Y_t} + = \bigg( \pdv{h}{t} + \pdv{h}{x} F_t + \frac{1}{2} \pdvn{2}{h}{x} G_t^2 \bigg) \dd{t} + \pdv{h}{x} G_t \dd{B_t} + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-lemma"/> +<label for="proof-lemma">Proof</label> +<div class="hidden"> +<label for="proof-lemma">Proof.</label> +We start by applying the classical chain rule, +but we go to second order in $x$. +This is also valid classically, +but there we would neglect all higher-order infinitesimals: + +$$\begin{aligned} + \dd{Y_t} + = \pdv{h}{t} \dd{t} + \pdv{h}{x} \dd{X_t} + \frac{1}{2} \pdvn{2}{h}{x} \dd{X_t}^2 +\end{aligned}$$ + +But here we cannot neglect $\dd{X_t}^2$. +We insert the definition of an Itō process: + +$$\begin{aligned} + \dd{Y_t} + &= \pdv{h}{t} \dd{t} + \pdv{h}{x} \Big( F_t \dd{t} + G_t \dd{B_t} \Big) + \frac{1}{2} \pdvn{2}{h}{x} \Big( F_t \dd{t} + G_t \dd{B_t} \Big)^2 + \\ + &= \pdv{h}{t} \dd{t} + \pdv{h}{x} \Big( F_t \dd{t} + G_t \dd{B_t} \Big) + + \frac{1}{2} \pdvn{2}{h}{x} \Big( F_t^2 \dd{t}^2 + 2 F_t G_t \dd{t} \dd{B_t} + G_t^2 \dd{B_t}^2 \Big) +\end{aligned}$$ + +In the limit of small $\dd{t}$, we can neglect $\dd{t}^2$, +and as it turns out, $\dd{t} \dd{B_t}$ too: + +$$\begin{aligned} + \dd{t} \dd{B_t} + &= (B_{t + \dd{t}} - B_t) \dd{t} + \sim \dd{t} \mathcal{N}(0, \dd{t}) + \sim \mathcal{N}(0, \dd{t}^3) + \longrightarrow 0 +\end{aligned}$$ + +However, due to the scaling property of $B_t$, +we cannot ignore $\dd{B_t}^2$, which has order $\dd{t}$: + +$$\begin{aligned} + \dd{B_t}^2 + &= (B_{t + \dd{t}} - B_t)^2 + \sim \big( \mathcal{N}(0, \dd{t}) \big)^2 + \sim \chi^2_1(\dd{t}) + \longrightarrow \dd{t} +\end{aligned}$$ + +Where $\chi_1^2(\dd{t})$ is the generalized chi-squared distribution +with one term of variance $\dd{t}$. +</div> +</div> + +The most important application of Itō's lemma +is to perform coordinate transformations, +to make the solution of a given Itō SDE easier. + + +## Coordinate transformations + +The simplest coordinate transformation is a scaling of the time axis. +Defining $s \equiv \alpha t$, the goal is to keep the Itō process. +We know how to scale $B_t$, be setting $W_s \equiv \sqrt{\alpha} B_{s / \alpha}$. +Let $Y_s \equiv X_t$ be the new variable on the rescaled axis, then: + +$$\begin{aligned} + \dd{Y_s} + = \dd{X_t} + &= f(X_t) \dd{t} + g(X_t) \dd{B_t} + \\ + &= \frac{1}{\alpha} f(Y_s) \dd{s} + \frac{1}{\sqrt{\alpha}} g(Y_s) \dd{W_s} +\end{aligned}$$ + +$W_s$ is a valid Wiener process, +and the other changes are small, +so this is still an Itō process. + +To solve SDEs analytically, it is usually best +to have additive noise, i.e. $g = 1$. +This can be achieved using the **Lamperti transform**: +define $Y_t \equiv h(X_t)$, where $h$ is given by: + +$$\begin{aligned} + \boxed{ + h(x) + = \int_{x_0}^x \frac{1}{g(y)} \dd{y} + } +\end{aligned}$$ + +Then, using Itō's lemma, it is straightforward +to show that the intensity becomes $1$. +Note that the lower integration limit $x_0$ does not enter: + +$$\begin{aligned} + \dd{Y_t} + &= \bigg( f(X_t) \: h'(X_t) + \frac{1}{2} g^2(X_t) \: h''(X_t) \bigg) \dd{t} + g(X_t) \: h'(X_t) \dd{B_t} + \\ + &= \bigg( \frac{f(X_t)}{g(X_t)} - \frac{1}{2} g^2(X_t) \frac{g'(X_t)}{g^2(X_t)} \bigg) \dd{t} + \frac{g(X_t)}{g(X_t)} \dd{B_t} + \\ + &= \bigg( \frac{f(X_t)}{g(X_t)} - \frac{1}{2} g'(X_t) \bigg) \dd{t} + \dd{B_t} +\end{aligned}$$ + +Similarly, we can eliminate the drift $f = 0$, +thereby making the Itō process a martingale. +This is done by defining $Y_t \equiv h(X_t)$, with $h(x)$ given by: + +$$\begin{aligned} + \boxed{ + h(x) + = \int_{x_0}^x \exp\!\bigg( \!-\!\! \int_{x_1}^y \frac{2 f(z)}{g^2(z)} \dd{z} \bigg) \dd{y} + } +\end{aligned}$$ + +The goal is to make the parenthesized first term (see above) +of Itō's lemma disappear, which this $h(x)$ does indeed do. +Note that $x_0$ and $x_1$ do not enter: + +$$\begin{aligned} + 0 + &= f(x) \: h'(x) + \frac{1}{2} g^2(x) \: h''(x) + \\ + &= \Big( f(x) - \frac{1}{2} g^2(x) \frac{2 f(x)}{g^2(x)} \Big) \exp\!\bigg( \!-\!\! \int_{x_1}^x \frac{2 f(y)}{g^2(y)} \dd{y} \bigg) +\end{aligned}$$ + + +## Existence and uniqueness + +It is worth knowing under what condition a solution to a given SDE exists, +in the sense that it is finite on the entire time axis. +Suppose the drift $f$ and intensity $g$ satisfy these inequalities, +for some known constant $K$ and for all $x$: + +$$\begin{aligned} + x f(x) \le K (1 + x^2) + \qquad \quad + g^2(x) \le K (1 + x^2) +\end{aligned}$$ + +When this is satisfied, we can find the following upper bound +on an Itō process $X_t$, +which clearly implies that $X_t$ is finite for all $t$: + +$$\begin{aligned} + \boxed{ + \mathbf{E}[X_t^2] + \le \big(X_0^2 + 3 K t\big) \exp\!\big(3 K t\big) + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-existence"/> +<label for="proof-existence">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-existence">Proof.</label> +If we define $Y_t \equiv X_t^2$, +then Itō's lemma tells us that the following holds: + +$$\begin{aligned} + \dd{Y_t} + = \big( 2 X_t \: f(X_t) + g^2(X_t) \big) \dd{t} + 2 X_t \: g(X_t) \dd{B_t} +\end{aligned}$$ + +Integrating and taking the expectation value +removes the Wiener term, leaving: + +$$\begin{aligned} + \mathbf{E}[Y_t] + = Y_0 + \mathbf{E}\! \int_0^t 2 X_s f(X_s) + g^2(X_s) \dd{s} +\end{aligned}$$ + +Given that $K (1 \!+\! x^2)$ is an upper bound of $x f(x)$ and $g^2(x)$, +we get an inequality: + +$$\begin{aligned} + \mathbf{E}[Y_t] + &\le Y_0 + \mathbf{E}\! \int_0^t 2 K (1 \!+\! X_s^2) + K (1 \!+\! X_s^2) \dd{s} + \\ + &\le Y_0 + \int_0^t 3 K (1 + \mathbf{E}[Y_s]) \dd{s} + \\ + &\le Y_0 + 3 K t + \int_0^t 3 K \big( \mathbf{E}[Y_s] \big) \dd{s} +\end{aligned}$$ + +We then apply the +[Grönwall-Bellman inequality](/know/concept/gronwall-bellman-inequality/), +noting that $(Y_0 \!+\! 3 K t)$ does not decrease with time, leading us to: + +$$\begin{aligned} + \mathbf{E}[Y_t] + &\le (Y_0 + 3 K t) \exp\!\bigg( \int_0^t 3 K \dd{s} \bigg) + \\ + &\le (Y_0 + 3 K t) \exp\!\big(3 K t\big) +\end{aligned}$$ +</div> +</div> + +If a solution exists, it is also worth knowing whether it is unique. +Suppose that $f$ and $g$ satisfy the following inequalities, +for some constant $K$ and for all $x$ and $y$: + +$$\begin{aligned} + \big| f(x) - f(y) \big| \le K \big| x - y \big| + \qquad \quad + \big| g(x) - g(y) \big| \le K \big| x - y \big| +\end{aligned}$$ + +Let $X_t$ and $Y_t$ both be solutions to a given SDE, +but the initial conditions need not be the same, +such that the difference is initially $X_0 \!-\! Y_0$. +Then the difference $X_t \!-\! Y_t$ is bounded by: + +$$\begin{aligned} + \boxed{ + \mathbf{E}\big[ (X_t - Y_t)^2 \big] + \le (X_0 - Y_0)^2 \exp\!\Big( \big(2 K \!+\! K^2 \big) t \Big) + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-uniqueness"/> +<label for="proof-uniqueness">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-uniqueness">Proof.</label> +We define $D_t \equiv X_t \!-\! Y_t$ and $Z_t \equiv D_t^2 \ge 0$, +together with $F_t \equiv f(X_t) \!-\! f(Y_t)$ and $G_t \equiv g(X_t) \!-\! g(Y_t)$, +such that Itō's lemma states: + +$$\begin{aligned} + \dd{Z_t} + = \big( 2 D_t F_t + G_t^2 \big) \dd{t} + 2 D_t G_t \dd{B_t} +\end{aligned}$$ + +Integrating and taking the expectation value +removes the Wiener term, leaving: + +$$\begin{aligned} + \mathbf{E}[Z_t] + = Z_0 + \mathbf{E}\! \int_0^t 2 D_s F_s + G_s^2 \dd{s} +\end{aligned}$$ + +The *Cauchy-Schwarz inequality* states that $|D_s F_s| \le |D_s| |F_s|$, +and then the given fact that $F_s$ and $G_s$ satisfy +$|F_s| \le K |D_s|$ and $|G_s| \le K |D_s|$ gives: + +$$\begin{aligned} + \mathbf{E}[Z_t] + &\le Z_0 + \mathbf{E}\! \int_0^t 2 K D_s^2 + K^2 D_s^2 \dd{s} + \\ + &\le Z_0 + \int_0^t (2 K \!+\! K^2) \: \mathbf{E}[Z_s] \dd{s} +\end{aligned}$$ + +Where we have implicitly used that $D_s F_s = |D_s F_s|$ +because $Z_t$ is positive for all $G_s^2$, +and that $|D_s|^2 = D_s^2$ because $D_s$ is real. +We then apply the +[Grönwall-Bellman inequality](/know/concept/gronwall-bellman-inequality/), +recognizing that $Z_0$ does not decrease with time (since it is constant): + +$$\begin{aligned} + \mathbf{E}[Z_t] + &\le Z_0 \exp\!\bigg( \int_0^t 2 K \!+\! K^2 \dd{s} \bigg) + \\ + &\le Z_0 \exp\!\Big( \big( 2 K \!+\! K^2 \big) t \Big) +\end{aligned}$$ +</div> +</div> + +Using these properties, it can then be shown +that if all of the above conditions are satisfied, +then the SDE has a unique solution, +which is $\mathcal{F}_t$-adapted, continuous, and exists for all times. + + + +## References +1. U.H. Thygesen, + *Lecture notes on diffusions and stochastic differential equations*, + 2021, Polyteknisk Kompendie. diff --git a/source/know/concept/jellium/index.md b/source/know/concept/jellium/index.md new file mode 100644 index 0000000..6e395b4 --- /dev/null +++ b/source/know/concept/jellium/index.md @@ -0,0 +1,416 @@ +--- +title: "Jellium" +date: 2021-11-23 +categories: +- Physics +- Quantum mechanics +- Perturbation +layout: "concept" +--- + +**Jellium**, also called the **uniform** or **homogeneous electron gas**, +is a theoretical material where all electrons are free, +and the ions' positive charge is smeared into a uniform background "jelly". +This simple model lets us study electron interactions easily. + + +## Without interactions + +Let us start by neglecting electron-electron interactions. +This is clearly a dubious assumption, but we will stick with it for now. +For an infinitely large sample of jellium, +the single-electron states are simply plane waves. +We consider an arbitrary cube of volume $V$, +and impose periodic boundary conditions on it, +such that the single-particle orbitals are (suppressing spin): + +$$\begin{aligned} + \Inprod{\vb{r}}{\psi_{\vb{k}}} + = \psi_{\vb{k}}(\vb{r}) + = \frac{1}{\sqrt{V}} \exp(i \vb{k} \cdot \vb{r}) + \qquad \quad + \vb{k} = \frac{2 \pi}{V^{1/3}} (n_x, n_y, n_z) +\end{aligned}$$ + +Where $n_x, n_y, n_z \in \mathbb{Z}$. +This is a discrete (but infinite) set of independent orbitals, +so it is natural to use the +[second quantization](/know/concept/second-quantization/) +to write the non-interacting Hamiltonian $\hat{H}_0$, +where $\hbar^2 |\vb{k}|^2 / (2 m)$ is the kinetic energy +of the orbital with wavevector $\vb{k}$, and $s$ is the spin: + +$$\begin{aligned} + \hat{H}_0 + = \sum_{s} \sum_{\vb{k}} \frac{\hbar^2 |\vb{k}|^2}{2 m} \hat{c}_{s,\vb{k}}^\dagger \hat{c}_{s,\vb{k}} +\end{aligned}$$ + +Assuming that the temperature $T = 0$, +the $N$-electron ground state of this Hamiltonian +is known as the **Fermi sea** or **Fermi sphere** $\Ket{\mathrm{FS}}$, +and is constructed by filling up the single-electron states +starting from the lowest energy: + +$$\begin{aligned} + \Ket{\mathrm{FS}} + = \prod_{s} \prod_{j = 1}^{N/2} \hat{c}_{s,\vb{k}_j}^\dagger \Ket{0} +\end{aligned}$$ + +Because $T = 0$, all the electrons stay in their assigned state. +The energy and wavenumber $|\vb{k}|$ of the highest filled orbital +are called the **Fermi energy** $\epsilon_F$ and **Fermi wavenumber** $k_F$, +and obey the expected kinetic energy relation: + +$$\begin{aligned} + \boxed{ + \epsilon_F + = \frac{\hbar^2}{2 m} k_F^2 + } +\end{aligned}$$ + +The Fermi sea can be visualized in $\vb{k}$-space as a sphere with radius $k_F$. +Because $\vb{k}$ is discrete, the sphere's surface is not smooth, +but in the limit $V \to \infty$ it becomes perfect. + +Now, we would like a relation between the system's parameters, +e.g. $N$ and $V$, and the resulting values of $\epsilon_F$ or $k_F$. +The total population $N$ must be given by: + +$$\begin{aligned} + N + = \sum_{s} \sum_{\vb{k}} \matrixel{\mathrm{FS}}{\hat{c}_{s,\vb{k}}^\dagger \hat{c}_{s,\vb{k}}}{\mathrm{FS}} + = \sum_{s} \frac{V}{(2 \pi)^3} \int_{-\infty}^\infty \matrixel{\mathrm{FS}}{\hat{c}_{s,\vb{k}}^\dagger \hat{c}_{s,\vb{k}}}{\mathrm{FS}} \dd{\vb{k}} +\end{aligned}$$ + +Where we have turned the sum over $\vb{k}$ into an integral with a constant factor, +by using that each orbital exclusively occupies a volume $(2 \pi)^3 / V$ in $\vb{k}$-space. + +At zero temperature, this inner product can only be $0$ or $1$, +depending on whether $\vb{k}$ is outside or inside the Fermi sphere. +We can therefore rewrite using a +[Heaviside step function](/know/concept/heaviside-step-function/): + +$$\begin{aligned} + N + = \sum_{s} \frac{V}{(2 \pi)^3} \int_{-\infty}^\infty \Theta(k_F - |\vb{k}|) \dd{\vb{k}} + = 2 \frac{V}{(2 \pi)^3} \int_{-\infty}^\infty \Theta(k_F - |\vb{k}|) \dd{\vb{k}} +\end{aligned}$$ + +Where we realized that spin does not matter, +and replaced the sum over $s$ by a factor $2$. +In order to evaluate this 3D integral, +we go to [spherical coordinates](/know/concept/spherical-coordinates/) +$(|\vb{k}|, \theta, \varphi)$: + +$$\begin{aligned} + N + &= \frac{V}{4 \pi^3} \int_0^{2 \pi} \int_0^\pi \int_0^\infty \Theta(k_F - |\vb{k}|) |\vb{k}|^2 \sin(\theta) \dd{|\vb{k}|} \dd{\theta} \dd{\varphi} + \\ + &= \frac{V}{4 \pi^3} 4 \pi \int_0^{k_F} |\vb{k}|^2 \dd{|\vb{k}|} + = \frac{V}{\pi^2} \bigg[ \frac{|\vb{k}|^3}{3} \bigg]_0^{k_F} + = \frac{V}{3 \pi^2} k_F^3 +\end{aligned}$$ + +Using that the electron density $n = N/V$, +we thus arrive at the following relation: + +$$\begin{aligned} + \boxed{ + k_F^3 + = 3 \pi^2 n + } +\end{aligned}$$ + +This result also justifies our assumption that $T = 0$: +we can accurately calculate the density $n$ for many conducting materials, +and this relation then gives $k_F$ and $\epsilon_F$. +It turns out that $\epsilon_F$ is usually very large +compared to the thermal energy $k_B T$ at reasonable temperatures, +so we can conclude that thermal fluctuations are negligible. + +Now, $\epsilon_F$ is the highest single-electron energy, +but about the total $N$-particle energy $E^{(0)}$? + +$$\begin{aligned} + E^{(0)} + = \matrixel{\mathrm{FS}}{\hat{H}_0}{\mathrm{FS}} + = \sum_{s} \sum_{\vb{k}} \frac{\hbar^2 |\vb{k}|^2}{2 m} \matrixel{\mathrm{FS}}{\hat{c}_{s,\vb{k}}^\dagger \hat{c}_{s,\vb{k}}}{\mathrm{FS}} +\end{aligned}$$ + +Once again, we turn the sum over $\vb{k}$ into an integral, +and recognize the spin's irrelevance: + +$$\begin{aligned} + E^{(0)} + &= \sum_{s} \frac{V}{(2 \pi)^3} \int_{-\infty}^\infty \frac{\hbar^2 |\vb{k}|^2}{2 m} + \matrixel{\mathrm{FS}}{\hat{c}_{\vb{k}}^\dagger \hat{c}_{\vb{k}}}{\mathrm{FS}} \dd{\vb{k}} + \\ + &= \frac{\hbar^2 V}{8 \pi^3 m} \int_{-\infty}^\infty |\vb{k}|^2 \: \Theta(k_F - |\vb{k}|) \dd{\vb{k}} +\end{aligned}$$ + +In spherical coordinates, +we evaluate the integral and find that $E^{(0)}$ is proportional to $k_F^5$: + +$$\begin{aligned} + E^{(0)} + &= \frac{\hbar^2 V}{8 \pi^3 m} \int_0^{2 \pi} + \int_0^\pi \int_0^\infty \Big( |\vb{k}|^2 \: \Theta(k_F - |\vb{k}|) \Big) |\vb{k}|^2 \sin(\theta) \dd{|\vb{k}|} \dd{\theta} \dd{\varphi} + \\ + &= \frac{\hbar^2 V}{8 \pi^3 m} 4 \pi \int_0^{k_F} |\vb{k}|^4 \dd{|\vb{k}|} + = \frac{\hbar^2 V}{2 \pi^2 m} \bigg[ \frac{|\vb{k}|^5}{5} \bigg]_0^{k_F} + = \frac{\hbar^2 V}{10 \pi^2 m} k_F^5 +\end{aligned}$$ + +In general, it is more useful to consider +the average kinetic energy per electron $E^{(0)} / N$, +which we find to be as follows, using that $k_F^3 = 3 \pi^2 n$: + +$$\begin{aligned} + \boxed{ + \frac{E^{(0)}}{N} + = \frac{3 \hbar^2}{10 m} k_F^2 + = \frac{3}{5} \epsilon_F + } + \:\sim\: n^{2/3} +\end{aligned}$$ + +Traditionally, this is expressed using a dimensionless parameter $r_s$, +defined as the radius of a sphere containing a single electron, +measured in Bohr radii $a_0 \equiv 4 \pi \varepsilon_0 \hbar^2 / (e^2 m)$: + +$$\begin{aligned} + \frac{4 \pi}{3} (a_0 r_s)^3 + = \frac{1}{n} + = \frac{3 \pi^2}{k_F^3} + \quad \implies \quad + r_s + = \Big( \frac{3}{4 \pi a_0^3 n} \Big)^{1/3} + = \Big( \frac{9 \pi}{4} \Big)^{1/3} \frac{1}{a_0 k_F} +\end{aligned}$$ + +Such that the ground state energy can be rewritten in Rydberg units of energy like so: + +$$\begin{aligned} + \frac{E^{(0)}}{N} + = \frac{3 \hbar^2}{10 m} \frac{4 \pi \varepsilon_0 e^2}{4 \pi \varepsilon_0 e^2} \frac{a_0^2 k_F^2}{a_0^2} + = \frac{3 e^2}{40 \pi \varepsilon_0} \Big( \frac{9 \pi}{4} \Big)^{2/3} \frac{1}{a_0 r_s^2} + \approx \frac{2.21}{r_s^2} \; \mathrm{Ry} +\end{aligned}$$ + + +## With interactions + +To include Coulomb interactions, let us try +[time-independent pertubation theory](/know/concept/time-independent-perturbation-theory/). +Clearly, this will give better results when the interaction is relatively weak, if ever. + +The Coulomb potential is proportional to the inverse distance, +and the average electron spacing is roughly $n^{-1/3}$, +so the interaction energy $E_\mathrm{int}$ should scale as $n^{1/3}$. +We already know that the kinetic energy $E_\mathrm{kin} = E^{(0)}$ scales as $n^{2/3}$, +meaning perturbation theory should be reasonable +if $1 \gg E_\mathrm{int} / E_\mathrm{kin} \sim n^{-1/3}$, +so in the limit of high density $n \to \infty$. + +The two-body Coulomb interaction operator $\hat{W}$ +is as follows in second-quantized form: + +$$\begin{aligned} + \hat{W} + = \frac{1}{2 V} \sum_{s_1 s_2} \sum_{\vb{k}_1 \vb{k}_2} \sum_{\vb{q} \neq 0} \frac{e^2}{\varepsilon_0 |\vb{q}|^2} + \hat{c}_{s_1, \vb{k}_1 + \vb{q}}^\dagger \hat{c}_{s_2, \vb{k}_2 - \vb{q}}^\dagger \hat{c}_{s_2, \vb{k}_2} \hat{c}_{s_1, \vb{k}_1} +\end{aligned}$$ + +The first-order correction $E^{(1)}$ to the ground state (i.e. Fermi sea) energy +is then given by: + +$$\begin{aligned} + E^{(1)} + = \matrixel{\mathrm{FS}}{\hat{W}}{\mathrm{FS}} + = \frac{e^2}{2 \varepsilon_0 V} \sum_{s_1 s_2} \sum_{\vb{k}_1 \vb{k}_2} \sum_{\vb{q} \neq 0} \frac{1}{|\vb{q}|^2} + \matrixel{\mathrm{FS}}{ + \hat{c}_{s_1, \vb{k}_1 + \vb{q}}^\dagger \hat{c}_{s_2, \vb{k}_2 - \vb{q}}^\dagger \hat{c}_{s_2, \vb{k}_2} \hat{c}_{s_1, \vb{k}_1} + }{\mathrm{FS}} +\end{aligned}$$ + +This inner product can only be nonzero +if the two creation operators $\hat{c}^\dagger$ +are for the same orbitals as the two annihilation operators $\hat{c}$. +Since $\vb{q} \neq 0$, this means that $s_1 = s_2$, +and that momentum is conserved: $\vb{k}_2 = \vb{k}_1 \!+\! \vb{q}$. +And of course both $\vb{k}_1$ and $\vb{k}_1 \!+\! \vb{q}$ +must be inside the Fermi sphere, +to avoid annihilating an empty orbital. +Let $s = s_1$ and $\vb{k} = \vb{k}_1$: + +$$\begin{aligned} + E^{(1)} + &= \frac{e^2}{2 \varepsilon_0 V} \sum_{s} \sum_{\vb{k}} \sum_{\vb{q} \neq 0} \frac{1}{|\vb{q}|^2} + \matrixel{\mathrm{FS}}{ + \hat{c}_{s, \vb{k} + \vb{q}}^\dagger \hat{c}_{s, \vb{k}}^\dagger \hat{c}_{s, \vb{k} + \vb{q}} \hat{c}_{s, \vb{k}} + }{\mathrm{FS}} + \\ + &= \frac{- e^2}{2 \varepsilon_0 V} \sum_{s} \sum_{\vb{k}} \sum_{\vb{q} \neq 0} \frac{1}{|\vb{q}|^2} + \matrixel{\mathrm{FS}}{ + \big( \hat{c}_{s, \vb{k} + \vb{q}}^\dagger \hat{c}_{s, \vb{k} + \vb{q}}\big) \big(\hat{c}_{s, \vb{k}}^\dagger \hat{c}_{s, \vb{k}}\big) + }{\mathrm{FS}} + \\ + &= \frac{- e^2}{2 \varepsilon_0 V} \sum_{s} \sum_{\vb{k}} \sum_{\vb{q} \neq 0} \frac{1}{|\vb{q}|^2} + \Theta(k_F - |\vb{k}|) \:\Theta(k_F - |\vb{k} \!+\! \vb{q}|) +\end{aligned}$$ + +Next, we convert the sum over $\vb{q}$ into an integral in spherical coordinates. +Clearly, $\vb{q}$ is the "jump" made by an electron from one orbital to another, +so the largest possible jump +goes from a point on the Fermi surface to the opposite point, +and thus has length $2 k_F$. +This yields the integration limit, and therefore leads to: + +$$\begin{aligned} + E^{(1)} + &= \frac{- e^2}{(2 \pi)^3 \varepsilon_0} \sum_{\vb{k}} + \int_0^{2 \pi} \!\!\int_0^\pi \!\!\int_0^\infty \Theta(k_F \!-\! |\vb{k}|) \: \Theta(k_F \!-\! |\vb{k} \!+\! \vb{q}|) \frac{|\vb{q}|^2}{|\vb{q}|^2} + \sin(\theta_q) \dd{|\vb{q}|} \dd{\theta_q} \dd{\varphi_q} + \\ + &= \frac{- e^2}{2 \pi^2 \varepsilon_0} \sum_{\vb{k}} + \int_0^{2 k_F} \Theta(k_F \!-\! |\vb{k}|) \: \Theta(k_F \!-\! |\vb{k} \!+\! \vb{q}|) \dd{|\vb{q}|} +\end{aligned}$$ + +Where we have used that the direction of $\vb{q}$, +i.e. $(\theta_q,\varphi_q)$, is irrelevant, +as long as we define $\theta_k$ as +the angle between $\vb{q}$ and $\vb{k} \!+\! \vb{q}$ +when we go to spherical coordinates $(|\vb{k}|, \theta_k, \varphi_k)$ for $\vb{k}$: + +$$\begin{aligned} + E^{(1)} + &= \frac{- e^2 V}{16 \pi^5 \varepsilon_0} \int_0^{2 k_F} \!\!\!\!\int_0^{2 \pi} \!\!\!\int_0^\pi \!\!\!\int_0^\infty + \!\Theta(k_F \!-\! |\vb{k}|) \: \Theta(k_F \!-\! |\vb{k} \!+\! \vb{q}|) + \: |\vb{k}|^2 \sin(\theta_k) \dd{|\vb{k}|} \dd{\theta_k} \dd{\varphi_k} \dd{|\vb{q}|} + \\ + &= \frac{- e^2 V}{16 \pi^5 \varepsilon_0} \int_0^{2 k_F} \!\!\!\!\int_0^{2 \pi} \!\!\!\int_0^\pi \!\!\!\int_0^{k_F} + \!\Theta(k_F \!-\! |\vb{k} \!+\! \vb{q}|) + \: |\vb{k}|^2 \sin(\theta_k) \dd{|\vb{k}|} \dd{\theta_k} \dd{\varphi_k} \dd{|\vb{q}|} +\end{aligned}$$ + +Unfortunately, this last step function is less easy to translate into integration limits. +In effect, we are trying to calculate the intersection volume of two spheres, +both with radius $k_F$, one centered on the origin (for $\vb{k}$), +and the other centered on $\vb{q}$ (for $\vb{k} \!+\! \vb{q}$). +Imagine a triangle with side lengths $|\vb{k}|$, $|\vb{q}|$ and $|\vb{k} \!+\! \vb{q}|^2$, +where $\theta_k$ is the angle between $|\vb{k}|$ and $|\vb{k} \!+\! \vb{q}|$. +The *law of cosines* then gives the following relation: + +$$\begin{aligned} + |\vb{k}|^2 + = |\vb{q}|^2 + |\vb{k} \!+\! \vb{q}|^2 - 2 |\vb{q}| |\vb{k} \!+\! \vb{q}| \cos(\theta_k) +\end{aligned}$$ + +We already know that $|\vb{k}| < k_F$ and $0 < |\vb{q}| < 2 k_F$, +so by isolating for $\cos(\theta_k)$, +we can obtain bounds on $\theta_k$ and $|\vb{k}|$. +Let $|\vb{k}| \to k_F$ in both cases, then: + +$$\begin{aligned} + \cos(\theta_k) + = \frac{|\vb{k} \!+\! \vb{q}|^2 + |\vb{q}|^2 - |\vb{k}|^2}{2 |\vb{k} \!+\! \vb{q}| |\vb{q}|} + &\:\:\underset{|\vb{q}| \to 0}{>}\:\:\: \frac{k_F^2 + |\vb{q}|^2 - k_F^2}{2 k_F |\vb{q}|} + = \frac{|\vb{q}|}{2 k_F} + \\ + &\underset{|\vb{q}| \to 2 k_F}{<}\:\: \frac{k_F^2 + 4 k_F ^2 - k_F^2}{2 k_F 2 k_F} + = 1 +\end{aligned}$$ + +Meaning that $0 < \theta_k < \arccos{|\vb{q}| / (2 k_F)}$. +To get a lower limit for $|\vb{k}|$, we "cheat" by artificially demanding +that $\vb{k}$ does not cross the halfway point between the spheres, +with the result that $|\vb{k}| \cos(\theta_k) > |\vb{q}|/2$. +Then, thanks to symmetry (both spheres have the same radius), +we just multiply the integral by $2$, +for $\vb{k}$ on the other side of the halfway point. + +Armed with these integration limits, we return to calculating $E^{(1)}$, +substituting $\xi \equiv \cos(\theta_k)$: + +$$\begin{aligned} + E^{(1)} + &= \frac{- e^2 V}{16 \pi^5 \varepsilon_0} 2 \int_0^{2 k_F} \!\!\!\int_0^{2 \pi} \!\!\int_0^{\arccos{|\vb{q}| / (2 k_F)}} + \!\!\int_{|\vb{q}|/(2 \cos{\theta_k})}^{k_F} |\vb{k}|^2 \sin(\theta_k) \dd{|\vb{k}|} \dd{\theta_k} \dd{\varphi_k} \dd{|\vb{q}|} + \\ + &= \frac{e^2 V}{8 \pi^5 \varepsilon_0} 2 \pi \int_0^{2 k_F} \!\!\!\int_1^{|\vb{q}| / (2 k_F)} + \!\!\int_{|\vb{q}|/(2 \xi)}^{k_F} |\vb{k}|^2 \frac{\sin(\theta_k)}{\sin(\theta_k)} \dd{|\vb{k}|} \dd{\xi} \dd{|\vb{q}|} + \\ + &= \frac{- e^2 V}{4 \pi^4 \varepsilon_0} \int_0^{2 k_F} \!\!\!\int_{|\vb{q}| / (2 k_F)}^1 + \!\!\int_{|\vb{q}|/(2 \xi)}^{k_F} |\vb{k}|^2 \dd{|\vb{k}|} \dd{\xi} \dd{|\vb{q}|} +\end{aligned}$$ + +Where we have used that $\varphi_k$ does not appear in the integrand. +Evaluating these integrals: + +$$\begin{aligned} + E^{(1)} + &= \frac{- e^2 V}{4 \pi^4 \varepsilon_0} \int_0^{2 k_F} \!\!\!\int_{|\vb{q}| / (2 k_F)}^1 + \bigg[ \frac{|\vb{k}|^3}{3} \bigg]_{|\vb{q}|/(2 \xi)}^{k_F} \dd{\xi} \dd{|\vb{q}|} + \\ + &= \frac{- e^2 V}{4 \pi^4 \varepsilon_0} \int_0^{2 k_F} \!\!\!\int_{|\vb{q}| / (2 k_F)}^1 + \bigg( \frac{k_F^3}{3} - \frac{|\vb{q}|^3}{24 \xi^3} \bigg) \dd{\xi} \dd{|\vb{q}|} + \\ + &= \frac{- e^2 V}{4 \pi^4 \varepsilon_0} \int_0^{2 k_F} + \bigg[ \frac{k_F^3}{3} x + \frac{|\vb{q}|^3}{48 \xi^2} \bigg]_{|\vb{q}| / (2 k_F)}^1 \dd{|\vb{q}|} + \\ + &= \frac{- e^2 V}{4 \pi^4 \varepsilon_0} \int_0^{2 k_F} + \bigg( \frac{k_F^3}{3} + \frac{|\vb{q}|^3}{48} - \frac{k_F^2 |\vb{q}|}{4} \bigg) \dd{|\vb{q}|} + \\ + &= \frac{- e^2 V}{4 \pi^4 \varepsilon_0} \bigg[ \frac{k_F^3 |\vb{q}|}{3} + \frac{|\vb{q}|^4}{192} - \frac{k_F^2 |\vb{q}|^2}{8} \bigg]_0^{2 k_F} + \\ + &= \frac{- e^2 V}{16 \pi^4 \varepsilon_0} k_F^4 + = \frac{- e^2 N}{16 \pi^4 \varepsilon_0 n} k_F^4 + = -\frac{3 e^2 N}{16 \pi^2 \varepsilon_0} k_F +\end{aligned}$$ + +Per particle, the first-order energy correction $E^{(1)}$ +is therefore found to be as follows: + +$$\begin{aligned} + \boxed{ + \frac{E^{(1)}}{N} + = -\frac{3 e^2}{16 \pi^2 \varepsilon_0} k_F + } +\end{aligned}$$ + +This can also be written using the parameter $r_s$ introduced above, leading to: + +$$\begin{aligned} + \frac{E^{(1)}}{N} + = -\frac{3 e^2}{16 \pi^2 \varepsilon_0} \frac{a_0 k_F}{a_0} + = -\frac{3 e^2}{16 \pi^2 \varepsilon_0} \Big( \frac{9 \pi}{4} \Big)^{1/3} \frac{1}{a_0 r_s} +\end{aligned}$$ + +Consequently, for sufficiently high densities $n$, +the total energy $E$ per particle is given by: + +$$\begin{aligned} + \boxed{ + \frac{E}{N} + \approx \bigg( \frac{2.21}{r_s^2} - \frac{0.92}{r_s} \bigg) \; \mathrm{Ry} + } +\end{aligned}$$ + +Unfortunately, this is as far as we can go. +In theory, the second-order energy correction $E^{(2)}$ is as shown below, +but it turns out that it (and all higher orders) diverge: + +$$\begin{aligned} + E^{(2)} + = \sum_{\Psi_n \neq \mathrm{FS}} \frac{\big| \matrixel{\mathrm{FS}}{\hat{W}}{\Psi_n} \big|^2}{E^{(0)} - E_n} +\end{aligned}$$ + +The only cure for this is to go to infinite order, +where all the infinities add up to a finite result. + + + +## References +1. H. Bruus, K. Flensberg, + *Many-body quantum theory in condensed matter physics*, + 2016, Oxford. diff --git a/source/know/concept/kolmogorov-equations/index.md b/source/know/concept/kolmogorov-equations/index.md new file mode 100644 index 0000000..a6579b2 --- /dev/null +++ b/source/know/concept/kolmogorov-equations/index.md @@ -0,0 +1,246 @@ +--- +title: "Kolmogorov equations" +date: 2021-11-14 +categories: +- Mathematics +- Statistics +- Stochastic analysis +layout: "concept" +--- + +Consider the following general [Itō diffusion](/know/concept/ito-calculus/) +$X_t \in \mathbb{R}$, which is assumed to satisfy +the conditions for unique existence on the entire time axis: + +$$\begin{aligned} + \dd{X}_t + = f(X_t, t) \dd{t} + g(X_t, t) \dd{B_t} +\end{aligned}$$ + +Let $\mathcal{F}_t$ be the filtration to which $X_t$ is adapted, +then we define $Y_s$ as shown below, +namely as the [conditional expectation](/know/concept/conditional-expectation/) +of $h(X_t)$, for an arbitrary bounded function $h(x)$, +given the information $\mathcal{F}_s$ available at time $s \le t$. +Because $X_t$ is a [Markov process](/know/concept/markov-process/), +$Y_s$ must be $X_s$-measurable, +so it is a function $k$ of $X_s$ and $s$: + +$$\begin{aligned} + Y_s + \equiv \mathbf{E}[h(X_t) | \mathcal{F}_s] + = \mathbf{E}[h(X_t) | X_s] + = k(X_s, s) +\end{aligned}$$ + +Consequently, we can apply Itō's lemma to find $\dd{Y_s}$ +in terms of $k$, $f$ and $g$: + +$$\begin{aligned} + \dd{Y_s} + &= \bigg( \pdv{k}{s} + \pdv{k}{x} f + \frac{1}{2} \pdvn{2}{k}{x} g^2 \bigg) \dd{s} + \pdv{k}{x} g \dd{B_s} + \\ + &= \bigg( \pdv{k}{s} + \hat{L} k \bigg) \dd{s} + \pdv{k}{x} g \dd{B_s} +\end{aligned}$$ + +Where we have defined the linear operator $\hat{L}$ +to have the following action on $k$: + +$$\begin{aligned} + \hat{L} k + \equiv \pdv{k}{x} f + \frac{1}{2} \pdvn{2}{k}{x} g^2 +\end{aligned}$$ + +At this point, we need to realize that $Y_s$ is +a [martingale](/know/concept/martingale/) with respect to $\mathcal{F}_s$, +since $Y_s$ is $\mathcal{F}_s$-adapted and finite, +and it satisfies the martingale property, +for $r \le s \le t$: + +$$\begin{aligned} + \mathbf{E}[Y_s | \mathcal{F}_r] + = \mathbf{E}\Big[ \mathbf{E}[h(X_t) | \mathcal{F}_s] \Big| \mathcal{F}_r \Big] + = \mathbf{E}\big[ h(X_t) \big| \mathcal{F}_r \big] + = Y_r +\end{aligned}$$ + +Where we used the tower property of conditional expectations, +because $\mathcal{F}_r \subset \mathcal{F}_s$. +However, an Itō diffusion can only be a martingale +if its drift term (the one containing $\dd{s}$) vanishes, +so, looking at $\dd{Y_s}$, we must demand that: + +$$\begin{aligned} + \pdv{k}{s} + \hat{L} k + = 0 +\end{aligned}$$ + +Because $k(X_s, s)$ is a Markov process, +we can write it with a transition density $p(s, X_s; t, X_t)$, +where in this case $s$ and $X_s$ are given initial conditions, +$t$ is a parameter, and the terminal state $X_t$ is a random variable. +We thus have: + +$$\begin{aligned} + k(x, s) + = \int_{-\infty}^\infty p(s, x; t, y) \: h(y) \dd{y} +\end{aligned}$$ + +We insert this into the equation that we just derived for $k$, yielding: + +$$\begin{aligned} + 0 + = \int_{-\infty}^\infty \!\! \Big( \pdv{}{s}p(s, x; t, y) + \hat{L} p(s, x; t, y) \Big) h(y) \dd{y} +\end{aligned}$$ + +Because $h$ is arbitrary, and this must be satisfied for all $h$, +the transition density $p$ fulfills: + +$$\begin{aligned} + 0 + = \pdv{}{s}p(s, x; t, y) + \hat{L} p(s, x; t, y) +\end{aligned}$$ + +Here, $t$ is a known parameter and $y$ is a "known" integration variable, +leaving only $s$ and $x$ as free variables for us to choose. +We therefore define the **likelihood function** $\psi(s, x)$, +which gives the likelihood of an initial condition $(s, x)$ +given that the terminal condition is $(t, y)$: + +$$\begin{aligned} + \boxed{ + \psi(s, x) + \equiv p(s, x; t, y) + } +\end{aligned}$$ + +And from the above derivation, +we conclude that $\psi$ satisfies the following PDE, +known as the **backward Kolmogorov equation**: + +$$\begin{aligned} + \boxed{ + - \pdv{\psi}{s} + = \hat{L} \psi + = f \pdv{\psi}{x} + \frac{1}{2} g^2 \pdvn{2}{\psi}{x} + } +\end{aligned}$$ + +Moving on, we can define the traditional +**probability density function** $\phi(t, y)$ from the transition density $p$, +by fixing the initial $(s, x)$ +and leaving the terminal $(t, y)$ free: + +$$\begin{aligned} + \boxed{ + \phi(t, y) + \equiv p(s, x; t, y) + } +\end{aligned}$$ + +With this in mind, for $(s, x) = (0, X_0)$, +the unconditional expectation $\mathbf{E}[Y_t]$ +(i.e. the conditional expectation without information) +will be constant in time, because $Y_t$ is a martingale: + +$$\begin{aligned} + \mathbf{E}[Y_t] + = \mathbf{E}[k(X_t, t)] + = \int_{-\infty}^\infty k(y, t) \: \phi(t, y) \dd{y} + = \Inprod{k}{\phi} + = \mathrm{const} +\end{aligned}$$ + +This integral has the form of an inner product, +so we switch to [Dirac notation](/know/concept/dirac-notation/). +We differentiate with respect to $t$, +and use the backward equation $\ipdv{k}{t} + \hat{L} k = 0$: + +$$\begin{aligned} + 0 + = \pdv{}{t}\Inprod{k}{\phi} + = \Inprod{k}{\pdv{\phi}{t}} + \Inprod{\pdv{k}{t}}{\phi} + = \Inprod{k}{\pdv{\phi}{t}} - \Inprod{\hat{L} k}{\phi} + = \Inprod{k}{\pdv{\phi}{t} - \hat{L}{}^\dagger \phi} +\end{aligned}$$ + +Where $\hat{L}{}^\dagger$ is by definition the adjoint operator of $\hat{L}$, +which we calculate using partial integration, +where all boundary terms vanish thanks to the *existence* of $X_t$; +in other words, $X_t$ cannot reach infinity at any finite $t$, +so the integrand must decay to zero for $|y| \to \infty$: + +$$\begin{aligned} + \Inprod{\hat{L} k}{\phi} + &= \int_{-\infty}^\infty \pdv{k}{y} f \phi + \frac{1}{2} \pdvn{2}{k}{y} g^2 \phi \dd{y} + \\ + &= \bigg[ k f \phi + \frac{1}{2} \pdv{k}{y} g^2 \phi \bigg]_{-\infty}^\infty + - \int_{-\infty}^\infty k \pdv{}{y}(f \phi) + \frac{1}{2} \pdv{k}{y} \pdv{}{y}(g^2 \phi) \dd{y} + \\ + &= \bigg[ -\frac{1}{2} k g^2 \phi \bigg]_{-\infty}^\infty + + \int_{-\infty}^\infty - k \pdv{}{y}(f \phi) + \frac{1}{2} k \pdvn{2}{}{y}(g^2 \phi) \dd{y} + \\ + &= \int_{-\infty}^\infty k \: \big( \hat{L}{}^\dagger \phi \big) \dd{y} + = \Inprod{k}{\hat{L}{}^\dagger \phi} +\end{aligned}$$ + +Since $k$ is arbitrary, and $\ipdv{\Inprod{k}{\phi}}{t} = 0$ for all $k$, +we thus arrive at the **forward Kolmogorov equation**, +describing the evolution of the probability density $\phi(t, y)$: + +$$\begin{aligned} + \boxed{ + \pdv{\phi}{t} + = \hat{L}{}^\dagger \phi + = - \pdv{}{y}(f \phi) + \frac{1}{2} \pdvn{2}{}{y}(g^2 \phi) + } +\end{aligned}$$ + +This can be rewritten in a way +that highlights the connection between Itō diffusions and physical diffusion, +if we define the **diffusivity** $D$, **advection** $u$, and **probability flux** $J$: + +$$\begin{aligned} + D + \equiv \frac{1}{2} g^2 + \qquad \quad + u + = f - \pdv{D}{x} + \qquad \quad + J + \equiv u \phi - D \pdv{\phi}{x} +\end{aligned}$$ + +Such that the forward Kolmogorov equation takes the following **conservative form**, +so called because it looks like a physical continuity equation: + +$$\begin{aligned} + \boxed{ + \pdv{\phi}{t} + = - \pdv{J}{x} + = - \pdv{}{x}\Big( u \phi - D \pdv{\phi}{x} \Big) + } +\end{aligned}$$ + +Note that if $u = 0$, then this reduces to +[Fick's second law](/know/concept/ficks-laws/). +The backward Kolmogorov equation can also be rewritten analogously, +although it is less noteworthy: + +$$\begin{aligned} + \boxed{ + - \pdv{\psi}{t} + = u \pdv{\psi}{x} + \pdv{}{x}\Big( D \pdv{\psi}{x} \Big) + } +\end{aligned}$$ + +Notice that the diffusivity term looks the same +in both the forward and backward equations; +we say that diffusion is self-adjoint. + + + +## References +1. U.H. Thygesen, + *Lecture notes on diffusions and stochastic differential equations*, + 2021, Polyteknisk Kompendie. diff --git a/source/know/concept/kramers-kronig-relations/index.md b/source/know/concept/kramers-kronig-relations/index.md new file mode 100644 index 0000000..f66ab0a --- /dev/null +++ b/source/know/concept/kramers-kronig-relations/index.md @@ -0,0 +1,135 @@ +--- +title: "Kramers-Kronig relations" +date: 2021-02-25 +categories: +- Mathematics +- Complex analysis +- Physics +- Optics +layout: "concept" +--- + +Let $\chi(t)$ be a complex function describing +the response of a system to an impulse $f(t)$ starting at $t = 0$. +The **Kramers-Kronig relations** connect the real and imaginary parts of $\chi(t)$, +such that one can be reconstructed from the other. +Suppose we can only measure $\chi_r(t)$ or $\chi_i(t)$: + +$$\begin{aligned} + \chi(t) = \chi_r(t) + i \chi_i(t) +\end{aligned}$$ + +Assuming that the system was at rest until $t = 0$, +the response $\chi(t)$ cannot depend on anything from $t < 0$, +since the known impulse $f(t)$ had not started yet, +This principle is called **causality**, and to enforce it, +we use the [Heaviside step function](/know/concept/heaviside-step-function/) +$\Theta(t)$ to create a **causality test** for $\chi(t)$: + +$$\begin{aligned} + \chi(t) = \chi(t) \: \Theta(t) +\end{aligned}$$ + +If we [Fourier transform](/know/concept/fourier-transform/) this equation, +then it will become a convolution in the frequency domain +thanks to the [convolution theorem](/know/concept/convolution-theorem/), +where $A$, $B$ and $s$ are constants from the FT definition: + +$$\begin{aligned} + \tilde{\chi}(\omega) + = (\tilde{\chi} * \tilde{\Theta})(\omega) + = B \int_{-\infty}^\infty \tilde{\chi}(\omega') \: \tilde{\Theta}(\omega - \omega') \dd{\omega'} +\end{aligned}$$ + +We look up the FT of the step function $\tilde{\Theta}(\omega)$, +which involves the signum function $\mathrm{sgn}(t)$, +the [Dirac delta function](/know/concept/dirac-delta-function/) $\delta$, +and the Cauchy principal value $\pv{}$. +We arrive at: + +$$\begin{aligned} + \tilde{\chi}(\omega) + &= \frac{A B}{|s|} \pv{\int_{-\infty}^\infty \tilde{\chi}(\omega') + \Big( \pi \delta(\omega - \omega') + i \:\mathrm{sgn} \frac{1}{\omega - \omega'} \Big) \dd{\omega'}} + \\ + &= \Big( \frac{1}{2} \frac{2 \pi A B}{|s|} \Big) \tilde{\chi}(\omega) + + i \Big( \frac{\mathrm{sgn}(s)}{2 \pi} \frac{2 \pi A B}{|s|} \Big) + \pv{\int_{-\infty}^\infty \frac{\tilde{\chi}(\omega')}{\omega - \omega'} \dd{\omega'}} +\end{aligned}$$ + +From the definition of the Fourier transform we know that $2 \pi A B / |s| = 1$: + +$$\begin{aligned} + \tilde{\chi}(\omega) + &= \frac{1}{2} \tilde{\chi}(\omega) + + \mathrm{sgn}(s) \frac{i}{2 \pi} \pv{\int_{-\infty}^\infty \frac{\tilde{\chi}(\omega')}{\omega - \omega'} \dd{\omega'}} +\end{aligned}$$ + +We isolate this equation for $\tilde{\chi}(\omega)$ +to get the final version of the causality test: + +$$\begin{aligned} + \boxed{ + \tilde{\chi}(\omega) + = - \mathrm{sgn}(s) \frac{i}{\pi} \pv{\int_{-\infty}^\infty \frac{\tilde{\chi}(\omega')}{\omega - \omega'} \dd{\omega'}} + } +\end{aligned}$$ + +By inserting $\tilde{\chi}(\omega) = \tilde{\chi}_r(\omega) + i \tilde{\chi}_i(\omega)$ +and splitting the equation into real and imaginary parts, +we get the Kramers-Kronig relations: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \tilde{\chi}_r(\omega) + &= \mathrm{sgn}(s) \frac{1}{\pi} \pv{\int_{-\infty}^\infty \frac{\tilde{\chi}_i(\omega')}{\omega' - \omega} \dd{\omega'}} + \\ + \tilde{\chi}_i(\omega) + &= - \mathrm{sgn}(s) \frac{1}{\pi} \pv{\int_{-\infty}^\infty \frac{\tilde{\chi}_r(\omega')}{\omega' - \omega} \dd{\omega'}} + \end{aligned} + } +\end{aligned}$$ + +If the time-domain response function $\chi(t)$ is real +(so far we have assumed it to be complex), +then we can take advantage of the fact that +the FT of a real function satisfies +$\tilde{\chi}(-\omega) = \tilde{\chi}^*(\omega)$, i.e. $\tilde{\chi}_r(\omega)$ +is even and $\tilde{\chi}_i(\omega)$ is odd. We multiply the fractions by +$(\omega' + \omega)$ above and below: + +$$\begin{aligned} + \tilde{\chi}_r(\omega) + &= \mathrm{sgn}(s) \bigg( \frac{1}{\pi} \pv{\int_{-\infty}^\infty \frac{\omega' \tilde{\chi}_i(\omega')}{ {\omega'}^2 - \omega^2} \dd{\omega'}} + + \frac{\omega}{\pi} \pv{\int_{-\infty}^\infty \frac{\tilde{\chi}_i(\omega')}{ {\omega'}^2 - \omega^2} \dd{\omega'}} \bigg) + \\ + \tilde{\chi}_i(\omega) + &= - \mathrm{sgn}(s) \bigg( \frac{1}{\pi} \pv{\int_{-\infty}^\infty \frac{\omega' \tilde{\chi}_r(\omega')}{ {\omega'}^2 - \omega^2} \dd{\omega'}} + + \frac{\omega}{\pi} \pv{\int_{-\infty}^\infty \frac{\tilde{\chi}_r(\omega')}{ {\omega'}^2 - \omega^2} \dd{\omega'}} \bigg) +\end{aligned}$$ + +For $\tilde{\chi}_r(\omega)$, the second integrand is odd, so we can drop it. +Similarly, for $\tilde{\chi}_i(\omega)$, the first integrand is odd. +We therefore find the following variant of the Kramers-Kronig relations: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \tilde{\chi}_r(\omega) + &= \mathrm{sgn}(s) \frac{2}{\pi} \pv{\int_0^\infty \frac{\omega' \tilde{\chi}_i(\omega')}{ {\omega'}^2 - \omega^2} \dd{\omega'}} + \\ + \tilde{\chi}_i(\omega) + &= - \mathrm{sgn}(s) \frac{2 \omega}{\pi} \pv{\int_0^\infty \frac{\tilde{\chi}_r(\omega')}{ {\omega'}^2 - \omega^2} \dd{\omega'}} + \end{aligned} + } +\end{aligned}$$ + +To reiterate: this version is only valid if $\chi(t)$ is real in the time domain. + + + +## References +1. M. Wubs, + *Optical properties of solids: Kramers-Kronig relations*, 2013, + unpublished. diff --git a/source/know/concept/kubo-formula/index.md b/source/know/concept/kubo-formula/index.md new file mode 100644 index 0000000..40d90e1 --- /dev/null +++ b/source/know/concept/kubo-formula/index.md @@ -0,0 +1,170 @@ +--- +title: "Kubo formula" +date: 2021-09-23 +categories: +- Physics +- Quantum mechanics +- Perturbation +layout: "concept" +--- + +Consider the following quantum Hamiltonian, +split into a main time-independent term $\hat{H}_{0,S}$ +and a small time-dependent perturbation $\hat{H}_{1,S}$, +which is turned on at $t = t_0$: + +$$\begin{aligned} + \hat{H}_S(t) + = \hat{H}_{0,S} + \hat{H}_{1,S}(t) +\end{aligned}$$ + +And let $\Ket{\psi_S(t)}$ be the corresponding solutions to the Schrödinger equation. +Then, given a time-independent observable $\hat{A}$, +its expectation value $\expval{\hat{A}}$ evolves like so, +where the subscripts $S$ and $I$ +respectively refer to the Schrödinger +and [interaction pictures](/know/concept/interaction-picture/): + +$$\begin{aligned} + \expval{\hat{A}}(t) + = \matrixel{\psi_S(t)}{\hat{A}_S}{\psi_S(t)} + &= \matrixel{\psi_I(t)}{\hat{A}_I(t)}{\psi_I(t)} + \\ + &= \matrixel{\psi_I(t_0)\,}{\,\hat{K}_I^\dagger(t, t_0) \hat{A}_I(t) \hat{K}_I(t, t_0)\,}{\,\psi_I(t_0)} +\end{aligned}$$ + +Where the time evolution operator $\hat{K}_I(t, t_0)$ is as follows, +which we Taylor-expand: + +$$\begin{aligned} + \hat{K}_I(t, t_0) + = \mathcal{T} \bigg\{ \exp\!\bigg( \frac{1}{i \hbar} \int_{t_0}^t \hat{H}_{1,I}(t') \dd{t'} \bigg) \bigg\} + \approx 1 - \frac{i}{\hbar} \int_{t_0}^t \hat{H}_{1,I}(t') \dd{t'} +\end{aligned}$$ + +With this, the following product of operators (as encountered earlier) can be written as: + +$$\begin{aligned} + \hat{K}_I^\dagger \hat{A}_I \hat{K}_I + &\approx \bigg( 1 + \frac{i}{\hbar} \int_{t_0}^t \hat{H}_{1,I}(t') \dd{t'} \bigg) \hat{A}_I(t) + \bigg( 1 - \frac{i}{\hbar} \int_{t_0}^t \hat{H}_{1,I}(t') \dd{t'} \bigg) + \\ + &\approx \hat{A}_I(t) + - \frac{i}{\hbar} \int_{t_0}^t \hat{A}_I(t) \hat{H}_{1,I}(t') \dd{t'} + + \frac{i}{\hbar} \int_{t_0}^t \hat{H}_{1,I}(t') \hat{A}_I(t) \dd{t'} +\end{aligned}$$ + +Where we have dropped the last term, +because $\hat{H}_{1}$ is assumed to be so small +that it only matters to first order. +Here, we notice a commutator, so we can rewrite: + +$$\begin{aligned} + \hat{K}_I^\dagger \hat{A}_I \hat{K}_I + &= \hat{A}_I(t) - \frac{i}{\hbar} \int_{t_0}^t \Comm{\hat{A}_I(t)}{\hat{H}_{1,I}(t')} \dd{t'} +\end{aligned}$$ + +Returning to $\expval{\hat{A}}$, +we have the following formula, +where $\Expval{}$ is the expectation value for $\Ket{\psi(t)}$, +and $\Expval{}_0$ is the expectation value for $\Ket{\psi_I(t_0)}$: + +$$\begin{aligned} + \expval{\hat{A}}(t) + = \expval{\hat{K}_I^\dagger \hat{A}_I \hat{K}_I}_0 + = \expval{\hat{A}_I(t)}_0 - \frac{i}{\hbar} \int_{t_0}^t \Expval{\Comm{\hat{A}_I(t)}{\hat{H}_{1,I}(t')}}_0 \dd{t'} +\end{aligned}$$ + +Now we define $\delta\!\expval{\hat{A}}\!(t)$ +as the change of $\expval{\hat{A}}$ due to the perturbation $\hat{H}_1$, +and insert $\expval{\hat{A}}(t)$: + +$$\begin{aligned} + \delta\!\expval{\hat{A}}\!(t) + \equiv \expval{\hat{A}}(t) - \expval{\hat{A}_I}_0 + = - \frac{i}{\hbar} \int_{t_0}^t \Expval{\Comm{\hat{A}_I(t)}{\hat{H}_{1,I}(t')}}_0 \dd{t'} +\end{aligned}$$ + +Finally, we introduce +a [Heaviside step function](/know/concept/heaviside-step-function) $\Theta$ +and change the integration limit accordingly, +leading to the **Kubo formula** +describing the response of $\expval{\hat{A}}$ to first order in $\hat{H}_1$: + +$$\begin{aligned} + \boxed{ + \delta\!\expval{\hat{A}}\!(t) + = \int_{t_0}^\infty C^R_{A H_1}(t, t') \dd{t'} + } +\end{aligned}$$ + +Where we have defined the **retarded correlation function** $C^R_{A H_1}(t, t')$ as follows: + +$$\begin{aligned} + \boxed{ + C^R_{A H_1}(t, t') + \equiv - \frac{i}{\hbar} \Theta(t \!-\! t') \Expval{\Comm{\hat{A}_I(t)}{\hat{H}_{1,I}(t')}}_0 + } +\end{aligned}$$ + +Note that observables are bosonic, +because in the [second quantization](/know/concept/second-quantization/) +they consist of products of even numbers +of particle creation/annihiliation operators. +Therefore, this correlation function +is a two-particle [Green's function](/know/concept/greens-functions/). + +A common situation is that $\hat{H}_1$ consists of +a time-independent operator $\hat{B}$ +and a time-dependent function $f(t)$, +allowing us to split $C^R_{A H_1}$ as follows: + +$$\begin{aligned} + \hat{H}_{1,S}(t) + = \hat{B}_S \: f(t) + \quad \implies \quad + C^R_{A H_1}(t, t') + = C^R_{A B}(t, t') f(t') +\end{aligned}$$ + +Since $C_{AB}^R$ is a Green's function, +we know that it only depends on the difference $t - t'$, +as long as the system was initially in thermodynamic equilibrium, +and $\hat{H}_{0,S}$ is time-independent: + +$$\begin{aligned} + C^R_{A B}(t, t') + = C^R_{A B}(t - t') +\end{aligned}$$ + +With this, the Kubo formula can be written as follows, +where we have set $t_0 = - \infty$: + +$$\begin{aligned} + \delta\!\expval{A}\!(t) + = \int_{-\infty}^\infty C^R_{A B}(t - t') f(t') \dd{t'} + = (C^R_{A B} * f)(t) +\end{aligned}$$ + +This is a convolution, +so the [convolution theorem](/know/concept/convolution-theorem/) +states that the [Fourier transform](/know/concept/fourier-transform/) +of $\delta\!\expval{\hat{A}}\!(t)$ is simply the product +of the transforms of $C^R_{AB}$ and $f$: + +$$\begin{aligned} + \boxed{ + \delta\!\expval{\hat{A}}\!(\omega) + = \tilde{C}{}^R_{A B}(\omega) \: \tilde{f}(\omega) + } +\end{aligned}$$ + + + +## References +1. H. Bruus, K. Flensberg, + *Many-body quantum theory in condensed matter physics*, + 2016, Oxford. +2. K.S. Thygesen, + *Advanced solid state physics: linear response theory*, + 2013, unpublished. diff --git a/source/know/concept/lagrange-multiplier/index.md b/source/know/concept/lagrange-multiplier/index.md new file mode 100644 index 0000000..4c01aed --- /dev/null +++ b/source/know/concept/lagrange-multiplier/index.md @@ -0,0 +1,121 @@ +--- +title: "Lagrange multiplier" +date: 2021-03-02 +categories: +- Mathematics +- Physics +layout: "concept" +--- + +The method of **Lagrange multipliers** or **undetermined multipliers** +is a technique for optimizing (i.e. finding the extrema of) +a function $f(x, y, z)$, +subject to a given constraint $\phi(x, y, z) = C$, +where $C$ is a constant. + +If we ignore the constraint $\phi$, +optimizing $f$ simply comes down to finding stationary points: + +$$\begin{aligned} + 0 &= \dd{f} = f_x \dd{x} + f_y \dd{y} + f_z \dd{z} +\end{aligned}$$ + +This problem is easy: +$\dd{x}$, $\dd{y}$, and $\dd{z}$ are independent and arbitrary, +so all we need to do is find the roots of +the partial derivatives $f_x$, $f_y$ and $f_z$, +which we respectively call $x_0$, $y_0$ and $z_0$, +and then the extremum is simply $(x_0, y_0, z_0)$. + +But the constraint $\phi$, over which we have no control, +adds a relation between $\dd{x}$, $\dd{y}$, and $\dd{z}$, +so if two are known, the third is given by $\phi = C$. +The problem is then a system of equations: + +$$\begin{aligned} + 0 &= \dd{f} = f_x \dd{x} + f_y \dd{y} + f_z \dd{z} + \\ + 0 &= \dd{\phi} = \phi_x \dd{x} + \phi_y \dd{y} + \phi_z \dd{z} +\end{aligned}$$ + +Solving this directly would be a delicate balancing act +of all the partial derivatives. + +To help us solve this, we introduce a "dummy" parameter $\lambda$, +the so-called **Lagrange multiplier**, +and contruct a new function $L$ given by: + +$$\begin{aligned} + L(x, y, z) = f(x, y, z) + \lambda \phi(x, y, z) +\end{aligned}$$ + +At the extremum, $\dd{L} = \dd{f} + \lambda \dd{\phi} = 0$, +so now the problem is a "single" equation again: + +$$\begin{aligned} + 0 = \dd{L} + = (f_x + \lambda \phi_x) \dd{x} + (f_y + \lambda \phi_y) \dd{y} + (f_z + \lambda \phi_z) \dd{z} +\end{aligned}$$ + +Assuming $\phi_z \neq 0$, we now choose $\lambda$ such that $f_z + \lambda \phi_z = 0$. +This choice represents satisfying the constraint, +so now the remaining $\dd{x}$ and $\dd{y}$ are independent again, +and we simply have to find the roots of $f_x + \lambda \phi_x$ and $f_y + \lambda \phi_y$. + +In effect, after introducing $\lambda$, +we have four unknowns $(x, y, z, \lambda)$, +but also four equations: + +$$\begin{aligned} + L_x = L_y = L_z = 0 + \qquad \quad + \phi = C +\end{aligned}$$ + +We are only really interested in the first three unknowns $(x, y, z)$, +so $\lambda$ is sometimes called the **undetermined multiplier**, +since it is just an algebraic helper whose value is irrelevant. + +This method generalizes nicely to multiple constraints or more variables: +suppose that we want to find the extrema of $f(x_1, ..., x_N)$ +subject to $M < N$ conditions: + +$$\begin{aligned} + \phi_1(x_1, ..., x_N) = C_1 \qquad \cdots \qquad \phi_M(x_1, ..., x_N) = C_M +\end{aligned}$$ + +This once again turns into a delicate system of $M+1$ equations to solve: + +$$\begin{aligned} + 0 &= \dd{f} = f_{x_1} \dd{x_1} + ... + f_{x_N} \dd{x_N} + \\ + 0 &= \dd{\phi_1} = \phi_{1, x_1} \dd{x_1} + ... + \phi_{1, x_N} \dd{x_N} + \\ + &\vdots + \\ + 0 &= \dd{\phi_M} = \phi_{M, x_1} \dd{x_1} + ... + \phi_{M, x_N} \dd{x_N} +\end{aligned}$$ + +Then we introduce $M$ Lagrange multipliers $\lambda_1, ..., \lambda_M$ +and define $L(x_1, ..., x_N)$: + +$$\begin{aligned} + L = f + \sum_{m = 1}^M \lambda_m \phi_m +\end{aligned}$$ + +As before, we set $\dd{L} = 0$ and choose the multipliers $\lambda_1, ..., \lambda_M$ +to eliminate $M$ of its $N$ terms: + +$$\begin{aligned} + 0 = \dd{L} + = \sum_{n = 1}^N \Big( f_{x_n} + \sum_{m = 1}^M \lambda_m \phi_{x_n} \Big) \dd{x_n} +\end{aligned}$$ + + +## References +1. G.B. Arfken, H.J. Weber, + *Mathematical methods for physicists*, 6th edition, 2005, + Elsevier. +2. O. Bang, + *Applied mathematics for physicists: lecture notes*, 2019, + unpublished. diff --git a/source/know/concept/lagrangian-mechanics/index.md b/source/know/concept/lagrangian-mechanics/index.md new file mode 100644 index 0000000..fd26121 --- /dev/null +++ b/source/know/concept/lagrangian-mechanics/index.md @@ -0,0 +1,129 @@ +--- +title: "Lagrangian mechanics" +date: 2021-07-01 +categories: +- Physics +- Classical mechanics +layout: "concept" +--- + +**Lagrangian mechanics** is a formulation of classical mechanics, +which is equivalent to Newton's laws, +but offers some advantages. +Its mathematical backbone is the +[calculus of variations](/know/concept/calculus-of-variations/), +and hence it is built on the **principle of least action**, +which states that the path taken by a system +will be a minimum of the **action** (i.e. energy cost) of that path. + +For a moving object with position $x(t)$ and velocity $\dot{x}(t)$, +we define the Lagrangian $L$ as the difference +between its kinetic and potential energies: + +$$\begin{aligned} + \boxed{ + L(x, \dot{x}, t) \equiv T - V = \frac{1}{2} m \dot{x}^2 - V(x) + } +\end{aligned}$$ + +From variational calculus we then get the Euler-Lagrange equation, +which in this case turns out to just be Newton's second law: + +$$\begin{aligned} + \dv{}{t}\Big( \pdv{L}{\dot{x}} \Big) = \pdv{L}{x} + \qquad \implies \qquad + m \ddot{x} = - \pdv{V}{x} = F +\end{aligned}$$ + +But compared to Newtonian mechanics, +Lagrangian mechanics scales better for large systems. +For example, to describe the dynamics of $N$ objects $x_1(t), ..., x_N(t)$, +we only need a single $L$ +from which the equations of motion can easily be derived. +Getting these equations directly from Newton's laws could get messy. + +At no point have we assumed Cartesian coordinates: +the Euler-Lagrange equations keep their form +for any independent coordinates $q_1(t), ..., q_N(t)$: + +$$\begin{aligned} + \dv{}{t}\Big( \pdv{L}{\dot{q}_n} \Big) = \pdv{L}{q_n} +\end{aligned}$$ + +We define the **canonical momentum conjugate** $p_n(t)$ +and the **generalized force conjugate** $F_n(t)$ as follows, +such that we can always get Newton's second law: + +$$\begin{aligned} + \boxed{ + p_n \equiv \pdv{L}{\dot{q}_n} \qquad F_n \equiv \pdv{L}{q_n} + } + \qquad \implies \qquad + \dv{p_n}{t} = F_n +\end{aligned}$$ + +But this is actually a bit misleading, +since $p_n$ need not be a momentum, nor $F_n$ a force, +although often they are. +For example, $p_n$ could be angular momentum, and $F_n$ torque. + +Another advantage of Lagrangian mechanics is that +the conserved quantities can be extracted from $L$ using Noether's theorem. +In the simplest case, if $L$ does not depend on $q_n$ +(then known as a **cyclic coordinate**), +then we know that the "momentum" $p_n$ is a conserved quantity: + +$$\begin{aligned} + F_n = \pdv{L}{q_n} = 0 + \qquad \implies \qquad + \dv{p_n}{t} = 0 +\end{aligned}$$ + +Now, as the number of particles $N$ increases to infinity, +variational calculus will give infinitely many coupled equations, +which is obviously impractical. + +Such a system can be regarded as continuous, so the $N$ functions $q_n$ +can be replaced by a single density function $u(x,t)$. +This approach can also be used for continuous fields, +in which case the complex conjugate $u^*$ is often included. +The Lagrangian $L$ then becomes: + +$$\begin{aligned} + L(u, u^*, u_x, u_x^*, u_t, u_t^*, x, t) + = \int_{-\infty}^\infty \mathcal{L}(u, u^*, u_x, u_x^*, u_t, u_t^*, x, t) \dd{x} +\end{aligned}$$ + +Where $\mathcal{L}$ is known as the **Lagrangian density**. +By inserting this into the functional $J$ +used for the derivation of the Euler-Lagrange equations, we get: + +$$\begin{aligned} + J[u] + = \int_{t_0}^{t_1} L \dd{t} + = \int_{t_0}^{t_1} \! \int_{-\infty}^\infty \mathcal{L} \dd{x} \dd{t} +\end{aligned}$$ + +This is simply 2D variational problem, +so the Euler-Lagrange equations will be two PDEs: + +$$\begin{aligned} + 0 &= \pdv{\mathcal{L}}{u} - \pdv{}{x}\Big( \pdv{\mathcal{L}}{u_x} \Big) - \pdv{}{t}\Big( \pdv{\mathcal{L}}{u_t} \Big) + \\ + 0 &= \pdv{\mathcal{L}}{u^*} - \pdv{}{x}\Big( \pdv{\mathcal{L}}{u_x^*} \Big) - \pdv{}{t}\Big( \pdv{\mathcal{L}}{u_t^*} \Big) +\end{aligned}$$ + +If $\mathcal{L}$ is real, +then these two Euler-Lagrange equations will in fact be identical. + +Finally, note that for abstract fields, +the Lagrangian density $\mathcal{L}$ rarely has +a physical interpretation, and is not unique. +Instead, it must be reverse-engineered from a relevant equation. + + + +## References +1. R. Shankar, + *Principles of quantum mechanics*, 2nd edition, + Springer. diff --git a/source/know/concept/laguerre-polynomials/index.md b/source/know/concept/laguerre-polynomials/index.md new file mode 100644 index 0000000..130dff2 --- /dev/null +++ b/source/know/concept/laguerre-polynomials/index.md @@ -0,0 +1,125 @@ +--- +title: "Laguerre polynomials" +date: 2021-09-08 +categories: +- Mathematics +layout: "concept" +--- + +The **Laguerre polynomials** are a set of useful functions that arise in physics. +They are the non-singular eigenfunctions $u(x)$ of **Laguerre's equation**, +with the corresponding eigenvalues $n$ being non-negative integers: + +$$\begin{aligned} + \boxed{ + x u'' + (1 - x) u' + n u = 0 + } +\end{aligned}$$ + +The $n$th-order Laguerre polynomial $L_n(x)$ +is given in the form of a *Rodrigues' formula* by: + +$$\begin{aligned} + L_n(x) + &= \frac{1}{n!} \exp(x) \dvn{n}{}{x}\big(x^n \exp(-x)\big) + \\ + &= \frac{1}{n!} \Big( \dv{}{x}- 1 \Big)^n x^n +\end{aligned}$$ + +The first couple of Laguerre polynomials $L_n(x)$ are therefore as follows: + +$$\begin{gathered} + L_0(x) = 1 + \qquad \quad + L_1(x) = 1 - x + \qquad \quad + L_2(x) = \frac{1}{2} (x^2 - 4 x + 2) +\end{gathered}$$ + +Based on Laguerre's equation, +**Laguerre's generalized equation** is as follows, +with an arbitrary real (but usually integer) parameter $\alpha$, +and $n$ still a non-negative integer: + +$$\begin{aligned} + \boxed{ + x u'' + (\alpha + 1 - x) u' + n u = 0 + } +\end{aligned}$$ + +Its solutions, denoted by $L_n^\alpha(x)$, +are the **generalized** or **associated Laguerre polynomials**, +which also have a Rodrigues' formula. +Note that if $\alpha = 0$ then $L_n^\alpha = L_n$: + +$$\begin{aligned} + L_n^\alpha(x) + &= \frac{1}{n!} x^{-\alpha} \exp(x) \dvn{n}{}{x}\big( x^{n + \alpha} \exp(-x) \big) + \\ + &= \frac{x^{-\alpha}}{n!} \Big( \dv{}{x}- 1 \Big)^n x^{n + \alpha} +\end{aligned}$$ + +The first couple of associated Laguerre polynomials $L_n^\alpha(x)$ are therefore as follows: + +$$\begin{aligned} + L_0^\alpha(x) = 1 + \qquad + L_1^\alpha(x) = \alpha + 1 - x + \qquad + L_2^\alpha(x) = \frac{1}{2} (x^2 - 2 \alpha x - 4 x + \alpha^2 + 3 \alpha + 2) +\end{aligned}$$ + +And then more $L_n^\alpha$ can be computed quickly +using the following recurrence relation: + +$$\begin{aligned} + \boxed{ + L_{n + 1}^\alpha(x) + = \frac{(\alpha + 2 n + 1 - x) L_n^\alpha(x) - (\alpha + n) L_{n - 1}^\alpha(x)}{n + 1} + } +\end{aligned}$$ + +The derivatives are also straightforward to calculate +using the following relation: + +$$\begin{aligned} + \boxed{ + \dvn{k}{}{x}L_n^\alpha(x) + = (-1)^k L_{n - k}^{\alpha + k}(x) + } +\end{aligned}$$ + +Noteworthy is that these polynomials (both normal and associated) +are all mutually orthogonal for $x \in [0, \infty[$, +with respect to the weight function $w(x) \equiv x^\alpha \exp(-x)$: + +$$\begin{aligned} + \boxed{ + \Inprod{L_m^\alpha}{w L_n^\alpha} + = \int_0^\infty L_m^\alpha(x) \: L_n^\alpha(x) \: w(x) \dd{x} + = \frac{\Gamma(n + \alpha + 1)}{n!} \delta_{nm} + } +\end{aligned}$$ + +Where $\delta_{nm}$ is the Kronecker delta. +Moreover, they form a basis in +the [Hilbert space](/know/concept/hilbert-space/) +of all functions $f(x)$ for which $\Inprod{f}{w f}$ is finite. +Any such $f$ can thus be expanded as follows: + +$$\begin{aligned} + \boxed{ + f(x) + = \sum_{n = 0}^\infty a_n L_n^\alpha(x) + = \sum_{n = 0}^\infty \frac{\Inprod{L_n}{w f}}{\Inprod{L_n}{w L_n}} L_n^\alpha(x) + } +\end{aligned}$$ + +Finally, the $L_n^\alpha(x)$ are related to +the [Hermite polynomials](/know/concept/hermite-polynomials/) $H_n(x)$ like so: + +$$\begin{aligned} + H_{2n(x)} &= (-1)^n 2^{2n} n! \: L_n^{-1/2}(x^2) + \\ + H_{2n + 1(x)} &= (-1)^n 2^{2n + 1} n! \: L_n^{1/2}(x^2) +\end{aligned}$$ diff --git a/source/know/concept/landau-quantization/index.md b/source/know/concept/landau-quantization/index.md new file mode 100644 index 0000000..e28b396 --- /dev/null +++ b/source/know/concept/landau-quantization/index.md @@ -0,0 +1,122 @@ +--- +title: "Landau quantization" +date: 2021-07-01 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +When a particle with charge $q$ is moving in a homogeneous +[magnetic field](/know/concept/magnetic-field/), +quantum mechanics decrees that its allowed energies split +into degenerate discrete **Landau levels**, +a phenomenon known as **Landau quantization**. + +Starting from the Hamiltonian $\hat{H}$ for a particle with mass $m$ +in a vector potential $\vec{A}(\hat{Q})$: + +$$\begin{aligned} + \hat{H} + &= \frac{1}{2 m} \big( \hat{p} - q \vec{A} \big)^2 +\end{aligned}$$ + +We choose $\vec{A} = (- \hat{y} B, 0, 0)$, +yielding a magnetic field $\vec{B} = \nabla \times \vec{A}$ +pointing in the $z$-direction with strength $B$. +The Hamiltonian becomes: + +$$\begin{aligned} + \hat{H} + &= \frac{\big( \hat{p}_x - q B \hat{y} \big)^2}{2 m} + \frac{\hat{p}_y^2}{2 m} + \frac{\hat{p}_z^2}{2 m} +\end{aligned}$$ + +The only position operator occurring in $\hat{H}$ is $\hat{y}$, +so $[\hat{H}, \hat{p}_x] = [\hat{H}, \hat{p}_z] = 0$. +Because $\hat{p}_z$ appears in an unmodified kinetic energy term, +and the corresponding $\hat{z}$ does not occur at all, +the particle has completely free motion in the $z$-direction. +Likewise, because $\hat{x}$ does not occur in $\hat{H}$, +we can replace $\hat{p}_x$ by its eigenvalue $\hbar k_x$, +although the motion is not free, due to $q B \hat{y}$. + +Based on the absence of $\hat{x}$ and $\hat{z}$, +we make the following ansatz for the wavefunction $\Psi$: +a plane wave in the $x$ and $z$ directions, multiplied by an unknown $\phi(y)$: + +$$\begin{aligned} + \Psi(x, y, z) + = \phi(y) \exp(i k_x x + i k_z z) +\end{aligned}$$ + +Inserting this into the time-independent Schrödinger equation gives, +after dividing out the plane wave exponential $\exp(i k_x x + i k_z z)$: + +$$\begin{aligned} + E \phi + &= \frac{1}{2 m} \Big( (\hbar k_x - q B y)^2 + \hat{p}_y^2 + \hbar^2 k_z^2 \Big) \phi +\end{aligned}$$ + +By defining the cyclotron frequency $\omega_c \equiv q B / m$ and rearranging, +we can turn this into a 1D quantum harmonic oscillator in $y$, +with a couple of extra terms: + +$$\begin{aligned} + \Big( E - \frac{\hbar^2 k_z^2}{2 m} \Big) \phi + &= \bigg( \frac{1}{2} m \omega_c^2 \Big( y - \frac{\hbar k_x}{m \omega_c} \Big)^2 + \frac{\hat{p}_y^2}{2 m} \bigg) \phi +\end{aligned}$$ + +The potential minimum is shifted by $y_0 = \hbar k_x / (m \omega_c)$, +and a plane wave in $z$ contributes to the energy $E$. +In any case, the energy levels of this type of system are well-known: + +$$\begin{aligned} + \boxed{ + E_n = \hbar \omega_c \Big(n + \frac{1}{2}\Big) + \frac{\hbar^2 k_z^2}{2 m} + } +\end{aligned}$$ + +And $\Psi_n$ is then as follows, +where $\phi$ is the known quantum harmonic oscillator solution: + +$$\begin{aligned} + \Psi_n(x, y, z) + = \phi_n(y - y_0) \exp(i k_x x + i k_z z) +\end{aligned}$$ + +Note that this wave function contains $k_x$ (also inside $y_0$), +but $k_x$ is absent from the energy $E_n$. +This implies degeneracy: +assuming periodic boundary conditions $\Psi(x\!+\!L_x) = \Psi(x)$, +then $k_x$ can take values of the form $2 \pi n / L_x$, for $n \in \mathbb{Z}$. + +However, $k_x$ also occurs in the definition of $y_0$, so the degeneracy +is finite, since $y_0$ must still lie inside the system, +or, more formally, $y_0 \in [0, L_y]$: + +$$\begin{aligned} + 0 \le y_0 = \frac{\hbar k_x}{m \omega_c} = \frac{\hbar 2 \pi n}{q B L_x} \le L_y +\end{aligned}$$ + +Isolating this for $n$, we find the following upper bound of the degeneracy: + +$$\begin{aligned} + \boxed{ + n \le + \frac{q B L_x L_y}{2 \pi \hbar} = \frac{q B A}{h} + } +\end{aligned}$$ + +Where $A \equiv L_x L_y$ is the area of the confinement in the $(x,y)$-plane. +Evidently, the degeneracy of each level increases with larger $B$, +but since $\omega_c = q B / m$, the energy gap between each level increases too. +In other words: the [density of states](/know/concept/density-of-states/) +is a constant with respect to the energy, +but the states get distributed across the $E_n$ differently depending on $B$. + + + +## References +1. L.E. Ballentine, + *Quantum mechanics: a modern development*, 2nd edition, + World Scientific. diff --git a/source/know/concept/langmuir-waves/index.md b/source/know/concept/langmuir-waves/index.md new file mode 100644 index 0000000..b5f3fd4 --- /dev/null +++ b/source/know/concept/langmuir-waves/index.md @@ -0,0 +1,256 @@ +--- +title: "Langmuir waves" +date: 2021-10-30 +categories: +- Physics +- Plasma physics +- Plasma waves +- Perturbation +layout: "concept" +--- + +In plasma physics, **Langmuir waves** are oscillations in the electron density, +which may or may not propagate, depending on the temperature. + +Assuming no [magnetic field](/know/concept/magnetic-field/) $\vb{B} = 0$, +no ion motion $\vb{u}_i = 0$ (since $m_i \gg m_e$), +and therefore no ion-electron momentum transfer, +the [two-fluid equations](/know/concept/two-fluid-equations/) +tell us that: + +$$\begin{aligned} + m_e n_e \frac{\mathrm{D} \vb{u}_e}{\mathrm{D} t} + = q_e n_e \vb{E} - \nabla p_e + \qquad \quad + \pdv{n_e}{t} + \nabla \cdot (n_e \vb{u}_e) = 0 +\end{aligned}$$ + +These are the electron momentum and continuity equations. +We also need [Gauss' law](/know/concept/maxwells-equations/): + +$$\begin{aligned} + \varepsilon_0 \nabla \cdot \vb{E} + = q_e (n_e - n_i) +\end{aligned}$$ + +We split $n_e$, $\vb{u}_e$ and $\vb{E}$ into a base component +(subscript $0$) and a perturbation (subscript $1$): + +$$\begin{aligned} + n_e + = n_{e0} + n_{e1} + \qquad \quad + \vb{u}_e + = \vb{u}_{e0} + \vb{u}_{e1} + \qquad \quad + \vb{E} + = \vb{E}_0 + \vb{E}_1 +\end{aligned}$$ + +Where the perturbations $n_{e1}$, $\vb{u}_{e1}$ and $\vb{E}_1$ are very small, +and the equilibrium components $n_{e0}$, $\vb{u}_{e0}$ and $\vb{E}_0$ +by definition satisfy: + +$$\begin{aligned} + \pdv{n_{e0}}{t} = 0 + \qquad + \pdv{\vb{u}_{e0}}{t} = 0 + \qquad + \nabla n_{e0} = 0 + \qquad + \vb{u}_{e0} = 0 + \qquad + \vb{E}_0 = 0 +\end{aligned}$$ + +We insert this decomposistion into the electron continuity equation, +arguing that $n_{e1} \vb{u}_{e1}$ is small enough to neglect, leading to: + +$$\begin{aligned} + 0 + &= \pdv{(n_{e0}\!+\! n_{e1})}{t} + \nabla \cdot \Big( (n_{e0} \!+\! n_{e1}) \: (\vb{u}_{e0} \!+\! \vb{u}_{e1}) \Big) + \\ + &= \pdv{n_{e1}}{t} + \nabla \cdot \Big( n_{e0} \vb{u}_{e1} + n_{e1} \vb{u}_{e1} \Big) + \\ + &\approx \pdv{n_{e1}}{t} + \nabla \cdot (n_{e0} \vb{u}_{e1}) + = \pdv{n_{e1}}{t} + n_{e0} \nabla \cdot \vb{u}_{e1} +\end{aligned}$$ + +Likewise, we insert it into Gauss' law, +and use the plasma's quasi-neutrality $n_i = n_{e0}$ to get: + +$$\begin{aligned} + \varepsilon_0 \nabla \cdot \big( \vb{E}_0 \!+\! \vb{E}_1 \big) + = q_e (n_{e0} + n_{e1} - n_i) + \quad \implies \quad + \varepsilon_0 \nabla \cdot \vb{E}_1 + = q_e n_{e1} +\end{aligned}$$ + +Since we are looking for linear waves, +we make the following ansatz for the perturbations: + +$$\begin{aligned} + n_{e1}(\vb{r}, t) + &= n_{e1} \exp(i \vb{k} \cdot \vb{r} - i \omega t) + \\ + \vb{u}_{e1}(\vb{r}, t) + &= \vb{u}_{e1} \exp(i \vb{k} \cdot \vb{r} - i \omega t) + \\ + \vb{E}_1(\vb{r}, t) + &= \vb{E}_1 \:\exp(i \vb{k} \cdot \vb{r} - i \omega t) +\end{aligned}$$ + +Inserting this into the continuity equation and Gauss' law yields, respectively: + +$$\begin{aligned} + - i \omega n_{e1} = - i n_{e0} \vb{k} \cdot \vb{u}_{e1} + \qquad \quad + -\! i \varepsilon_0 \vb{k} \cdot \vb{E}_1 = q_e n_{e1} +\end{aligned}$$ + +However, there are three unknowns $n_{e1}$, $\vb{u}_{e1}$ and $\vb{E}_1$, +so one more equation is needed. + + +## Cold Langmuir waves + +We therefore turn to the electron momentum equation. +For now, let us assume that the electrons have no thermal motion, +i.e. the electron temperature $T_e = 0$, so that $p_e = 0$, leaving: + +$$\begin{aligned} + m_e n_e \frac{\mathrm{D} \vb{u}_e}{\mathrm{D} t} + = q_e n_e \vb{E} +\end{aligned}$$ + +Inserting the decomposition then gives the following, +where we neglect $(\vb{u}_{e1} \cdot \nabla) \vb{u}_{e1}$ +because $\vb{u}_{e1}$ is so small by assumption: + +$$\begin{gathered} + m_e (n_{e0} \!+\! n_{e1}) \Big( \pdv{(\vb{u}_{e0} \!+\! \vb{u}_{e1})}{t} + + \big( (\vb{u}_{e0} \!+\! \vb{u}_{e1}) \cdot \nabla \big) (\vb{u}_{e0} \!+\! \vb{u}_{e1}) \Big) + = q_e \big( n_{e0} \!+\! n_{e1} \big) \big( \vb{E}_0 \!+\! \vb{E}_1 \big) + \\ + \implies \qquad + q_e \vb{E}_1 + = m_e \Big( \pdv{\vb{u}_{e1}}{t} + \big(\vb{u}_{e1} \cdot \nabla \big) \vb{u}_{e1} \Big) + \approx m_e \pdv{\vb{u}_{e1}}{t} +\end{gathered}$$ + +And then inserting our plane-wave ansatz yields +the third equation we were looking for: + +$$\begin{aligned} + -i \omega m_e \vb{u}_{e1} = q_e \vb{E}_1 +\end{aligned}$$ + +Solving this system of three equations for $\omega^2$ +gives the following dispersion relation: + +$$\begin{aligned} + \omega^2 + = \frac{\omega n_{e0}}{n_{e1}} \vb{k} \cdot \vb{u}_{e1} + = \frac{i \omega n_{e0} q_e}{\omega m_e n_{e1}} \vb{k} \cdot \vb{E}_1 + = \frac{i n_{e0} n_{e1} q_e^2}{i \varepsilon_0 m_e n_{e1}} + = \frac{n_{e0} q_e^2}{\varepsilon_0 m_e} +\end{aligned}$$ + +This result is known as the **plasma frequency** $\omega_p$, +and describes the frequency of **cold Langmuir waves**, +otherwise known as **plasma oscillations**: + +$$\begin{aligned} + \boxed{ + \omega_p + = \sqrt{\frac{n_{0e} q_e^2}{\varepsilon_0 m_e}} + } +\end{aligned}$$ + +Note that this is a dispersion relation $\omega(k) = \omega_p$, +but that $\omega_p$ does not contain $k$. +This means that cold Langmuir waves do not propagate: +the oscillation is "stationary". + + +## Warm Langmuir waves + +Next, we generalize this result to nonzero $T_e$, +in which case the pressure $p_e$ is involved: + +$$\begin{aligned} + m_e n_{e0} \pdv{}{\vb{u}{e1}}{t} + = q_e n_{e0} \vb{E}_1 - \nabla p_e +\end{aligned}$$ + +From the two-fluid thermodynamic equation of state, +we know that $\nabla p_e$ can be written as: + +$$\begin{aligned} + \nabla p_e + = \gamma k_B T_e \nabla n_e + = \gamma k_B T_e \nabla (n_{e0} + n_{e1}) + = \gamma k_B T_e \nabla n_{e1} +\end{aligned}$$ + +With this, insertion of our plane-wave ansatz +into the electron equation results in: + +$$\begin{aligned} + -i \omega m_e n_{e0} \vb{u}_{e1} = q_e n_{e0} \vb{E}_1 - i \gamma k_B T_e n_{e1} \vb{k} +\end{aligned}$$ + +Which once again closes the system of three equations. +Solving for $\omega^2$ then gives: + +$$\begin{aligned} + \omega^2 + = \frac{\omega n_{e0}}{n_{e1}} \vb{k} \cdot \vb{u}_{e1} + &= \frac{i \omega n_{e0}}{\omega n_{e0} m_e n_{e1}} \vb{k} \cdot \Big( q_e n_{e0} \vb{E}_1 - i \gamma k_B T_e n_{e1} \vb{k} \Big) + \\ + &= \frac{n_{e0} q_e^2}{\varepsilon_0 m_e} - \frac{i \omega}{\omega m_e n_{e1}} i \gamma k_B T_e n_{e1} \big(\vb{k} \cdot \vb{k}\big) +\end{aligned}$$ + +Recognizing the first term as the plasma frequency $\omega_p^2$, +we therefore arrive at the **Bohm-Gross dispersion relation** $\omega(\vb{k})$ +for **warm Langmuir waves**: + +$$\begin{aligned} + \boxed{ + \omega^2 + = \omega_p^2 + \frac{\gamma k_B T_e}{m_e} |\vb{k}|^2 + } +\end{aligned}$$ + +This expression is typically quoted for 1D oscillations, +in which case $\gamma = 3$ and $k = |\vb{k}|$: + +$$\begin{aligned} + \omega^2 + = \omega_p^2 + \frac{3 k_B T_e}{m_e} k^2 +\end{aligned}$$ + +Unlike for $T_e = 0$, these "warm" waves do propagate, +carrying information at group velocity $v_g$, +which, in the limit of large $k$, is given by: + +$$\begin{aligned} + v_g + = \pdv{\omega}{k} + \to \sqrt{\frac{3 k_B T_e}{m_e}} +\end{aligned}$$ + +This is the root-mean-square velocity of the +[Maxwell-Boltzmann speed distribution](/know/concept/maxwell-boltzmann-distribution/), +meaning that information travels at the thermal velocity for large $k$. + + + +## References +1. F.F. Chen, + *Introduction to plasma physics and controlled fusion*, + 3rd edition, Springer. +2. M. Salewski, A.H. Nielsen, + *Plasma physics: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/laplace-transform/index.md b/source/know/concept/laplace-transform/index.md new file mode 100644 index 0000000..94ea3fc --- /dev/null +++ b/source/know/concept/laplace-transform/index.md @@ -0,0 +1,125 @@ +--- +title: "Laplace transform" +date: 2021-07-02 +categories: +- Mathematics +- Physics +layout: "concept" +--- + +The **Laplace transform** is an integral transform +that losslessly converts a function $f(t)$ of a real variable $t$, +into a function $\tilde{f}(s)$ of a complex variable $s$, +where $s$ is sometimes called the **complex frequency**, +analogously to the [Fourier transform](/know/concept/fourier-transform/). +The transform is defined as follows: + +$$\begin{aligned} + \boxed{ + \tilde{f}(s) + \equiv \hat{\mathcal{L}}\{f(t)\} + \equiv \int_0^\infty f(t) \exp(- s t) \dd{t} + } +\end{aligned}$$ + +Depending on $f(t)$, this integral may diverge. +This is solved by restricting the domain of $\tilde{f}(s)$ +to $s$ where $\mathrm{Re}\{s\} > s_0$, +for an $s_0$ large enough to compensate for the growth of $f(t)$. + +The **inverse Laplace transform** $\hat{\mathcal{L}}{}^{-1}$ involves complex integration, +and is therefore a lot more difficult to calculate. +Fortunately, it is usually avoidable by rewriting a given $s$-space expression +using [partial fraction decomposition](/know/concept/partial-fraction-decomposition/), +and then looking up the individual terms. + + +## Derivatives + +The derivative of a transformed function is the transform +of the original mutliplied by its variable. +This is especially useful for transforming ODEs with variable coefficients: + +$$\begin{aligned} + \boxed{ + \tilde{f}{}'(s) = - \hat{\mathcal{L}}\{t f(t)\} + } +\end{aligned}$$ + +This property generalizes nicely to higher-order derivatives of $s$, so: + +$$\begin{aligned} + \boxed{ + \dvn{n}{\tilde{f}}{s} = (-1)^n \hat{\mathcal{L}}\{t^n f(t)\} + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-dv-s"/> +<label for="proof-dv-s">Proof</label> +<div class="hidden"> +<label for="proof-dv-s">Proof.</label> +The exponential $\exp(- s t)$ is the only thing that depends on $s$ here: + +$$\begin{aligned} + \dvn{n}{\tilde{f}}{s} + &= \dvn{n}{}{s}\int_0^\infty f(t) \exp(- s t) \dd{t} + \\ + &= \int_0^\infty (-t)^n f(t) \exp(- s t) \dd{t} + = (-1)^n \hat{\mathcal{L}}\{t^n f(t)\} +\end{aligned}$$ +</div> +</div> + +The Laplace transform of a derivative introduces the initial conditions into the result. +Notice that $f(0)$ is the initial value in the original $t$-domain: + +$$\begin{aligned} + \boxed{ + \hat{\mathcal{L}}\{ f'(t) \} = - f(0) + s \tilde{f}(s) + } +\end{aligned}$$ + +This property generalizes to higher-order derivatives, +although it gets messy quickly. +Once again, the initial values of the lower derivatives appear: + +$$\begin{aligned} + \boxed{ + \hat{\mathcal{L}} \big\{ f^{(n)}(t) \big\} + = - \sum_{j = 0}^{n - 1} s^j f^{(n - 1 - j)}(0) + s^n \tilde{f}(s) + } +\end{aligned}$$ + +Where $f^{(n)}(t)$ is shorthand for the $n$th derivative of $f(t)$, +and $f^{(0)}(t) = f(t)$. +As an example, $\hat{\mathcal{L}}\{f'''(t)\}$ becomes +$- f''(0) - s f'(0) - s^2 f(0) + s^3 \tilde{f}(s)$. + +<div class="accordion"> +<input type="checkbox" id="proof-dv-t"/> +<label for="proof-dv-t">Proof</label> +<div class="hidden"> +<label for="proof-dv-t">Proof.</label> +We integrate by parts and use the fact that $\lim_{x \to \infty} \exp(-x) = 0$: + +$$\begin{aligned} + \hat{\mathcal{L}} \big\{ f^{(n)}(t) \big\} + &= \int_0^\infty f^{(n)}(t) \exp(- s t) \dd{t} + \\ + &= \Big[ f^{(n - 1)}(t) \exp(- s t) \Big]_0^\infty + s \int_0^\infty f^{(n-1)}(t) \exp(- s t) \dd{t} + \\ + &= - f^{(n - 1)}(0) + s \Big[ f^{(n - 2)}(t) \exp(- s t) \Big]_0^\infty + s^2 \int_0^\infty f^{(n-2)}(t) \exp(- s t) \dd{t} +\end{aligned}$$ + +And so on. +By partially integrating $n$ times in total we arrive at the conclusion. +</div> +</div> + + + +## References +1. O. Bang, + *Applied mathematics for physicists: lecture notes*, 2019, + unpublished. diff --git a/source/know/concept/larmor-precession/index.md b/source/know/concept/larmor-precession/index.md new file mode 100644 index 0000000..ff80619 --- /dev/null +++ b/source/know/concept/larmor-precession/index.md @@ -0,0 +1,102 @@ +--- +title: "Larmor precession" +date: 2021-07-02 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +Consider a stationary spin-1/2 particle, +placed in a [magnetic field](/know/concept/magnetic-field/) +with magnitude $B$ pointing in the $z$-direction. +In that case, its Hamiltonian $\hat{H}$ is given by: + +$$\begin{aligned} + \hat{H} = - \gamma B \hat{S}_z = - \frac{\hbar}{2} \gamma B \hat{\sigma_z} +\end{aligned}$$ + +Where $\gamma = - q / m$ is the gyromagnetic ratio, +and $\hat{\sigma}_z$ is the Pauli spin matrix for the $z$-direction. +Since $\hat{H}$ is proportional to $\hat{\sigma}_z$, +they share eigenstates $\Ket{\downarrow}$ and $\Ket{\uparrow}$. +The respective eigenenergies $E_{\downarrow}$ and $E_{\uparrow}$ are as follows: + +$$\begin{aligned} + E_{\downarrow} = \frac{\hbar}{2} \gamma B + \qquad + E_{\uparrow} = - \frac{\hbar}{2} \gamma B +\end{aligned}$$ + +Because $\hat{H}$ is time-independent, +the general time-dependent solution $\Ket{\chi(t)}$ is of the following form, +where $a$ and $b$ are constants, +and the exponentials are "twiddle factors": + +$$\begin{aligned} + \Ket{\chi(t)} + = a \exp(- i E_{\downarrow} t / \hbar) \: \Ket{\downarrow} + \:+\: b \exp(- i E_{\uparrow} t / \hbar) \: \Ket{\uparrow} +\end{aligned}$$ + +For our purposes, we can safely assume that $a$ and $b$ are real, +and then say that there exists an angle $\theta$ +satisfying $a = \sin(\theta / 2)$ and $b = \cos(\theta / 2)$, such that: + +$$\begin{aligned} + \Ket{\chi(t)} = \sin(\theta / 2) \exp(- i E_{\downarrow} t / \hbar) \: \Ket{\downarrow} + \:+\: \cos(\theta / 2) \exp(- i E_{\uparrow} t / \hbar) \: \Ket{\uparrow} +\end{aligned}$$ + +Now, we find the expectation values of the spin operators +$\expval{\hat{S}_x}$, $\expval{\hat{S}_y}$, and $\expval{\hat{S}_z}$. +The first is: + +$$\begin{aligned} + \matrixel{\chi}{\hat{S}_x}{\chi} + &= \frac{\hbar}{2} + \begin{bmatrix} a \exp(i E_{\downarrow} t / \hbar) \\ b \exp(i E_{\uparrow} t / \hbar) \end{bmatrix}^{\mathrm{T}} + \cdot + \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} + \cdot + \begin{bmatrix} a \exp(- i E_{\downarrow} t / \hbar) \\ b \exp(- i E_{\uparrow} t / \hbar) \end{bmatrix} + \\ + &= \frac{\hbar}{2} + \begin{bmatrix} a \exp(i E_{\downarrow} t / \hbar) \\ b \exp(i E_{\uparrow} t / \hbar) \end{bmatrix}^{\mathrm{T}} + \cdot + \begin{bmatrix} b \exp(- i E_{\uparrow} t / \hbar) \\ a \exp(- i E_{\downarrow} t / \hbar) \end{bmatrix} + \\ + &= \frac{\hbar}{2} \Big( a b \exp(i (E_{\downarrow} \!-\! E_{\uparrow}) t / \hbar) + + b a \exp(i (E_{\uparrow} \!-\! E_{\downarrow}) t / \hbar) \Big) + \\ + &= \frac{\hbar}{2} \cos(\theta/2) \sin(\theta/2) \Big( \exp(i \gamma B t) + \exp(- i \gamma B t) \Big) + \\ + &= \frac{\hbar}{2} \cos(\gamma B t) \Big( \cos(\theta/2) \sin(\theta/2) + \cos(\theta/2) \sin(\theta/2) \Big) + \\ + &= \frac{\hbar}{2} \sin(\theta) \cos(\gamma B t) +\end{aligned}$$ + +The other two are calculated in the same way, +with the following results: + +$$\begin{aligned} + \matrixel{\chi}{\hat{S}_y}{\chi} = - \frac{\hbar}{2} \sin(\theta) \sin(\gamma B t) + \qquad + \matrixel{\chi}{\hat{S}_z}{\chi} = \frac{\hbar}{2} \cos(\theta) +\end{aligned}$$ + +The result is that the spin axis is off by $\theta$ from the $z$-direction, +and is rotating (or **precessing**) around the $z$-axis at the **Larmor frequency** $\omega$: + +$$\begin{aligned} + \boxed{ + \omega = \gamma B + } +\end{aligned}$$ + + + +## References +1. D.J. Griffiths, D.F. Schroeter, + *Introduction to quantum mechanics*, 3rd edition, + Cambridge. diff --git a/source/know/concept/laser-rate-equations/index.md b/source/know/concept/laser-rate-equations/index.md new file mode 100644 index 0000000..dec7e4b --- /dev/null +++ b/source/know/concept/laser-rate-equations/index.md @@ -0,0 +1,324 @@ +--- +title: "Laser rate equations" +date: 2022-03-16 +categories: +- Physics +- Optics +- Laser theory +layout: "concept" +--- + +The [Maxwell-Bloch equations](/know/concept/maxwell-bloch-equations/) (MBEs) +give a fundamental description of light-matter interaction +for a two-level quantum system for the purposes of laser theory. +They govern the [electric field](/know/concept/electric-field/) $\vb{E}^{+}$, +the induced polarization $\vb{P}^{+}$, +and the total population inversion $D$: + +$$\begin{aligned} + - \mu_0 \pdvn{2}{\vb{P}^{+}}{t} + &= \nabla \cross \nabla \cross \vb{E}^{+} + \frac{n^2}{c^2} \pdvn{2}{\vb{E}^{+}}{t} + \\ + \pdv{\vb{P}^{+}}{t} + &= - \Big( \gamma_\perp + i \omega_0 \Big) \vb{P}^{+} + - \frac{i |g|^2}{\hbar} \vb{E}^{+} D + \\ + \pdv{D}{t} + &= \gamma_\parallel (D_0 - D) + \frac{i 2}{\hbar} \Big( \vb{P}^{-} \cdot \vb{E}^{+} - \vb{P}^{+} \cdot \vb{E}^{-} \Big) +\end{aligned}$$ + +Where $n$ is the background medium's refractive index, +$\omega_0$ the two-level system's gap resonance frequency, +$|g| \equiv |\matrixel{e}{\vu{x}}{g}|$ the transition dipole moment, +$\gamma_\perp$ and $\gamma_\parallel$ empirical decay rates, +and $D_0$ the equilibrium inversion. +Note that $\vb{E}^{-} = (\vb{E}^{+})^*$. + +Let us make the following ansatz, +where $\vb{E}_0^{+}$ and $\vb{P}_0^{+}$ are slowly-varying envelopes +of a plane wave with angular frequency $\omega \approx \omega_0$: + +$$\begin{aligned} + \vb{E}^{+}(\vb{r}, t) + = \frac{1}{2} \vb{E}_0^{+}(\vb{r}, t) \: e^{-i \omega t} + \qquad \qquad + \vb{P}^{+}(\vb{r}, t) + = \frac{1}{2} \vb{P}_0^{+}(\vb{r}, t) \: e^{-i \omega t} +\end{aligned}$$ + +We insert this into the first MBE, +and assume that $\vb{E}_0^{+}$ and $\vb{P}_0^{+}$ +vary so slowly that their second-order derivatives are negligible, +i.e. $\ipdvn{2}{\vb{E}_0^{+}\!}{t} \approx 0$ and $\ipdvn{2}{\vb{P}_0^{+}\!}{t} \approx 0$, +giving: + +$$\begin{aligned} + \mu_0 \bigg( i 2 \omega \pdv{\vb{P}_0^{+}}{t} + \omega^2 \vb{P}_0^{+} \bigg) + = \nabla \cross \nabla \cross \vb{E}_0^{+} + - \frac{n^2}{c^2} \bigg( i 2 \omega \pdv{\vb{E}_0^{+}}{t} + \omega^2 \vb{E}_0^{+} \bigg) +\end{aligned}$$ + +To get rid of the double curl, +consider the time-independent +[electromagnetic wave equation](/know/concept/electromagnetic-wave-equation/), +where $\Omega$ is an eigenfrequency of the optical cavity +in which lasing will occur: + +$$\begin{aligned} + \nabla \cross \nabla \cross \vb{E}_0^{+} + = \frac{n^2}{c^2} \Omega^2 \vb{E}_0^{+} +\end{aligned}$$ + +For simplicity, we restrict ourselves to a single-mode laser, +where there is only one $\Omega$ and $\vb{E}_0^{+}$ to care about. +Substituting the above equation into the first MBE yields: + +$$\begin{aligned} + i 2 \omega \pdv{\vb{P}_0^{+}}{t} + \omega^2 \vb{P}_0^{+} + = \varepsilon_0 n^2 \bigg( (\Omega^2 - \omega^2) \vb{E}_0^{+} - i 2 \omega \pdv{\vb{E}_0^{+}}{t} \bigg) +\end{aligned}$$ + +Where we used $1 / c^2 = \mu_0 \varepsilon_0$. +Assuming the light is more or less on-resonance $\omega \approx \Omega$, +we can approximate $\Omega^2 \!-\! \omega^2 \approx 2 \omega (\Omega \!-\! \omega)$, so: + +$$\begin{aligned} + i 2 \pdv{\vb{P}_0^{+}}{t} + \omega \vb{P}_0^{+} + = \varepsilon_0 n^2 \bigg( 2 (\Omega - \omega) \vb{E}_0^{+} - i 2 \pdv{\vb{E}_0^{+}}{t} \bigg) +\end{aligned}$$ + +Moving on to the second MBE, +inserting the ansatz $\vb{P}^{+} = \vb{P}_0^{+} e^{-i \omega t} / 2$ leads to: + +$$\begin{aligned} + \pdv{\vb{P}_0^{+}}{t} + = - \Big( \gamma_\perp + i (\omega_0 - \omega) \Big) \vb{P}_0^{+} - \frac{i |g|^2}{\hbar} \vb{E}_0^{+} D +\end{aligned}$$ + +Typically, $\gamma_\perp$ is much larger than the rate of any other decay process, +in which case $\ipdv{}{\vb{P}0^{+}\!}{t}$ is negligible compared to $\gamma_\perp \vb{P}_0^{+}$. +Effectively, this means that the polarization $\vb{P}_0^{+}$ +near-instantly follows the electric field $\vb{E}^{+}\!$. +Setting $\ipdv{}{\vb{P}0^{+}\!}{t} \approx 0$, the second MBE becomes: + +$$\begin{aligned} + \vb{P}^{+} + = -\frac{i |g|^2}{\hbar (\gamma_\perp + i (\omega_0 \!-\! \omega))} \vb{E}^{+} D + = \frac{|g|^2 \gamma(\omega)}{\hbar \gamma_\perp} \vb{E}^{+} D +\end{aligned}$$ + +Where the Lorentzian gain curve $\gamma(\omega)$ +(which also appears in the [SALT equation](/know/concept/salt-equation/)) +represents a laser's preferred spectrum for amplification, +and is defined like so: + +$$\begin{aligned} + \gamma(\omega) + \equiv \frac{\gamma_\perp}{(\omega - \omega_0) + i \gamma_\perp} +\end{aligned}$$ + +Note that $\gamma(\omega)$ satisfies the following relation, +which will be useful to us later: + +$$\begin{aligned} + \gamma^*(\omega) - \gamma(\omega) + = \frac{\gamma_\perp (i \gamma_\perp + i \gamma_\perp)}{(\omega - \omega_0)^2 + \gamma_\perp^2} + = i 2 |\gamma(\omega)|^2 +\end{aligned}$$ + +Returning to the first MBE with $\ipdv{\vb{P}_0^{+}}{t} \approx 0$, +we substitute the above expression for $\vb{P}_0^{+}$: + +$$\begin{aligned} + \pdv{\vb{E}_0^{+}}{t} + &= i (\omega - \Omega) \vb{E}_0^{+} + i \frac{\omega}{2 \varepsilon_0 n^2} \vb{P}_0^{+} + \\ + &= i (\omega - \Omega) \vb{E}_0^{+} + i \frac{|g|^2 \omega \gamma(\omega)}{2 \hbar \varepsilon_0 \gamma_\perp n^2} \vb{E}_0^{+} D +\end{aligned}$$ + +Next, we insert our ansatz for $\vb{E}^{+}\!$ and $\vb{P}^{+}\!$ +into the third MBE, and rewrite $\vb{P}_0^{+}$ as above. +Using our identity for $\gamma(\omega)$, +and the fact that $\vb{E}_0^{+} \cdot \vb{E}_0^{-} = |\vb{E}|^2$, we find: + +$$\begin{aligned} + \pdv{D}{t} + &= \gamma_\parallel (D_0 - D) + \frac{i}{2 \hbar} + \Big( \frac{|g|^2 \gamma^*(\omega)}{\hbar \gamma_\perp} \vb{E}_0^{-} D \cdot \vb{E}_0^{+} + - \frac{|g|^2 \gamma(\omega)}{\hbar \gamma_\perp} \vb{E}_0^{+} D \cdot \vb{E}_0^{-} \Big) + \\ + &= \gamma_\parallel (D_0 - D) + \frac{i |g|^2}{2 \hbar^2 \gamma_\perp} \Big( \gamma^*(\omega) - \gamma(\omega) \Big) |\vb{E}|^2 D + \\ + &= \gamma_\parallel (D_0 - D) - \frac{|g|^2}{\hbar^2 \gamma_\perp} |\gamma(\omega)|^2 |\vb{E}|^2 D +\end{aligned}$$ + +This is the prototype of the first laser rate equation. +However, in order to have a practical set, +we need an equation for $|\vb{E}|^2$, +which we can obtain using the first MBE: + +$$\begin{aligned} + \pdv{|\vb{E}|^2}{t} + &= \vb{E}_0^{+} \pdv{\vb{E}_0^{-}}{t} + \vb{E}_0^{-} \pdv{\vb{E}_0^{+}}{t} + \\ + &= -i (\omega - \Omega^*) |\vb{E}|^2 - i \frac{|g|^2 \omega \gamma^*(\omega)}{2 \hbar \varepsilon_0 \gamma_\perp n^2} |\vb{E}|^2 D + + i (\omega - \Omega) |\vb{E}|^2 + i \frac{|g|^2 \omega \gamma(\omega)}{2 \hbar \varepsilon_0 \gamma_\perp n^2} |\vb{E}|^2 D + \\ + &= i (\Omega^* - \Omega) |\vb{E}|^2 + + i \frac{|g|^2 \omega}{2 \hbar \varepsilon_0 \gamma_\perp n^2} \Big(\gamma(\omega) - \gamma^*(\omega)\Big) |\vb{E}|^2 D + \\ + &= 2 \Imag(\Omega) |\vb{E}|^2 + \frac{|g|^2 \omega}{\hbar \varepsilon_0 \gamma_\perp n^2} |\gamma(\omega)|^2 |\vb{E}|^2 D +\end{aligned}$$ + +Where $\Imag(\Omega) < 0$ represents the fact that the laser cavity is leaky. +We now have the **laser rate equations**, +although they are still in an unidiomatic form: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \pdv{|\vb{E}|^2}{t} + &= 2 \Imag(\Omega) |\vb{E}|^2 + \frac{|g|^2 \omega}{\hbar \varepsilon_0 \gamma_\perp n^2} |\gamma(\omega)|^2 |\vb{E}|^2 D + \\ + \pdv{D}{t} + &= \gamma_\parallel (D_0 - D) - \frac{|g|^2}{\hbar^2 \gamma_\perp} |\gamma(\omega)|^2 |\vb{E}|^2 D + \end{aligned} + } +\end{aligned}$$ + +To rewrite this, we replace $|\vb{E}|^2$ with the photon number $N_p$ as follows, +with $U = \varepsilon_0 n^2 |\vb{E}|^2 / 2$ being the energy density of the light: + +$$\begin{aligned} + N_{p} + = \frac{U}{\hbar \omega} + = \frac{\varepsilon_0 n^2}{2 \hbar \omega} |\vb{E}|^2 +\end{aligned}$$ + +Furthermore, consider the definition of the inversion $D$: +because a photon emission annihilates an electron-hole pair, +it reduces $D$ by $2$. +Since lasing is only possible for $D > 0$, +we can replace $D$ with the conduction band's electron population $N_e$, +which is reduced by $1$ whenever a photon is emitted. +The laser rate equations then take the following standard form: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \pdv{N_p}{t} + &= - \gamma_p N_p + G N_p N_e + \\ + \pdv{N_e}{t} + &= R_\mathrm{pump} - \gamma_e N_e - G N_p N_e + \end{aligned} + } +\end{aligned}$$ + +Where $\gamma_e$ is a redefinition of $\gamma_\parallel$ +depending on the electron decay processes, +and the photon loss rate $\gamma_p$, the gain $G$, +and the carrier supply rate $R_\mathrm{pump}$ +are defined like so: + +$$\begin{aligned} + \gamma_p + = - 2 \Imag(\Omega) + = \frac{Q}{\Real(\Omega)} + \qquad \quad + G + \equiv \frac{|g|^2 \omega}{\hbar \varepsilon_0 \gamma_\perp n^2} |\gamma(\omega)|^2 + \qquad \quad + R_\mathrm{pump} + \equiv \gamma_\parallel D_0 +\end{aligned}$$ + +With $Q$ being the cavity mode's quality factor. +The nonlinear coupling term $G N_p N_e$ represents +[stimulated emission](/know/concept/einstein-coefficients/), +which is the key to lasing. + +To understand the behaviour of a laser, +consider these equations in a steady state, +i.e. where $N_p$ and $N_e$ are constant in $t$: + +$$\begin{aligned} + 0 + &= - \gamma_p N_p + G N_p N_e + \\ + 0 + &= R_\mathrm{pump} - \gamma_e N_e - G N_p N_e +\end{aligned}$$ + +In addition to the trivial solution $N_p = 0$, +we can also have $N_p > 0$. +Isolating $N_p$'s equation for $N_e$ and inserting that into $N_e$'s equation, we find: + +$$\begin{aligned} + N_e + = \frac{\gamma_p}{G} + \qquad \implies \qquad + \boxed{ + N_p + = \frac{1}{\gamma_p} \bigg( R_\mathrm{pump} - \frac{\gamma_e \gamma_p}{G} \bigg) + } +\end{aligned}$$ + +The quantity $R_\mathrm{thr} \equiv \gamma_e \gamma_p / G$ is called the **lasing threshold**: +if $R_\mathrm{pump} \ge R_\mathrm{thr}$, the laser is active, +meaning that $N_p$ is big enough to cause +a "chain reaction" of stimulated emission +that consumes all surplus carriers to maintain a steady state. + +The point is that $N_e$ is independent of the electron supply $R_\mathrm{pump}$, +because all additional electrons are almost immediately +annihilated by stimulated emission. +Consequently $N_p$ increases linearly as $R_\mathrm{pump}$ is raised, +at a much steeper slope than would be possible below threshold. +The output of the cavity is proportional to $N_p$, +so the brightness is also linear. + +Unfortunately, by deriving the laser rate equations from the MBEs, +we lost some interesting and important effects, +most notably spontaneous emission, +which is needed for $N_p$ to grow if $R_\mathrm{pump}$ is below threshold. + +For this reason, the laser rate equations are typically presented +in a more empirical form, which "bookkeeps" the processes affecting $N_p$ and $N_e$. +Consider the following example: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \pdv{N_p}{t} + &= - (\gamma_\mathrm{out} + \gamma_\mathrm{abs} + \gamma_\mathrm{loss}) N_p + \gamma_\mathrm{spon} N_e + G_\mathrm{stim} N_p N_e + \\ + \pdv{N_e}{t} + &= R_\mathrm{pump} + \gamma_\mathrm{abs} N_p + - (\gamma_\mathrm{spon} + \gamma_\mathrm{n.r.} + \gamma_\mathrm{leak}) N_e - G_\mathrm{stim} N_p N_e + \end{aligned} + } +\end{aligned}$$ + +Where $\gamma_\mathrm{out}$ represents the cavity's usable output, +$\gamma_\mathrm{abs}$ the medium's absorption, +$\gamma_\mathrm{loss}$ scattering losses, +$\gamma_\mathrm{spon}$ spontaneous emission, +$\gamma_\mathrm{n.r.}$ non-radiative electron-hole recombination, +and $\gamma_\mathrm{leak}$ the fact that +some carriers leak away before they can be used for emission. + +Unsurprisingly, this form is much harder to analyze, +but more accurately describes the dynamics inside a laser. +To make matters even worse, many of these decay rates depend on $N_p$ or $N_e$, +so solutions can only be obtained numerically. + + + +## References +1. D. Meschede, + *Optics, light and lasers*, + Wiley. +2. L.A. Coldren, S.W. Corzine, M.L. Mašanović, + *Diode lasers and photonic integrated circuits*, 2nd edition, + Wiley. diff --git a/source/know/concept/laws-of-thermodynamics/index.md b/source/know/concept/laws-of-thermodynamics/index.md new file mode 100644 index 0000000..2d7af9e --- /dev/null +++ b/source/know/concept/laws-of-thermodynamics/index.md @@ -0,0 +1,103 @@ +--- +title: "Laws of thermodynamics" +date: 2021-07-07 +categories: +- Physics +- Thermodynamics +layout: "concept" +--- + +The **laws of thermodynamics** are of great importance +to physics, chemistry and engineering, +since they restrict what a device or process can physically achieve. +For example, the impossibility of *perpetual motion* +is a consequence of these laws. + + +## First law + +The **first law of thermodynamics** states that energy is conserved. +When a system goes from one equilibrium to another, +the change $\Delta U$ of its energy $U$ is equal to +the work $\Delta W$ done by external forces, +plus the energy transferred by heating ($\Delta Q > 0$) or cooling ($\Delta Q < 0$): + +$$\begin{aligned} + \boxed{ + \Delta U = \Delta W + \Delta Q + } +\end{aligned}$$ + +The internal energy $U$ is a state variable, +so is independent of the path taken between equilibria. +However, the work $\Delta W$ and heating $\Delta Q$ do depend on the path, +so the first law means that +the act of transferring energy is path-dependent, +but the result has no "memory" of that path. + + +## Second law + +The **second law of thermodynamics** states that +the total entropy never decreases. +An important consequence is that +no machine can convert energy into work with 100% efficiency. + +It is possible for the local entropy $S_{\mathrm{loc}}$ +of a system to decrease, but doing so requires work, +and therefore the entropy of the surroundings $S_{\mathrm{sur}}$ +must increase accordingly, such that: + +$$\begin{aligned} + \boxed{ + \Delta S_{\mathrm{tot}} = \Delta S_{\mathrm{loc}} + \Delta S_{\mathrm{sur}} \ge 0 + } +\end{aligned}$$ + +Since the total entropy never decreases, +the equilibrium state of a system must be a maximum +of its entropy $S$, and therefore $S$ can be used as +a [thermodynamic "potential"](/know/concept/thermodynamic-potential/). + +The only situation where $\Delta S = 0$ is a reversible process, +since then it must be possible to return to +the previous equilibrium state by doing the same work in the opposite direction. + +According to the first law, +if a process is reversible, or if it is only heating/cooling, +then (after one reversible cycle) the energy change +is simply the heat transfer $\dd{U} = \dd{Q}$. +An entropy change $\dd{S}$ is then expressed as follows +(since $\ipdv{S}{U} = 1 / T$ by definition): + +$$\begin{aligned} + \boxed{ + \dd{S} + = \Big( \pdv{S}{U} \Big)_{V, N} \dd{U} + = \frac{\dd{Q}}{T} + } +\end{aligned}$$ + +Confusingly, this equation is sometimes also called the second law of thermodynamics. + + +## Third law + +The **third law of thermodynamics** states that +the entropy $S$ of a system goes to zero when the temperature reaches absolute zero: + +$$\begin{aligned} + \boxed{ + \lim_{T \to 0} S = 0 + } +\end{aligned}$$ + +From this, the absolute quantity of $S$ is defined, otherwise we would +only be able to speak of entropy differences $\Delta S$. + + + +## References +1. H. Gould, J. Tobochnik, + *Statistical and thermal physics*, 2nd edition, + Princeton. diff --git a/source/know/concept/lawson-criterion/index.md b/source/know/concept/lawson-criterion/index.md new file mode 100644 index 0000000..c1848dc --- /dev/null +++ b/source/know/concept/lawson-criterion/index.md @@ -0,0 +1,127 @@ +--- +title: "Lawson criterion" +date: 2021-10-06 +categories: +- Physics +- Plasma physics +layout: "concept" +--- + +For sustained nuclear fusion to be possible, +the **Lawson criterion** must be met, +from which some required properties +of the plasma and the reactor chamber can be deduced. + +Suppose that a reactor generates a given power $P_\mathrm{fus}$ by nuclear fusion, +but that it leaks energy at a rate $P_\mathrm{loss}$ in an unusable way. +If an auxiliary input power $P_\mathrm{aux}$ sustains the fusion reaction, +then the following inequality must be satisfied +in order to have harvestable energy: + +$$\begin{aligned} + P_\mathrm{loss} + \le P_\mathrm{fus} + P_\mathrm{aux} +\end{aligned}$$ + +We can rewrite $P_\mathrm{aux}$ using the definition +of the **energy gain factor** $Q$, +which is the ratio of the output and input powers of the fusion reaction: + +$$\begin{aligned} + Q + \equiv \frac{P_\mathrm{fus}}{P_\mathrm{aux}} + \quad \implies \quad + P_\mathrm{aux} + = \frac{P_\mathrm{fus}}{Q} +\end{aligned}$$ + +Returning to the inequality, we can thus rearrange its right-hand side as follows: + +$$\begin{aligned} + P_\mathrm{loss} + \le P_\mathrm{fus} + \frac{P_\mathrm{fus}}{Q} + = P_\mathrm{fus} \Big( 1 + \frac{1}{Q} \Big) + = P_\mathrm{fus} \Big( \frac{Q + 1}{Q} \Big) +\end{aligned}$$ + +We assume that the plasma has equal species densities $n_i = n_e$, +so its total density $n = 2 n_i$. +Then $P_\mathrm{fus}$ is as follows, +where $f_{ii}$ is the frequency +with which a given ion collides with other ions, +and $E_\mathrm{fus}$ is the energy released by a single fusion reaction: + +$$\begin{aligned} + P_\mathrm{fus} + = f_{ii} n_i E_\mathrm{fus} + = \big( n_i \Expval{\sigma v} \big) n_i E_\mathrm{fus} + = \frac{n^2}{4} \Expval{\sigma v} E_\mathrm{fus} +\end{aligned}$$ + +Where $\Expval{\sigma v}$ is the mean product +of the velocity $v$ and the collision cross-section $\sigma$. + +Furthermore, assuming that both species have the same temperature $T_i = T_e = T$, +the total energy density $W$ of the plasma is given by: + +$$\begin{aligned} + W + = \frac{3}{2} k_B T_i n_i + \frac{3}{2} k_B T_e n_e + = 3 k_B T n +\end{aligned}$$ + +Where $k_B$ is Boltzmann's constant. +From this, we can define the **confinement time** $\tau_E$ +as the characteristic lifetime of energy in the reactor, before leakage. +Therefore: + +$$\begin{aligned} + \tau_E + \equiv \frac{W}{P_\mathrm{loss}} + \quad \implies \quad + P_\mathrm{loss} + = \frac{3 n k_B T}{\tau_E} +\end{aligned}$$ + +Inserting these new expressions for $P_\mathrm{fus}$ and $P_\mathrm{loss}$ +into the inequality, we arrive at: + +$$\begin{aligned} + \frac{3 n k_B T}{\tau_E} + \le \frac{n^2}{4} \Expval{\sigma v} E_\mathrm{fus} \Big( \frac{Q + 1}{Q} \Big) +\end{aligned}$$ + +This can be rearranged to the form below, +which is the original Lawson criterion: + +$$\begin{aligned} + n \tau_E + \ge \frac{Q}{Q + 1} \frac{12 k_B T}{\Expval{\sigma v} E_\mathrm{fus}} +\end{aligned}$$ + +However, it turns out that the highest fusion power density +is reached when $T$ is at the minimum of $T^2 / \Expval{\sigma v}$. +Therefore, we multiply by $T$ to get the Lawson triple product: + +$$\begin{aligned} + \boxed{ + n T \tau_E + \ge \frac{Q}{Q + 1} \frac{12 k_B T^2}{\Expval{\sigma v} E_\mathrm{fus}} + } +\end{aligned}$$ + +For some reason, +it is often assumed that the fusion is infinitely profitable $Q \to \infty$, +in which case the criterion reduces to: + +$$\begin{aligned} + n T \tau_E + \ge \frac{12 k_B T^2}{\Expval{\sigma v} E_\mathrm{fus}} +\end{aligned}$$ + + + +## References +1. M. Salewski, A.H. Nielsen, + *Plasma physics: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/legendre-polynomials/index.md b/source/know/concept/legendre-polynomials/index.md new file mode 100644 index 0000000..338b23f --- /dev/null +++ b/source/know/concept/legendre-polynomials/index.md @@ -0,0 +1,119 @@ +--- +title: "Legendre polynomials" +date: 2021-09-08 +categories: +- Mathematics +layout: "concept" +--- + +The **Legendre polynomials** are a set of functions that sometimes arise in physics. +They are the eigenfunctions $u(x)$ of **Legendre's differential equation**, +which is a ([Sturm-Liouville](/know/concept/sturm-liouville-theory/)) +eigenvalue problem for $\ell (\ell + 1)$, +where $\ell$ turns out to be a non-negative integer: + +$$\begin{aligned} + \boxed{ + (1 - x^2) u'' - 2 x u' + \ell (\ell + 1) u = 0 + } +\end{aligned}$$ + +The $\ell$th-degree Legendre polynomial $P_\ell(x)$ +is given in the form of a *Rodrigues' formula* by: + +$$\begin{aligned} + P_\ell(x) + &= \frac{1}{2^\ell \ell!} \dvn{\ell}{}{x}(x^2 - 1)^\ell +\end{aligned}$$ + +The first handful of Legendre polynomials $P_\ell(x)$ are therefore as follows: + +$$\begin{gathered} + P_0(x) = 1 + \qquad \quad + P_1(x) = x + \qquad \quad + P_2(x) = \frac{1}{2} (3 x^2 - 1) + \\ + P_3(x) = \frac{1}{2} (5 x^3 - 3 x) + \qquad \quad + P_4(x) = \frac{1}{8} (35 x^4 - 30 x^2 + 3) +\end{gathered}$$ + +And then more $P_\ell$ can be computed quickly +using **Bonnet's recursion formula**: + +$$\begin{aligned} + \boxed{ + (\ell + 1) P_{\ell + 1}(x) = (2 \ell + 1) x P_\ell(x) - \ell P_{\ell - 1}(x) + } +\end{aligned}$$ + +The derivative of a given $P_\ell$ can be calculated recursively +using the following relation: + +$$\begin{aligned} + \boxed{ + \dv{}{x}P_{\ell + 1} + = (\ell + 1) P_\ell(x) + x \dv{}{x}P_\ell(x) + } +\end{aligned}$$ + +Noteworthy is that the Legendre polynomials +are mutually orthogonal for $x \in [-1, 1]$: + +$$\begin{aligned} + \boxed{ + \Inprod{P_m}{P_n} + = \int_{-1}^{1} P_m(x) \: P_n(x) \dd{x} + = \frac{2}{2 n + 1} \delta_{nm} + } +\end{aligned}$$ + +As was to be expected from Sturm-Liouville theory. +Likewise, they form a complete basis in the +[Hilbert space](/know/concept/hilbert-space/) +of piecewise continuous functions $f(x)$ on $x \in [-1, 1]$, +meaning: + +$$\begin{aligned} + \boxed{ + f(x) + = \sum_{\ell = 0}^\infty a_\ell P_\ell(x) + = \sum_{\ell = 0}^\infty \frac{\Inprod{P_\ell}{f}}{\Inprod{P_\ell}{P_\ell}} P_\ell(x) + } +\end{aligned}$$ + +Each Legendre polynomial $P_\ell$ comes with +a set of **associated Legendre polynomials** $P_\ell^m(x)$ +of order $m$ and degree $\ell$. +These are the non-singular solutions of the **general Legendre equation**, +where $m$ and $\ell$ are integers satisfying $-\ell \le m \le \ell$: + +$$\begin{aligned} + \boxed{ + (1 - x^2) u'' - 2 x u' + \Big( \ell (\ell + 1) - \frac{m^2}{1 - x^2} \Big) u = 0 + } +\end{aligned}$$ + +The $\ell$th-degree $m$th-order associated Legendre polynomial $P_\ell^m$ +is as follows for $m \ge 0$: + +$$\begin{aligned} + P_\ell^m(x) + = (-1)^m (1 - x^2)^{m/2} \dvn{m}{}{x}P_\ell(x) +\end{aligned}$$ + +Here, the $(-1)^m$ in front is called the **Condon-Shortley phase**, +and is omitted by some authors. +For negative orders $m$, +an additional constant factor is necessary: + +$$\begin{aligned} + P_\ell^{-m}(x) = (-1)^m \frac{(\ell - m)!}{(\ell + m)!} P_\ell^m(x) +\end{aligned}$$ + +Beware, the name is misleading: +if $m$ is odd, then $P_\ell^m$ is actually not a polynomial. +Moreover, not all $P_\ell^m$ are mutually orthogonal +(but some are). diff --git a/source/know/concept/legendre-transform/index.md b/source/know/concept/legendre-transform/index.md new file mode 100644 index 0000000..fb46c9d --- /dev/null +++ b/source/know/concept/legendre-transform/index.md @@ -0,0 +1,91 @@ +--- +title: "Legendre transform" +date: 2021-02-22 +categories: +- Mathematics +- Physics +layout: "concept" +--- + +The **Legendre transform** of a function $f(x)$ is a new function $L(f')$, +which depends only on the derivative $f'(x)$ of $f(x)$, and from which +the original function $f(x)$ can be reconstructed. The point is, +analogously to other transforms (e.g. [Fourier](/know/concept/fourier-transform/)), +that $L(f')$ contains the same information as $f(x)$, just in a different form. + +Let us choose an arbitrary point $x_0 \in [a, b]$ in the domain of +$f(x)$. Consider a line $y(x)$ tangent to $f(x)$ at $x = x_0$, which has +a slope $f'(x_0)$ and intersects the $y$-axis at $-C$: + +$$\begin{aligned} + y(x) = f'(x_0) (x - x_0) + f(x_0) = f'(x_0) x - C +\end{aligned}$$ + +The Legendre transform $L(f')$ is defined such that $L(f'(x_0)) = C$ +(or sometimes $-C$) for all $x_0 \in [a, b]$, +where $C$ corresponds to the tangent line at $x = x_0$. This yields: + +$$\begin{aligned} + L(f'(x)) = f'(x) \: x - f(x) +\end{aligned}$$ + +We want this function to depend only on the derivative $f'$, but +currently $x$ still appears here as a variable. We fix that problem in +the easiest possible way: by assuming that $f'(x)$ is invertible for all +$x \in [a, b]$. If $x(f')$ is the inverse of $f'(x)$, then $L(f')$ is +given by: + +$$\begin{aligned} + \boxed{ + L(f') = f' \: x(f') - f(x(f')) + } +\end{aligned}$$ + +The only requirement for the existence of the Legendre transform is thus +the invertibility of $f'(x)$ in the target interval $[a,b]$, which can +only be true if $f(x)$ is either convex or concave, i.e. its derivative +$f'(x)$ is monotonic. + +Crucially, the derivative of $L(f')$ with respect to $f'$ is simply +$x(f')$. In other words, the roles of $f'$ and $x$ are switched by the +transformation: the coordinate becomes the derivative and vice versa. +This is demonstrated here: + +$$\begin{aligned} + \boxed{ + \dv{L}{f'} = \dv{x}{f'} \: f' + x(f') - \dv{f}{x} \dv{x}{f'} = x(f') + } +\end{aligned}$$ + +Furthermore, Legendre transformation is an *involution*, meaning it is +its own inverse. Let $g(L')$ be the Legendre transform of $L(f')$: + +$$\begin{aligned} + g(L') = L' \: f'(L') - L(f'(L')) + = x(f') \: f' - f' \: x(f') + f(x(f')) = f(x) +\end{aligned}$$ + +Moreover, the inverse of a (forward) transform always exists, because +the Legendre transform of a convex function is itself convex. Convexity +of $f(x)$ means that $f''(x) > 0$ for all $x \in [a, b]$, which yields +the following proof: + +$$\begin{aligned} + L''(f') + = \dv{x(f')}{f'} + = \dv{x}{f'(x)} + = \frac{1}{f''(x)} + > 0 +\end{aligned}$$ + +Legendre transformation is important in physics, +since it connects [Lagrangian](/know/concept/lagrangian-mechanics/) +and [Hamiltonian](/know/concept/hamiltonian-mechanics/) mechanics to each other. +It is also used to convert between [thermodynamic potentials](/know/concept/thermodynamic-potential/). + + + +## References +1. H. Gould, J. Tobochnik, + *Statistical and thermal physics*, 2nd edition, + Princeton. diff --git a/source/know/concept/lehmann-representation/index.md b/source/know/concept/lehmann-representation/index.md new file mode 100644 index 0000000..dd8c112 --- /dev/null +++ b/source/know/concept/lehmann-representation/index.md @@ -0,0 +1,228 @@ +--- +title: "Lehmann representation" +date: 2021-11-03 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +In many-body quantum theory, the **Lehmann representation** +is an alternative way to write the [Green's functions](/know/concept/greens-functions/), +obtained by expanding in the many-particle eigenstates +under the assumption of a time-independent Hamiltonian $\hat{H}$. + +First, we write out the greater Green's function $G_{\nu \nu'}^>(t, t')$, +and then expand its expected value $\Expval{}$ (at thermodynamic equilibrium) +into a sum of many-particle basis states $\Ket{n}$: + +$$\begin{aligned} + G_{\nu \nu'}^>(t, t') + = - \frac{i}{\hbar} \Expval{\hat{c}_\nu(t) \hat{c}_{\nu'}^\dagger(t')} + &= - \frac{i}{\hbar Z} \sum_{n} \Matrixel{n}{\hat{c}_\nu(t) \hat{c}_{\nu'}^\dagger(t') e^{-\beta \hat{H}}}{n} +\end{aligned}$$ + +Where $\beta = 1 / (k_B T)$, and $Z$ is the grand partition function +(see [grand canonical ensemble](/know/concept/grand-canonical-ensemble/)); +the operator $e^{\beta \hat{H}}$ gives the weight of each term at equilibrium. +Since $\Ket{n}$ is an eigenstate of $\hat{H}$ with energy $E_n$, +this gives us a factor of $e^{\beta E_n}$. +Furthermore, we are in the [Heisenberg picture](/know/concept/heisenberg-picture/), +so we write out the time-dependence of $\hat{c}_\nu$ and $\hat{c}_{\nu'}^\dagger$: + +$$\begin{aligned} + G_{\nu \nu'}^>(t, t') + &= - \frac{i}{\hbar Z} \sum_{n} e^{-\beta E_n} \Matrixel{n}{e^{i \hat{H} t / \hbar} \hat{c}_\nu e^{- i \hat{H} t / \hbar} + e^{i \hat{H} t' / \hbar} \hat{c}_{\nu'}^\dagger e^{- i \hat{H} t' / \hbar}}{n} + \\ + &= - \frac{i}{\hbar Z} \sum_{n} e^{-\beta E_n} + \Matrixel{n}{e^{i \hat{H} (t - t') / \hbar} \hat{c}_\nu e^{- i \hat{H} (t - t') / \hbar} \hat{c}_{\nu'}^\dagger}{n} +\end{aligned}$$ + +Where we used that the trace $\Tr\!(x) = \sum_{n} \matrixel{n}{x}{n}$ +is invariant under cyclic permutations of $x$. +The $\Ket{n}$ form a basis of eigenstates of $\hat{H}$, +so we insert an identity operator $\sum_{n'} \Ket{n'} \Bra{n'}$: + +$$\begin{aligned} + G_{\nu \nu'}^>(t - t') + &= - \frac{i}{\hbar Z} \sum_{n n'} e^{- \beta E_n} + \Matrixel{n}{e^{i \hat{H} (t - t') / \hbar} \hat{c}_\nu e^{- i \hat{H} (t - t') / \hbar}}{n'} \Matrixel{n'}{\hat{c}_{\nu'}^\dagger}{n} + \\ + &= - \frac{i}{\hbar Z} \sum_{n n'} e^{-\beta E_n} + \matrixel{n}{\hat{c}_\nu}{n'} \matrixel{n'}{\hat{c}_{\nu'}^\dagger}{n} e^{i (E_n - E_{n'}) (t - t') / \hbar} +\end{aligned}$$ + +Note that $G_{\nu \nu'}^>$ now only depends on the time difference $t - t'$, +because $\hat{H}$ is time-independent. +Next, we take the [Fourier transform](/know/concept/fourier-transform/) +$t \to \omega$ (with $t' = 0$): + +$$\begin{aligned} + G_{\nu \nu'}^>(\omega) + &= - \frac{i}{\hbar Z} \sum_{n n'} e^{-\beta E_n} \matrixel{n}{\hat{c}_\nu}{n'} \matrixel{n'}{\hat{c}_{\nu'}^\dagger}{n} + \int_{-\infty}^\infty e^{i (E_n - E_{n'}) t / \hbar} \: e^{i \omega t} \dd{t} +\end{aligned}$$ + +Here, we recognize the integral +as a [Dirac delta function](/know/concept/dirac-delta-function/) $\delta$, +thereby introducing a factor of $2 \pi$, +and arriving at the Lehmann representation of $G_{\nu \nu'}^>$: + +$$\begin{aligned} + \boxed{ + G_{\nu \nu'}^>(\omega) + = - \frac{2 \pi i}{Z} \sum_{n n'} e^{-\beta E_n} \matrixel{n}{\hat{c}_\nu}{n'} \matrixel{n'}{\hat{c}_{\nu'}^\dagger}{n} + \: \delta(E_n - E_{n'} + \hbar \omega) + } +\end{aligned}$$ + +We now go through the same process for the lesser Green's function $G_{\nu \nu'}^<(t, t')$: + +$$\begin{aligned} + G_{\nu \nu'}^<(t - t') + &= \mp \frac{i}{\hbar Z} \sum_{n} \matrixel{n}{\hat{c}_{\nu'}^\dagger(t') \hat{c}_\nu(t) e^{-\beta \hat{H}}}{n} + \\ + &= \mp \frac{i}{\hbar Z} e^{-\beta E_n} \sum_{n n'} \matrixel{n}{\hat{c}_{\nu'}^\dagger}{n'} \matrixel{n'}{\hat{c}_\nu}{n} + e^{i (E_{n'} - E_n) (t - t') / \hbar} +\end{aligned}$$ + +Where $-$ is for bosons, and $+$ for fermions. +Fourier transforming yields the following: + +$$\begin{aligned} + G_{\nu \nu'}^<(\omega) + &= \mp \frac{2 \pi i}{\hbar Z} \sum_{n n'} e^{-\beta E_n} \matrixel{n}{\hat{c}_{\nu'}^\dagger}{n'} \matrixel{n'}{\hat{c}_\nu}{n} + \: \delta(E_{n'} - E_n + \hbar \omega) +\end{aligned}$$ + +We swap $n$ and $n'$, leading to the following +Lehmann representation of $G_{\nu \nu'}^<$: + +$$\begin{aligned} + \boxed{ + G_{\nu \nu'}^<(\omega) + = \mp \frac{2 \pi i}{Z} \sum_{n n'} e^{-\beta E_{n'}} \matrixel{n}{\hat{c}_\nu}{n'} \matrixel{n'}{\hat{c}_{\nu'}^\dagger}{n} + \: \delta(E_n - E_{n'} + \hbar \omega) + } +\end{aligned}$$ + +Due to the delta function $\delta$, +each term is only nonzero for $E_n' = E_n + \hbar \omega$, +so we write: + +$$\begin{aligned} + G_{\nu \nu'}^<(\omega) + = \mp \frac{2 \pi i}{\hbar Z} \sum_{n n'} e^{-\beta (E_n + \hbar \omega)} + \matrixel{n}{\hat{c}_\nu}{n'} \matrixel{n'}{\hat{c}_{\nu'}^\dagger}{n} \: \delta(E_n - E_{n'} + \hbar \omega) +\end{aligned}$$ + +Therefore, we arrive at the following useful relation +between $G_{\nu \nu'}^<$ and $G_{\nu \nu'}^>$: + +$$\begin{aligned} + \boxed{ + G_{\nu \nu'}^<(\omega) + = \pm e^{-\beta \hbar \omega} G_{\nu \nu'}^>(\omega) + } +\end{aligned}$$ + +Moving on, let us do the same for +the retarded Green's function $G_{\nu \nu'}^R(t, t')$, given by: + +$$\begin{aligned} + G_{\nu \nu'}^R(t \!-\! t') + &= \Theta(t \!-\! t') \Big( G_{\nu \nu'}^>(t - t') - G_{\nu \nu'}^<(t - t') \Big) + \\ + &= - \frac{i}{\hbar Z} \Theta(t \!-\! t') \sum_{n n'} + \matrixel{n}{\hat{c}_\nu}{n'} \matrixel{n'}{\hat{c}_{\nu'}^\dagger}{n} + \Big( e^{-\beta E_n} \mp e^{- \beta E_{n'}} \Big) e^{i (E_n - E_{n'}) (t - t') / \hbar} +\end{aligned}$$ + +We take the Fourier transform, but to ensure convergence, +we must introduce an infinitesimal positive $\eta \to 0^+$ to the exponent +(and eventually take the limit): + +$$\begin{aligned} + G_{\nu \nu'}^R(\omega) + &= - \frac{i}{\hbar Z} \sum_{n n'} \Big( ... \Big) \int_{-\infty}^\infty \Theta(t) e^{i (E_n - E_{n'}) t / \hbar} e^{i (\omega + i \eta) t} \dd{t} + \\ + &= - \frac{i}{\hbar Z} \sum_{n n'} \Big( ... \Big) \int_0^\infty e^{i (E_n - E_{n'}) t / \hbar} e^{i (\omega + i \eta) t} \dd{t} + \\ + &= - \frac{i}{\hbar Z} \sum_{n n'} \Big( ... \Big) + \bigg[ \frac{\hbar e^{i (\hbar \omega + E_n - E_{n'}) t / \hbar} e^{- \eta t}}{i (\hbar \omega + E_n - E_{n'}) - \hbar \eta} \bigg]_0^\infty +\end{aligned}$$ + +Leading us to the following Lehmann representation +of the retarded Green's function $G_{\nu \nu'}^R$: + +$$\begin{aligned} + \boxed{ + G_{\nu \nu'}^R(\omega) + = \frac{1}{Z} \sum_{n n'} + \frac{\matrixel{n}{\hat{c}_\nu}{n'} \matrixel{n'}{\hat{c}_{\nu'}^\dagger}{n}}{\hbar (\omega + i \eta) + E_n - E_{n'}} + \Big( e^{-\beta E_n} \mp e^{- \beta E_{n'}} \Big) + } +\end{aligned}$$ + +Finally, we go through the same steps for the advanced Green's function $G_{\nu \nu'}^A(t, t')$: + +$$\begin{aligned} + G_{\nu \nu'}^A(t \!-\! t') + &= \Theta(t' \!-\! t) \Big( G_{\nu \nu'}^<(t - t') - G_{\nu \nu'}^>(t - t') \Big) + \\ + &= \frac{i}{\hbar Z} \Theta(t' \!-\! t) \sum_{n n'} + \matrixel{n}{\hat{c}_\nu}{n'} \matrixel{n'}{\hat{c}_{\nu'}^\dagger}{n} + \Big( e^{-\beta E_n} \mp e^{- \beta E_{n'}} \Big) e^{i (E_n - E_{n'}) (t - t') / \hbar} +\end{aligned}$$ + +For the Fourier transform, we must again introduce $\eta \to 0^+$ +(although note the sign): + +$$\begin{aligned} + G_{\nu \nu'}^A(\omega) + &= \frac{i}{\hbar Z} \sum_{n n'} \Big( ... \Big) \int_{-\infty}^\infty \Theta(-t) e^{i (E_n - E_{n'}) t / \hbar} e^{i (\omega - i \eta) t} \dd{t} + \\ + &= \frac{i}{\hbar Z} \sum_{n n'} \Big( ... \Big) \int_{-\infty}^0 e^{i (E_n - E_{n'}) t / \hbar} e^{i (\omega - i \eta) t} \dd{t} + \\ + &= \frac{i}{\hbar Z} \sum_{n n'} \Big( ... \Big) + \bigg[ \frac{\hbar e^{i (\hbar \omega + E_n - E_{n'}) t / \hbar} e^{\eta t}}{i (\hbar \omega + E_n - E_{n'}) + \hbar \eta} \bigg]_{-\infty}^0 +\end{aligned}$$ + +Therefore, the Lehmann representation of +the advanced Green's function $G_{\nu \nu'}^A$ is as follows: + +$$\begin{aligned} + \boxed{ + G_{\nu \nu'}^A(\omega) + = \frac{1}{Z} \sum_{n n'} + \frac{\matrixel{n}{\hat{c}_\nu}{n'} \matrixel{n'}{\hat{c}_{\nu'}^\dagger}{n}}{\hbar (\omega - i \eta) + E_n - E_{n'}} + \Big( e^{-\beta E_n} \mp e^{- \beta E_{n'}} \Big) + } +\end{aligned}$$ + +As a final note, let us take the complex conjugate of this expression: + +$$\begin{aligned} + \big( G_{\nu \nu'}^A(\omega) \big)^* + = \frac{1}{Z} \sum_{n n'} + \frac{\matrixel{n}{\hat{c}_{\nu'}}{n'} \matrixel{n'}{\hat{c}_\nu^\dagger}{n}}{\hbar (\omega + i \eta) + E_n - E_{n'}} + \Big( e^{-\beta E_n} \mp e^{- \beta E_{n'}} \Big) +\end{aligned}$$ + +Note the subscripts $\nu$ and $\nu'$. +Comparing this to $G_{\nu \nu'}^R$ gives us another useful relation: + +$$\begin{aligned} + \boxed{ + G^R_{\nu \nu'}(\omega) + = \big( G^A_{\nu' \nu}(\omega) \big)^* + } +\end{aligned}$$ + + + +## References +1. H. Bruus, K. Flensberg, + *Many-body quantum theory in condensed matter physics*, + 2016, Oxford. diff --git a/source/know/concept/lindhard-function/index.md b/source/know/concept/lindhard-function/index.md new file mode 100644 index 0000000..e3df901 --- /dev/null +++ b/source/know/concept/lindhard-function/index.md @@ -0,0 +1,400 @@ +--- +title: "Lindhard function" +date: 2022-01-24 # Originally 2021-10-12, major rewrite +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +The **Lindhard function** describes the response of +[jellium](/know/concept/jellium) (i.e. a free electron gas) +to an external perturbation, and is a quantum-mechanical +alternative to the [Drude model](/know/concept/drude-model/). + +We start from the [Kubo formula](/know/concept/kubo-formula/) +for the electron density operator $\hat{n}$, +which describes the change in $\Expval{\hat{n}}$ +due to a time-dependent perturbation $\hat{H}_1$: + +$$\begin{aligned} + \delta\!\Expval{ {\hat{n}}}\!(\vb{r}, t) + = -\frac{i}{\hbar} \int_{-\infty}^\infty \Theta(t - t') \Expval{\Comm{\hat{n}_I(\vb{r}, t)}{\hat{H}_{1,I}(t')}}_0 \dd{t'} +\end{aligned}$$ + +Where the subscript $I$ refers to the [interaction picture](/know/concept/interaction-picture/), +and the expectation $\Expval{}_0$ is for +a thermal equilibrium before the perturbation was applied. +Now consider a harmonic $\hat{H}_1$: + +$$\begin{aligned} + \hat{H}_{1,S}(t) + = e^{i (\omega + i \eta) t} \int_{-\infty}^\infty U(\vb{r}) \: \hat{n}_S(\vb{r}) \dd{\vb{r}} +\end{aligned}$$ + +Where $S$ is the Schrödinger picture, +$\eta$ is a positive infinitesimal to ensure convergence later, +and $U(\vb{r})$ is an arbitrary potential function. +The Kubo formula becomes: + +$$\begin{aligned} + \delta\!\Expval{ {\hat{n}}}\!(\vb{r}, t) + = \iint_{-\infty}^\infty \chi(\vb{r}, \vb{r}'; t, t') \: U(\vb{r}') \: e^{i (\omega + i \eta) t'} \dd{t'} \dd{\vb{r}'} +\end{aligned}$$ + +Here, $\chi$ is the density-density correlation function, +i.e. a two-particle [Green's function](/know/concept/greens-functions/): + +$$\begin{aligned} + \chi(\vb{r}, \vb{r}'; t, t') + \equiv - \frac{i}{\hbar} \Theta(t - t') \Expval{\Comm{\hat{n}_I(\vb{r}, t)}{\hat{n}_I(\vb{r}', t')}}_0 +\end{aligned}$$ + +Let us assume that the unperturbed system (i.e. without $U$) is spatially uniform, +so that $\chi$ only depends on the difference $\vb{r} - \vb{r}'$. +We then take its [Fourier transform](/know/concept/fourier-transform/) +$\vb{r}\!-\!\vb{r}' \to \vb{q}$: + +$$\begin{aligned} + \chi(\vb{q}; t, t') + &= \int_{-\infty}^\infty \chi(\vb{r} - \vb{r}'; t, t') \: e^{- i \vb{q} \cdot (\vb{r} - \vb{r}')} \dd{\vb{r}} + \\ + &= -\frac{i}{\hbar} \frac{\Theta(t \!-\! t')}{(2 \pi)^{2D}} \iiint + \Expval{\Comm{\hat{n}_I(\vb{q}_1, t)}{\hat{n}_I(\vb{q}_2, t')}}_0 + \: e^{i \vb{q}_1 \cdot \vb{r}} e^{i \vb{q}_2 \cdot \vb{r}'} e^{- i \vb{q} \cdot (\vb{r} - \vb{r}')} \dd{\vb{q}_1} \dd{\vb{q}_2} \dd{\vb{r}} +\end{aligned}$$ + +Where both $\hat{n}_I$ have been written as inverse Fourier transforms, +giving a factor $(2 \pi)^{-2 D}$, with $D$ being the number of spatial dimensions. +We rearrange to get a [Dirac delta function](/know/concept/dirac-delta-function/) $\delta$: + +$$\begin{aligned} + \chi(\vb{q}; t, t') + &= -\frac{i}{\hbar} \frac{\Theta(t \!-\! t')}{(2 \pi)^{2D}} \iiint + \Expval{\Comm{\hat{n}_I(\vb{q}_1, t)}{\hat{n}_I(\vb{q}_2, t')}}_0 + \: e^{i (\vb{q}_1 - \vb{q}) \cdot \vb{r}} e^{i (\vb{q}_2 + \vb{q}) \cdot \vb{r}'} \dd{\vb{q}_1} \dd{\vb{q}_2} \dd{\vb{r}} + \\ + &= -\frac{i}{\hbar} \frac{\Theta(t \!-\! t')}{(2 \pi)^D} \iint + \Expval{\Comm{\hat{n}_I(\vb{q}_1, t)}{\hat{n}_I(\vb{q}_2, t')}}_0 + \: \delta(\vb{q}_1 \!-\! \vb{q}) \: e^{i (\vb{q}_2 + \vb{q}) \cdot \vb{r}'} \dd{\vb{q}_1} \dd{\vb{q}_2} + \\ + &= -\frac{i}{\hbar} \frac{\Theta(t \!-\! t')}{(2 \pi)^D} \int + \Expval{\Comm{\hat{n}_I(\vb{q}, t)}{\hat{n}_I(\vb{q}_2, t')}}_0 + \: e^{i (\vb{q}_2 + \vb{q}) \cdot \vb{r}'} \dd{\vb{q}_2} +\end{aligned}$$ + +On the left, $\vb{r}'$ does not appear, so it must also disappear on the right. +If we choose an arbitrary (hyper)cube of volume $V$ in real space, +then clearly $\int_V \dd{\vb{r}'} = V$. Therefore: + +$$\begin{aligned} + \chi(\vb{q}; t, t') + &= -\frac{i}{\hbar} \frac{\Theta(t \!-\! t')}{(2 \pi)^D} \frac{1}{V} \int_V \int_{-\infty}^\infty + \Expval{\Comm{\hat{n}_I(\vb{q}, t)}{\hat{n}_I(\vb{q}_2, t')}}_0 + \: e^{i (\vb{q}_2 + \vb{q}) \cdot \vb{r}'} \dd{\vb{q}_2} \dd{\vb{r}'} +\end{aligned}$$ + +For $V \to \infty$ we get a Dirac delta function, +but in fact the conclusion holds for finite $V$ too: + +$$\begin{aligned} + \chi(\vb{q}; t, t') + &= -\frac{i}{\hbar} \Theta(t \!-\! t') \frac{1}{V} \int_{-\infty}^\infty + \Expval{\Comm{\hat{n}_I(\vb{q}, t)}{\hat{n}_I(\vb{q}_2, t')}}_0 \: \delta(\vb{q}_2 \!+\! \vb{q}) \dd{\vb{q}_2} + \\ + &= -\frac{i}{\hbar} \Theta(t \!-\! t') \frac{1}{V} \Expval{\Comm{\hat{n}_I(\vb{q}, t)}{\hat{n}_I(-\vb{q}, t')}}_0 +\end{aligned}$$ + +Similarly, if the unperturbed Hamiltonian $\hat{H}_0$ is time-independent, +$\chi$ only depends on the time difference $t - t'$. +Note that $\delta{\Expval{\hat{n}}}$ already has the form of a Fourier transform, +which gives us an opportunity to rewrite $\chi$ +in the [Lehmann representation](/know/concept/lehmann-representation/): + +$$\begin{aligned} + \chi(\vb{q}, \omega) + = \frac{1}{Z V} \sum_{\nu \nu'} + \frac{\matrixel{\nu}{\hat{n}_S(\vb{q})}{\nu'} \matrixel{\nu'}{\hat{n}_S(-\vb{q})}{\nu}}{\hbar (\omega + i \eta) + E_\nu - E_{\nu'}} + \Big( e^{-\beta E_\nu} - e^{- \beta E_{\nu'}} \Big) +\end{aligned}$$ + +Where $\Ket{\nu}$ and $\Ket{\nu'}$ are many-electron eigenstates of $\hat{H}_0$, +and $Z$ is the [grand partition function](/know/concept/grand-canonical-ensemble/). +According to the [convolution theorem](/know/concept/convolution-theorem/) +$\delta{\Expval{\hat{n}}}(\vb{q}, \omega) = \chi(\vb{q}, \omega) \: U(\vb{q})$. +In anticipation, we swap $\nu$ and $\nu''$ in the second term, +so the general response function is written as: + +$$\begin{aligned} + \chi(\vb{q}, \omega) + = \frac{1}{Z V} \sum_{\nu \nu'} \bigg( + \frac{\matrixel{\nu}{\hat{n}(\vb{q})}{\nu'} \matrixel{\nu'}{\hat{n}(-\vb{q})}{\nu}} + {\hbar (\omega + i \eta) + E_\nu - E_{\nu'}} + - \frac{\matrixel{\nu}{\hat{n}(-\vb{q})}{\nu'} \matrixel{\nu'}{\hat{n}(\vb{q})}{\nu}} + {\hbar (\omega + i \eta) + E_{\nu'} - E_\nu} \bigg) e^{-\beta E_\nu} +\end{aligned}$$ + +All operators are in the Schrödinger picture from now on, hence we dropped the subscript $S$. + +To proceed, we need to rewrite $\hat{n}(\vb{q})$ somehow. +If we neglect electron-electron interactions, +the single-particle states are simply plane waves, in which case: + +$$\begin{aligned} + \hat{n}(\vb{q}) + = \sum_{\sigma \vb{k}} \hat{c}_{\sigma,\vb{k}}^\dagger \hat{c}_{\sigma,\vb{k} + \vb{q}} + \qquad \qquad + \hat{n}(-\vb{q}) + = \hat{n}^\dagger(\vb{q}) +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-density"/> +<label for="proof-density">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-density">Proof.</label> +Starting from the general definition of $\hat{n}$, +we write out the field operators $\hat{\Psi}(\vb{r})$, +and insert the known non-interacting single-electron orbitals +$\psi_\vb{k}(\vb{r}) = e^{i \vb{k} \cdot \vb{r}} / \sqrt{V}$: + +$$\begin{aligned} + \hat{n}(\vb{r}) + \equiv \hat{\Psi}{}^\dagger(\vb{r}) \hat{\Psi}(\vb{r}) + = \sum_{\vb{k} \vb{k}'} \psi_{\vb{k}}^*(\vb{r}) \: \psi_{\vb{k}'}(\vb{r})\: \hat{c}_{\vb{k}}^\dagger \hat{c}_{\vb{k}'} + = \frac{1}{V} \sum_{\vb{k} \vb{k}'} e^{i (\vb{k}' - \vb{k}) \cdot \vb{r}} \hat{c}_{\vb{k}}^\dagger \hat{c}_{\vb{k}'} +\end{aligned}$$ + +Taking the Fourier transfom yields a Dirac delta function $\delta$: + +$$\begin{aligned} + \hat{n}(\vb{q}) + = \frac{1}{V} \int_{-\infty}^\infty + \sum_{\vb{k} \vb{k}'} \hat{c}_{\vb{k}}^\dagger \hat{c}_{\vb{k}'} \: e^{i (\vb{k}' - \vb{k} - \vb{q})\cdot \vb{r}} \dd{\vb{r}} + = \frac{(2 \pi)^D}{V} \sum_{\vb{k} \vb{k}'} \hat{c}_{\vb{k}}^\dagger \hat{c}_{\vb{k}'} \: \delta(\vb{k}' \!-\! \vb{k} \!-\! \vb{q}) +\end{aligned}$$ + +If we impose periodic boundary conditions +on our $D$-dimensional hypercube of volume $V$, +then $\vb{k}$ becomes discrete, +with per-value spacing $2 \pi / V^{1/D}$ along each axis. + +Consequently, each orbital $\psi_\vb{k}$ uniquely occupies +a volume $(2 \pi)^D / V$ in $\vb{k}$-space, so we make the approximation +$\sum_{\vb{k}} \approx V / (2 \pi)^D \int_{-\infty}^\infty \dd{\vb{k}}$. +This becomes exact for $V \to \infty$, +in which case $\vb{k}$ also becomes continuous again, +which is what we want for jellium. + +We apply this standard trick from condensed matter physics to $\hat{n}$, +and $V$ cancels out: + +$$\begin{aligned} + \hat{n}(\vb{q}) + &= \frac{(2 \pi)^D}{V} \frac{V}{(2 \pi)^D} \sum_{\vb{k}} \int_{-\infty}^\infty + \hat{c}_{\vb{k}}^\dagger \hat{c}_{\vb{k}'} \: \delta(\vb{k}' \!-\! \vb{k} \!-\! \vb{q}) \dd{\vb{k}'} + = \sum_{\vb{k}} \hat{c}_{\vb{k}}^\dagger \hat{c}_{\vb{k} + \vb{q}} +\end{aligned}$$ + +For negated arguments, we simply define $\vb{k}' \equiv \vb{k} - \vb{q}$ +to show that $\hat{n}(-\vb{q}) = \hat{n}{}^\dagger(\vb{q})$, +which can also be understood as a consequence of $\hat{n}(\vb{r})$ being real: + +$$\begin{aligned} + \hat{n}(-\vb{q}) + = \sum_{\vb{k}} \hat{c}_{\vb{k}}^\dagger \hat{c}_{\vb{k} - \vb{q}} + = \sum_{\vb{k}'} \hat{c}_{\vb{k}' + \vb{q}}^\dagger \hat{c}_{\vb{k}'} + = \hat{n}^\dagger(\vb{q}) +\end{aligned}$$ + +The summation variable $\vb{k}$ has an associated spin $\sigma$, +and $\hat{n}$ does not carry any spin. +</div> +</div> + +When neglecting interactions, it is tradition to rename $\chi$ to $\chi_0$. +We insert $\hat{n}$, suppressing spin: + +$$\begin{aligned} + \chi_0 + &= \frac{1}{Z V} \sum_{\vb{k} \vb{k}'} \sum_{\nu \nu'} \bigg( + \frac{\matrixel{\nu}{\hat{c}_{\vb{k}}^\dagger \hat{c}_{\vb{k} + \vb{q}}}{\nu'} + \matrixel{\nu'}{\hat{c}_{\vb{k}' + \vb{q}}^\dagger \hat{c}_{\vb{k}'}}{\nu}} + {\hbar (\omega + i \eta) + E_\nu - E_{\nu'}} + - \frac{\matrixel{\nu}{\hat{c}_{\vb{k} + \vb{q}}^\dagger \hat{c}_{\vb{k}}}{\nu'} + \matrixel{\nu'}{\hat{c}_{\vb{k}'}^\dagger \hat{c}_{\vb{k}' + \vb{q}}}{\nu}} + {\hbar (\omega + i \eta) + E_{\nu'} - E_\nu} \bigg) e^{-\beta E_\nu} +\end{aligned}$$ + +Here, $\matrixel{\nu}{\hat{c}_{\vb{k}}^\dagger \hat{c}_{\vb{k} + \vb{q}}}{\nu'}$ +is only nonzero if $\Ket{\nu'}$ is contructed from $\Ket{\nu}$ +by moving an electron from $\vb{k}$ to $\vb{k} \!+\! \vb{q}$, +and analogously for the other inner products. +As a result, $\vb{k} = \vb{k}'$ (and $\sigma = \sigma'$). + +For the same reason, the energy difference $E_\nu \!-\! E_{\nu'}$ +can simply be replaced by the cost of the single-particle excitation +$\xi_{\vb{k}} \!-\! \xi_{\vb{k} + \vb{q}}$, +where $\xi_{\vb{k}}$ is the energy of a $\vb{k}$-orbital. +Therefore: + +$$\begin{aligned} + \chi_0 + &= \frac{1}{Z V} \sum_{\vb{k}} \sum_{\nu \nu'} \bigg( + \frac{\matrixel{\nu}{\hat{c}_{\vb{k}}^\dagger \hat{c}_{\vb{k} + \vb{q}}}{\nu'} + \matrixel{\nu'}{\hat{c}_{\vb{k} + \vb{q}}^\dagger \hat{c}_{\vb{k}}}{\nu}} + {\hbar (\omega + i \eta) + \xi_{\vb{k}} - \xi_{\vb{k} + \vb{q}}} + - \frac{\matrixel{\nu}{\hat{c}_{\vb{k} + \vb{q}}^\dagger \hat{c}_{\vb{k}}}{\nu'} + \matrixel{\nu'}{\hat{c}_{\vb{k}}^\dagger \hat{c}_{\vb{k} + \vb{q}}}{\nu}} + {\hbar (\omega + i \eta) + \xi_{\vb{k}} - \xi_{\vb{k} + \vb{q}}} \bigg) e^{-\beta E_\nu} +\end{aligned}$$ + +Notice that we have eliminated all dependence on $\Ket{\nu'}$, +so we remove it by $\sum_{\nu} \Ket{\nu} \Bra{\nu} = 1$: + +$$\begin{aligned} + \chi_0 + &= \frac{1}{Z V} \sum_{\vb{k}} \sum_{\nu} \bigg( + \frac{\matrixel{\nu}{\hat{c}_{\vb{k}}^\dagger \hat{c}_{\vb{k} + \vb{q}} \hat{c}_{\vb{k} + \vb{q}}^\dagger \hat{c}_{\vb{k}}}{\nu}} + {\hbar (\omega + i \eta) + \xi_{\vb{k}} - \xi_{\vb{k} + \vb{q}}} + - \frac{\matrixel{\nu}{\hat{c}_{\vb{k} + \vb{q}}^\dagger \hat{c}_{\vb{k}} \hat{c}_{\vb{k}}^\dagger \hat{c}_{\vb{k} + \vb{q}}}{\nu}} + {\hbar (\omega + i \eta) + \xi_{\vb{k}} - \xi_{\vb{k} + \vb{q}}} \bigg) e^{-\beta E_\nu} + \\ + &= \frac{1}{Z V} \sum_{\vb{k}} \sum_{\nu} + \frac{\matrixel{\nu}{\comm{\hat{c}_{\vb{k}}^\dagger \hat{c}_{\vb{k} + \vb{q}}} + {\hat{c}_{\vb{k} + \vb{q}}^\dagger \hat{c}_{\vb{k}}} \: e^{- \beta \hat{H}_0}}{\nu}} + {\hbar (\omega + i \eta) + \xi_{\vb{k}} - \xi_{\vb{k} + \vb{q}}} +\end{aligned}$$ + +Where we recognized the commutator, +and eliminated $E_\nu$ using $\hat{H}_0 \Ket{n} = E_\nu \Ket{\nu}$. +The resulting expression has the form of a matrix trace $\Tr$ +and a thermal expectation $\Expval{}_0$: + +$$\begin{aligned} + \chi_0 + &= \frac{1}{Z V} \sum_{\vb{k}} \frac{\Tr\!\big(\comm{\hat{c}_{\vb{k}}^\dagger \hat{c}_{\vb{k} + \vb{q}}} + {\hat{c}_{\vb{k} + \vb{q}}^\dagger \hat{c}_{\vb{k}}} \: e^{- \beta \hat{H}_0} \big)} + {\hbar (\omega + i \eta) + \xi_{\vb{k}} - \xi_{\vb{k} + \vb{q}}} + = \frac{1}{V} \sum_{\vb{k}} + \frac{\expval{\comm{\hat{c}_{\vb{k}}^\dagger \hat{c}_{\vb{k} + \vb{q}}}{\hat{c}_{\vb{k} + \vb{q}}^\dagger \hat{c}_{\vb{k}}}}_0} + {\hbar (\omega + i \eta) + \xi_{\vb{k}} - \xi_{\vb{k} + \vb{q}}} +\end{aligned}$$ + +This commutator can be evaluated, +and in this particular case it turns out to be: + +$$\begin{aligned} + \comm{\hat{c}_{\vb{k}}^\dagger \hat{c}_{\vb{k} + \vb{q}}}{\hat{c}_{\vb{k} + \vb{q}}^\dagger \hat{c}_{\vb{k}}} + = \hat{c}_{\vb{k}}^\dagger \hat{c}_{\vb{k}} - \hat{c}_{\vb{k} + \vb{q}}^\dagger \hat{c}_{\vb{k} + \vb{q}} +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-commutator"/> +<label for="proof-commutator">Proof</label> +<div class="hidden"> +<label for="proof-commutator">Proof.</label> +In general, for any single-particle states labeled by $m$, $n$, $o$ and $p$, we have: +$$\begin{aligned} + \comm{\hat{c}_m^\dagger \hat{c}_n}{\hat{c}_o^\dagger \hat{c}_p} + &= \hat{c}_m^\dagger \hat{c}_n \hat{c}_o^\dagger \hat{c}_p - \hat{c}_o^\dagger \hat{c}_p \hat{c}_m^\dagger \hat{c}_n + \\ + &= \hat{c}_m^\dagger \big( \acomm{\hat{c}_n}{\hat{c}_o^\dagger} - \hat{c}_o^\dagger \hat{c}_n \big) \hat{c}_p + - \hat{c}_o^\dagger \big( \acomm{\hat{c}_p}{\hat{c}_m^\dagger} - \hat{c}_m^\dagger \hat{c}_p \big) \hat{c}_n +\end{aligned}$$ + +Using the standard fermion anticommutation relations, this becomes: + +$$\begin{aligned} + \comm{\hat{c}_m^\dagger \hat{c}_n}{\hat{c}_o^\dagger \hat{c}_p} + &= \hat{c}_m^\dagger \big( \delta_{no} - \hat{c}_o^\dagger \hat{c}_n \big) \hat{c}_p + - \hat{c}_o^\dagger \big( \delta_{pm} - \hat{c}_m^\dagger \hat{c}_p \big) \hat{c}_n + \\ + &= \hat{c}_m^\dagger \hat{c}_p \: \delta_{no} - \hat{c}_m^\dagger \hat{c}_o^\dagger \hat{c}_n \hat{c}_p + - \hat{c}_o^\dagger \hat{c}_n \: \delta_{pm} + \hat{c}_o^\dagger \hat{c}_m^\dagger \hat{c}_p \hat{c}_n + \\ + &= \hat{c}_m^\dagger \hat{c}_p \: \delta_{no} - \hat{c}_o^\dagger \hat{c}_n \: \delta_{pm} +\end{aligned}$$ + +In this case, $m = p = \vb{k}$ and $n = o = \vb{k} \!+\! \vb{q}$, +so the Kronecker deltas are unnecessary. +</div> +</div> + +We substitute this result into $\chi_0$, +and reintroduce the spin index $\sigma$ associated with $\vb{k}$: + +$$\begin{aligned} + \chi_0(\vb{q}, \omega) + = \frac{1}{V} \sum_{\sigma \vb{k}} + \frac{\expval{\hat{c}_{\sigma,\vb{k}}^\dagger \hat{c}_{\sigma,\vb{k}} - \hat{c}_{\sigma,\vb{k}+\vb{q}}^\dagger \hat{c}_{\sigma,\vb{k}+\vb{q}}}_0} + {\hbar (\omega + i \eta) + \xi_{\vb{k}} - \xi_{\vb{k} + \vb{q}}} +\end{aligned}$$ + +The operator $\hat{c}_{\sigma.\vb{k}}^\dagger \hat{c}_{\sigma.\vb{k}}$ +simply counts the number of electrons in state $(\sigma, \vb{k})$, +which is given by the [Fermi-Dirac distribution](/know/concept/fermi-dirac-distribution/) $n_F$. +This gives us the **Lindhard response function**: + +$$\begin{aligned} + \boxed{ + \chi_0(\vb{q}, \omega) + = \frac{1}{V} \sum_{\sigma \vb{k}} + \frac{n_F(\xi_{\vb{k}}) - n_F(\xi_{\vb{k} + \vb{q}})} + {\hbar (\omega + i \eta) + \xi_{\vb{k}} - \xi_{\vb{k} + \vb{q}}} + } +\end{aligned}$$ + +From this, we would like to get the +[dielectric function](/know/concept/dielectric-function/) $\varepsilon_r$. +Recall its definition, where $U_\mathrm{tot}$, $U_\mathrm{ext}$, and $U_\mathrm{ind}$ +are the total, external and induced potentials, respectively: + +$$\begin{aligned} + U_\mathrm{tot} + = U_\mathrm{ext} + U_\mathrm{ind} + = \frac{U_\mathrm{ext}}{\varepsilon_r} +\end{aligned}$$ + +Note that these are all *energy* potentials: +this choice is justified because all energy potentials +are caused by electric fields in this case. +The *electric* potential is recoverable as +$\Phi_\mathrm{tot} = q_e U_\mathrm{tot}$, +where $q_e < 0$ is the charge of an electron. + +From the Lindhard response function $\chi_0$, +we get the induced particle density offset $\delta{\Expval{\hat{n}}}$ +caused by a potential $U$. +The density $\delta{\Expval{\hat{n}}}$ should be self-consistent, +implying $U = U_\mathrm{tot}$. +In other words, we have a linear relation +$\delta{\Expval{\hat{n}}} = \chi_0 U_\mathrm{tot}$, +so the standard formula for $\varepsilon_r$ gives: + +$$\begin{aligned} + \boxed{ + \varepsilon_r(\vb{q}, \omega) + = 1 - \frac{U_{ee}(\vb{q})}{V} + \sum_{\sigma \vb{k}} \frac{n_F(\xi_{\vb{k}}) - n_F(\xi_{\vb{k} + \vb{q}})}{\hbar (\omega + i \eta) + \xi_{\vb{k}} - \xi_{\vb{k} + \vb{q}}} + } +\end{aligned}$$ + +Where $U_{ee}(\vb{q}) = q_e^2 / (\varepsilon_0 |\vb{q}|^2)$ +is Coulomb repulsion. +This is the **Lindhard dielectric function** of a free +non-interacting electron gas, +at any temperature and for any dimensionality. + + + +## References +1. K.S. Thygesen, + *Advanced solid state physics: linear response theory*, + 2013, unpublished. +2. H. Bruus, K. Flensberg, + *Many-body quantum theory in condensed matter physics*, + 2016, Oxford. +3. G. Grosso, G.P. Parravicini, + *Solid state physics*, + 2nd edition, Elsevier. diff --git a/source/know/concept/lorentz-force/index.md b/source/know/concept/lorentz-force/index.md new file mode 100644 index 0000000..293cdbc --- /dev/null +++ b/source/know/concept/lorentz-force/index.md @@ -0,0 +1,190 @@ +--- +title: "Lorentz force" +date: 2021-09-08 +categories: +- Physics +- Electromagnetism +- Plasma physics +layout: "concept" +--- + +The **Lorentz force** is an empirical force used to define +the [electric field](/know/concept/electric-field/) $\vb{E}$ +and [magnetic field](/know/concept/magnetic-field/) $\vb{B}$. +For a particle with charge $q$ moving with velocity $\vb{u}$, +the Lorentz force $\vb{F}$ is given by: + +$$\begin{aligned} + \boxed{ + \vb{F} + = q (\vb{E} + \vb{u} \cross \vb{B}) + } +\end{aligned}$$ + + +## Uniform electric field + +Consider the simple case of an electric field $\vb{E}$ +that is uniform in all of space. +In the absence of a magnetic field $\vb{B} = 0$ +and any other forces, +Newton's second law states: + +$$\begin{aligned} + \vb{F} + = m \dv{\vb{u}}{t} + = q \vb{E} +\end{aligned}$$ + +This is straightforward to integrate in time, +for a given initial velocity vector $\vb{u}_0$: + +$$\begin{aligned} + \vb{u}(t) + = \frac{q}{m} \vb{E} t + \vb{u}_0 +\end{aligned}$$ + +And then the particle's position $\vb{x}(t)$ +is found be integrating once more, +with $\vb{x}(0) = \vb{x}_0$: + +$$\begin{aligned} + \boxed{ + \vb{x}(t) + = \frac{q}{2 m} \vb{E} t^2 + \vb{u}_0 t + \vb{x}_0 + } +\end{aligned}$$ + +In summary, unsurprisingly, a uniform electric field $\vb{E}$ +accelerates the particle with a constant force $\vb{F} = q \vb{E}$. +Note that the direction depends on the sign of $q$. + + +## Uniform magnetic field + +Consider the simple case of a uniform magnetic field +$\vb{B} = (0, 0, B)$ in the $z$-direction, +without an electric field $\vb{E} = 0$. +If there are no other forces, +Newton's second law states: + +$$\begin{aligned} + \vb{F} + = m \dv{\vb{u}}{t} + = q \vb{u} \cross \vb{B} +\end{aligned}$$ + +Evaluating the cross product yields +three coupled equations for the components of $\vb{u}$: + +$$\begin{aligned} + \dv{u_x}{t} + = \frac{q B}{m} u_y + \qquad \quad + \dv{u_y}{t} + = - \frac{q B}{m} u_x + \qquad \quad + \dv{u_z}{t} + = 0 +\end{aligned}$$ + +Differentiating the first equation with respect to $t$, +and substituting $\idv{u_y}{t}$ from the second, +we arrive at the following harmonic oscillator: + +$$\begin{aligned} + \dvn{2}{u_x}{t} = - \omega_c^2 u_x +\end{aligned}$$ + +Where we have defined the **cyclotron frequency** $\omega_c$ as follows, +which may be negative: + +$$\begin{aligned} + \boxed{ + \omega_c + \equiv \frac{q B}{m} + } +\end{aligned}$$ + +Suppose we choose our initial conditions so that +the solution for $u_x(t)$ is given by: + +$$\begin{aligned} + u_x(t) + = u_\perp \cos(\omega_c t) +\end{aligned}$$ + +Where $u_\perp \equiv \sqrt{u_x^2 + u_y^2}$ is the constant total transverse velocity. +Then $u_y(t)$ is found to be: + +$$\begin{aligned} + u_y(t) + = \frac{m}{q B} \dv{u_x}{t} + = - \frac{m \omega_c}{q B} u_\perp \sin(\omega_c t) + = - u_\perp \sin(\omega_c t) +\end{aligned}$$ + +This means that the particle moves in a circle, +in a direction determined by the sign of $\omega_c$. + +Integrating the velocity yields the position, +where we refer to the integration constants $x_{gc}$ and $y_{gc}$ +as the **guiding center**, around which the particle orbits or **gyrates**: + +$$\begin{aligned} + x(t) + = \frac{u_\perp}{\omega_c} \sin(\omega_c t) + x_{gc} + \qquad \quad + y(t) + = \frac{u_\perp}{\omega_c} \cos(\omega_c t) + y_{gc} +\end{aligned}$$ + +The radius of this orbit is known as the **Larmor radius** or **gyroradius** $r_L$, given by: + +$$\begin{aligned} + \boxed{ + r_L + \equiv \frac{u_\perp}{|\omega_c|} + = \frac{m u_\perp}{|q| B} + } +\end{aligned}$$ + +Finally, it is easy to integrate the equation +for the $z$-axis velocity $u_z$, which is conserved: + +$$\begin{aligned} + z(t) + = z_{gc} + = u_z t + z_0 +\end{aligned}$$ + +In conclusion, the particle's motion parallel to $\vb{B}$ +is not affected by the magnetic field, +while its motion perpendicular to $\vb{B}$ +is circular around an imaginary guiding center. +The end result is that particles follow a helical path +when moving through a uniform magnetic field: + +$$\begin{aligned} + \boxed{ + \vb{x}(t) + = \frac{u_\perp}{\omega_c} + \begin{pmatrix} + \sin(\omega_c t) \\ \cos(\omega_c t) \\ 0 + \end{pmatrix} + + \vb{x}_{gc}(t) + } +\end{aligned}$$ + +Where $\vb{x}_{gc}(t) \equiv (x_{gc}, y_{gc}, z_{gc})$ +is the position of the guiding center. +For a detailed look at how $\vb{B}$ and $\vb{E}$ +can affect the guiding center's motion, +see [guiding center theory](/know/concept/guiding-center-theory/). + + + +## References +1. F.F. Chen, + *Introduction to plasma physics and controlled fusion*, + 3rd edition, Springer. diff --git a/source/know/concept/lubrication-theory/index.md b/source/know/concept/lubrication-theory/index.md new file mode 100644 index 0000000..04acd30 --- /dev/null +++ b/source/know/concept/lubrication-theory/index.md @@ -0,0 +1,215 @@ +--- +title: "Lubrication theory" +date: 2021-06-03 +categories: +- Physics +- Fluid mechanics +- Fluid dynamics +layout: "concept" +--- + +**Lubricants** are widely used +to reduce friction between two moving surfaces. +In fluid mechanics, **lubrication theory** +is the study of fluids that are tightly constrained in one dimension, +especially those in small gaps between moving surfaces. + +For simplicity, we limit ourselves to 2D +by assuming that everything is constant along the $z$-axis. +Consider a gap of width $d$ (along $y$) and length $L$ (along $x$), +where $d \ll L$, containing the fluid. +Outside the gap, the lubricant has a +[Reynolds number](/know/concept/reynolds-number/) $\mathrm{Re} \approx U L / \nu$. + +Inside the gap, the Reynolds number $\mathrm{Re}_\mathrm{gap}$ is different. +This is because advection will dominate along the $x$-axis (gap length), +and viscosity along the $y$-axis (gap width). +Therefore: + +$$\begin{aligned} + \mathrm{Re}_\mathrm{gap} + \approx \frac{|(\va{v} \cdot \nabla) \va{v}|}{|\nu \nabla^2 \va{v}|} + \approx \frac{U^2 / L}{\nu U / d^2} + \approx \frac{d^2}{L^2} \mathrm{Re} +\end{aligned}$$ + +If $d$ is small enough compared to $L$, +then $\mathrm{Re}_\mathrm{gap} \ll 1$. +More formally, we need $d \ll L / \sqrt{\mathrm{Re}}$, +so we are inside the boundary layer, +in the realm of the [Prandtl equations](/know/concept/prandtl-equations/). + +Let $\mathrm{Re}_\mathrm{gap} \ll 1$. +We are thus dealing with *Stokes flow*, in which case +the [Navier-Stokes equations](/know/concept/navier-stokes/equations/) +can be reduced to the following *Stokes equations*: + +$$\begin{aligned} + \pdv{p}{x} + = \eta \: \Big( \pdvn{2}{v_x}{x} + \pdvn{2}{v_x}{y} \Big) + \qquad \quad + \pdv{p}{y} + = \eta \: \Big( \pdvn{2}{v_y}{x} + \pdvn{2}{v_y}{y} \Big) +\end{aligned}$$ + +Let the $y = 0$ plane be an infinite flat surface, +sliding in the positive $x$-direction at a constant velocity $U$. +On the other side of the gap, +an arbitrary surface is described by $h(x)$. + +Since the gap is so narrow, +and the surfaces' movements cause large shear stresses inside, +$v_y$ is negligible compared to $v_x$. +Furthermore, because the gap is so long, +we assume that $\ipdv{v_x}{x}$ is negligible compared to $\ipdv{v_x}{y}$. +This reduces the Stokes equations to: + +$$\begin{aligned} + \pdv{p}{x} + = \eta \pdvn{2}{v_x}{y} + \qquad \quad + \pdv{p}{y} + = 0 +\end{aligned}$$ + +This result could also be derived from the Prandtl equations. +In any case, it tells us that $p$ only depends on $x$, +allowing us to integrate the former equation: + +$$\begin{aligned} + v_x + = \frac{p'}{2 \eta} y^2 + C_1 y + C_2 +\end{aligned}$$ + +Where $C_1$ and $C_2$ are integration constants. +At $y = 0$, the viscous *no-slip* condition demands that $v_x = U$, so $C_2 = U$. +Likewise, at $y = h(x)$, we need $v_x = 0$, leading us to: + +$$\begin{aligned} + v_x + = \frac{p'}{2 \eta} y^2 - \Big( \frac{p'}{2 \eta} h + \frac{U}{h} \Big) y + U +\end{aligned}$$ + +The moving bottom surface drags fluid in the $x$-direction +at a volumetric rate $Q$, given by: + +$$\begin{aligned} + Q + = \int_0^{h(x)} v_x(x, y) \dd{y} + = \bigg[ \frac{p'}{6 \eta} y^3 - \frac{p'}{4 \eta} h y^2 - \frac{U}{2 h} y^2 + U y \bigg]_0^{h} + = - \frac{p'}{12 \eta} h^3 + \frac{U}{2} h +\end{aligned}$$ + +Assuming that the lubricant is incompressible, +meaning that the same volume of fluid must be leaving a point as is entering it. +In other words, $Q$ is independent of $x$, +which allows us to write $p'(x)$ in terms of +measurable constants and the known function $h(x)$: + +$$\begin{aligned} + \boxed{ + p' + = 6 \eta \: \Big( \frac{U}{h^2} - \frac{2 Q}{h^3} \Big) + } +\end{aligned}$$ + +Then we insert this into our earlier expression for $v_x$, yielding: + +$$\begin{aligned} + v_x + &= 3 y (y - h) \Big( \frac{U}{h^2} - \frac{2 Q}{h^3} \Big) - \frac{U h}{h^2} y + \frac{U h^2}{h^2} +\end{aligned}$$ + +Which, after some rearranging, can be written in the following form: + +$$\begin{aligned} + \boxed{ + v_x + = U \frac{(3 y - h) (y - h)}{h^2} - Q \frac{6 y (y - h)}{h^3} + } +\end{aligned}$$ + +With this, we can find $v_y$ by exploiting incompressibility, +i.e. the continuity equation states: + +$$\begin{aligned} + \pdv{v_y}{y} + = - \pdv{v_x}{x} + = - 2 h' \frac{U h - 3 Q}{h^4} \big( 2 h y - 3 y^2 \big) +\end{aligned}$$ + +Integrating with respect to $y$ thus leads to the following transverse velocity $v_y$: + +$$\begin{aligned} + \boxed{ + v_y + = - 2 h' \frac{U h - 3 Q}{h^4} y^2 (h - y) + } +\end{aligned}$$ + +Typically, the lubricant is not in a preexisting pressure differential, +i.e it is not getting pumped through the system. +Although the pressure gradient $p'$ need not be zero, +we therefore expect that its integral vanishes: + +$$\begin{aligned} + 0 + = \int_L p'(x) \dd{x} + = 6 \eta U \int_L \frac{1}{h(x)^2} \dd{x} - 12 \eta Q \int_L \frac{1}{h(x)^3} \dd{x} +\end{aligned}$$ + +Isolating this for $Q$, and defining $q$ as below, yields a simple equation: + +$$\begin{aligned} + Q + = \frac{1}{2} U q + \qquad \quad + q + \equiv \frac{\int_L h^{-2} \dd{x}}{\int_L h^{-3} \dd{x}} +\end{aligned}$$ + +We substitute this into $v_x$ and rearrange to get an interesting expression: + +$$\begin{aligned} + v_x + &= U \frac{3 y^2 - h y - 3 h y + h^2}{h^2} - U q \frac{3 y^2 - 3 h y}{h^3} + \\ + &= U \Big( 1 - \frac{y}{h} \Big) \Big( 1 - \frac{3 y (h - q)}{h^2} \Big) +\end{aligned}$$ + +The first factor is always positive, +but the second can be negative, +if for some $y$-values: + +$$\begin{aligned} + h^2 < 3 y (h - q) + \quad \implies \quad + y > \frac{h^2}{3 (h - q)} +\end{aligned}$$ + +Since $h > y$, such $y$-values will only exist +if $h$ is larger than some threshold: + +$$\begin{aligned} + 3 (h - q) > h + \quad \implies \quad + h > \frac{3}{2} q +\end{aligned}$$ + +If this condition is satisfied, +there will be some flow reversal: +rather than just getting dragged by the shearing motion, +the lubricant instead "rolls" inside the gap. +This is confirmed by $v_y$: + +$$\begin{aligned} + v_y + = - U h' \frac{2 h - 3 q}{h^4} y^2 (h - y) +\end{aligned}$$ + + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/magnetic-field/index.md b/source/know/concept/magnetic-field/index.md new file mode 100644 index 0000000..3b4c10a --- /dev/null +++ b/source/know/concept/magnetic-field/index.md @@ -0,0 +1,104 @@ +--- +title: "Magnetic field" +date: 2021-07-12 +categories: +- Physics +- Electromagnetism +layout: "concept" +--- + +The **magnetic field** $\vb{B}$ is a vector field +that describes magnetic effects, +and is defined as the field that correctly predicts +the [Lorentz force](/know/concept/lorentz-force/) +on a particle with electric charge $q$: + +$$\begin{aligned} + \vb{F} + = q \vb{v} \cross \vb{B} +\end{aligned}$$ + +If an object is placed in a magnetic field $\vb{B}$, +and wants to rotate to align itself with the field, +then its **magnetic dipole moment** $\vb{m}$ +is defined from the aligning torque $\vb{\tau}$: + +$$\begin{aligned} + \vb{\tau} = \vb{m} \times \vb{B} +\end{aligned}$$ + +Where $\vb{m}$ has units of $\mathrm{J / T}$. +From this, the **magnetization** $\vb{M}$ is defined as follows, +and roughly represents the moments per unit volume: + +$$\begin{aligned} + \vb{M} \equiv \dv{\vb{m}}{V} + \:\:\iff\:\: + \vb{m} = \int_V \vb{M} \dd{V} +\end{aligned}$$ + +If $\vb{M}$ has the same magnitude and orientation throughout the body, +then $\vb{m} = \vb{M} V$, where $V$ is the volume. +Therefore, $\vb{M}$ has units of $\mathrm{A / m}$. + +A nonzero $\vb{M}$ complicates things, +since it contributes to the field +and hence modifies $\vb{B}$. +We thus define +the "free" **auxiliary field** $\vb{H}$ +from the "bound" field $\vb{M}$ +and the "net" field $\vb{B}$: + +$$\begin{aligned} + \vb{H} \equiv \frac{1}{\mu_0} \vb{B} - \vb{M} + \:\:\iff\:\: + \vb{B} = \mu_0 (\vb{H} + \vb{M}) +\end{aligned}$$ + +Where the **magnetic permeability of free space** $\mu_0$ is a known constant. +It is important to point out some inconsistencies here: +$\vb{B}$ contains a factor of $\mu_0$, and thus measures **flux density**, +while $\vb{H}$ and $\vb{M}$ do not contain $\mu_0$, +and therefore measure **field intensity**. +Note that this convention is the opposite of the analogous +[electric fields](/know/concept/electric-field/) +$\vb{E}$, $\vb{D}$ and $\vb{P}$. +Also note that $\vb{P}$ has the opposite sign convention of $\vb{M}$. + +Some objects, called **ferromagnets** or **permanent magnets**, +have an inherently nonzero $\vb{M}$. +Others objects, when placed in a $\vb{B}$-field, +may instead gain an induced $\vb{M}$. + +When $\vb{M}$ is induced, +its magnitude is usually proportional +to the applied field strength $\vb{H}$: + +$$\begin{aligned} + \vb{B} + = \mu_0(\vb{H} + \vb{M}) + = \mu_0 (\vb{H} + \chi_m \vb{H}) + = \mu_0 \mu_r \vb{H} + = \mu \vb{H} +\end{aligned}$$ + +Where $\chi_m$ is the **volume magnetic susceptibility**, +and $\mu_r \equiv 1 + \chi_m$ and $\mu \equiv \mu_r \mu_0$ are +the **relative permeability** and **absolute permeability** +of the medium, respectively. +Materials with intrinsic magnetization, i.e. ferromagnets, +do not have a well-defined $\chi_m$. + +If $\chi_m > 0$, the medium is **paramagnetic**, +meaning it strengthens the net field $\vb{B}$. +Otherwise, if $\chi_m < 0$, the medium is **diamagnetic**, +meaning it counteracts the applied field $\vb{H}$. + +For $|\chi_m| \ll 1$, as is often the case, +the magnetization $\vb{M}$ can be approximated by: + +$$\begin{aligned} + \vb{M} + = \chi_m \vb{H} + \approx \chi_m \vb{B} / \mu_0 +\end{aligned}$$ diff --git a/source/know/concept/magnetohydrodynamics/index.md b/source/know/concept/magnetohydrodynamics/index.md new file mode 100644 index 0000000..1d8bc12 --- /dev/null +++ b/source/know/concept/magnetohydrodynamics/index.md @@ -0,0 +1,398 @@ +--- +title: "Magnetohydrodynamics" +date: 2021-10-21 +categories: +- Physics +- Plasma physics +- Electromagnetism +layout: "concept" +--- + +**Magnetohydrodynamics** (MHD) describes the dynamics +of fluids that are electrically conductive. +Notably, it is often suitable to describe plasmas, +and can be regarded as a special case of the +[two-fluid model](/know/concept/two-fluid-equations/); +we will derive it as such, +but the results are not specific to plasmas. + +In the two-fluid model, we described the plasma as two separate fluids, +but in MHD we treat it as a single conductive fluid. +The macroscopic pressure $p$ +and electric current density $\vb{J}$ are: + +$$\begin{aligned} + p + = p_i + p_e + \qquad \quad + \vb{J} + = q_i n_i \vb{u}_i + q_e n_e \vb{u}_e +\end{aligned}$$ + +Meanwhile, the macroscopic mass density $\rho$ +and center-of-mass flow velocity $\vb{u}$ +are as follows, although the ions dominate due to their large mass: + +$$\begin{aligned} + \rho + = m_i n_i + m_e n_e + \approx m_i n_i + \qquad \quad + \vb{u} + = \frac{1}{\rho} \Big( m_i n_i \vb{u}_i + m_e n_e \vb{u}_e \Big) + \approx \vb{u}_i +\end{aligned}$$ + +With these quantities in mind, +we add up the two-fluid continuity equations, +multiplied by their respective particles' masses: + +$$\begin{aligned} + 0 + &= m_i \pdv{n_i}{t} + m_e \pdv{n_e}{t} + m_i \nabla \cdot (n_i \vb{u}_i) + m_e \nabla \cdot (n_e \vb{u}_e) +\end{aligned}$$ + +After some straightforward rearranging, +we arrive at the single-fluid continuity relation: + +$$\begin{aligned} + \boxed{ + \pdv{\rho}{t} + \nabla \cdot (\rho \vb{u}) + = 0 + } +\end{aligned}$$ + +Next, consider the two-fluid momentum equations +for the ions and electrons, respectively: + +$$\begin{aligned} + m_i n_i \frac{\mathrm{D} \vb{u}_i}{\mathrm{D} t} + &= q_i n_i (\vb{E} + \vb{u}_i \cross \vb{B}) - \nabla p_i - f_{ie} m_i n_i (\vb{u}_i - \vb{u}_e) + \\ + m_e n_e \frac{\mathrm{D} \vb{u}_e}{\mathrm{D} t} + &= q_e n_e (\vb{E} + \vb{u}_e \cross \vb{B}) - \nabla p_e - f_{ei} m_e n_e (\vb{u}_e - \vb{u}_i) +\end{aligned}$$ + +We will assume that electrons' inertia +is negligible compared to the [Lorentz force](/know/concept/lorentz-force/). +Let $\tau_\mathrm{char}$ be the characteristic timescale of the plasma's dynamics, +i.e. nothing noticable happens in times shorter than $\tau_\mathrm{char}$, +then this assumption can be written as: + +$$\begin{aligned} + 1 + \gg \frac{\big| m_e n_e \mathrm{D} \vb{u}_e / \mathrm{D} t \big|}{\big| q_e n_e \vb{u}_e \cross \vb{B} \big|} + \sim \frac{m_e n_e |\vb{u}_e| / \tau_\mathrm{char}}{q_e n_e |\vb{u}_e| |\vb{B}|} + = \frac{m_e}{q_e |\vb{B}| \tau_\mathrm{char}} + = \frac{1}{\omega_{ce} \tau_\mathrm{char}} + \ll 1 +\end{aligned}$$ + +Where we have recognized the cyclotron frequency $\omega_c$ (see Lorentz force article). +In other words, our assumption is equivalent to +the electron gyration period $2 \pi / \omega_{ce}$ +being small compared to the macroscopic dynamics' timescale $\tau_\mathrm{char}$. +By construction, we can thus ignore the left-hand side +of the electron momentum equation, leaving: + +$$\begin{aligned} + m_i n_i \frac{\mathrm{D} \vb{u}_i}{\mathrm{D} t} + &= q_i n_i (\vb{E} + \vb{u}_i \cross \vb{B}) - \nabla p_i - f_{ie} m_i n_i (\vb{u}_i - \vb{u}_e) + \\ + 0 + &= q_e n_e (\vb{E} + \vb{u}_e \cross \vb{B}) - \nabla p_e - f_{ei} m_e n_e (\vb{u}_e - \vb{u}_i) +\end{aligned}$$ + +We add up these momentum equations, +recognizing the pressure $p$ and current $\vb{J}$: + +$$\begin{aligned} + m_i n_i \frac{\mathrm{D} \vb{u}_i}{\mathrm{D} t} + &= (q_i n_i + q_e n_e) \vb{E} + \vb{J} \cross \vb{B} - \nabla p + - f_{ie} m_i n_i (\vb{u}_i \!-\! \vb{u}_e) - f_{ei} m_e n_e (\vb{u}_e \!-\! \vb{u}_i) + \\ + &= (q_i n_i + q_e n_e) \vb{E} + \vb{J} \cross \vb{B} - \nabla p +\end{aligned}$$ + +Where we have used $f_{ie} m_i n_i = f_{ei} m_e n_e$ +because momentum is conserved by the underlying +[Rutherford scattering](/know/concept/rutherford-scattering/) process, +which is [elastic](/know/concept/elastic-collision/). +In other words, the momentum given by ions to electrons +is equal to the momentum received by electrons from ions. + +Since the two-fluid model assumes that +the [Debye length](/know/concept/debye-length/) $\lambda_D$ +is small compared to a "blob" $\dd{V}$ of the fluid, +we can invoke quasi-neutrality $q_i n_i + q_e n_e = 0$. +Using that $\rho \approx m_i n_i$ and $\vb{u} \approx \vb{u}_i$, +we thus arrive at the **momentum equation**: + +$$\begin{aligned} + \boxed{ + \rho \frac{\mathrm{D} \vb{u}}{\mathrm{D} t} + = \vb{J} \cross \vb{B} - \nabla p + } +\end{aligned}$$ + +However, we found this by combining two equations into one, +so some information was implicitly lost; +we need a second momentum equation. +Therefore, we return to the electrons' momentum equation, +after a bit of rearranging: + +$$\begin{aligned} + \vb{E} + \vb{u}_e \cross \vb{B} - \frac{\nabla p_e}{q_e n_e} + = \frac{f_{ei} m_e}{q_e} (\vb{u}_e - \vb{u}_i) +\end{aligned}$$ + +Again using quasi-neutrality $q_i n_i = - q_e n_e$, +the current density $\vb{J} = q_e n_e (\vb{u}_e \!-\! \vb{u}_i)$, +so: + +$$\begin{aligned} + \vb{E} + \vb{u}_e \cross \vb{B} - \frac{\nabla p_e}{q_e n_e} + = \eta \vb{J} + \qquad \quad + \eta + \equiv \frac{f_{ei} m_e}{n_e q_e^2} +\end{aligned}$$ + +Where $\eta$ is the electrical resistivity of the plasma, +see [Spitzer resistivity](/know/concept/spitzer-resistivity/) +for more information, and a rough estimate of this quantity for a plasma. + +Now, using that $\vb{u} \approx \vb{u}_i$, +we add $(\vb{u} \!-\! \vb{u}_i) \cross \vb{B} \approx 0$ to the equation, +and insert $\vb{J}$ again: + +$$\begin{aligned} + \eta \vb{J} + &= \vb{E} + \vb{u} \cross \vb{B} + (\vb{u}_e - \vb{u}_i) \cross \vb{B} - \frac{\nabla p_e}{q_e n_e} + \\ + &= \vb{E} + \vb{u} \cross \vb{B} + \frac{\vb{J} \cross \vb{B}}{q_e n_e} - \frac{\nabla p_e}{q_e n_e} +\end{aligned}$$ + +Next, we want to get rid of the pressure term. +To do so, we take the curl of the equation: + +$$\begin{aligned} + \nabla \cross (\eta \vb{J}) + = - \pdv{\vb{B}}{t} + \nabla \cross (\vb{u} \cross \vb{B}) + \nabla \cross \frac{\vb{J} \cross \vb{B}}{q_e n_e} + - \nabla \cross \frac{\nabla p_e}{q_e n_e} +\end{aligned}$$ + +Where we have used Faraday's law. +This is the **induction equation**, +and is used to compute $\vb{B}$. +The pressure term can be rewritten using the ideal gas law $p_e = k_B T_e n_e$: + +$$\begin{aligned} + \nabla \cross \frac{\nabla p_e}{q_e n_e} + = \frac{k_B}{q_e} \nabla \cross \frac{\nabla (n_e T_e)}{n_e} + = \frac{k_B}{q_e} \nabla \cross \Big( \nabla T_e + T_e \frac{\nabla n_e}{n_e} \Big) +\end{aligned}$$ + +The curl of a gradient is always zero, +and we notice that $\nabla n_e / n_e = \nabla\! \ln(n_e)$. +Then we use the vector identity $\nabla \cross (f \nabla g) = \nabla f \cross \nabla g$, +leading to: + +$$\begin{aligned} + \nabla \cross \frac{\nabla p_e}{q_e n_e} + = \frac{k_B}{q_e} \nabla \cross \big( T_e \: \nabla\! \ln(n_e) \big) + = \frac{k_B}{q_e} \big( \nabla T_e \cross \nabla\! \ln(n_e) \big) + = \frac{k_B}{q_e n_e} \big( \nabla T_e \cross \nabla n_e \big) +\end{aligned}$$ + +It is reasonable to assume that $\nabla T_e$ and $\nabla n_e$ +point in roughly the same direction, +in which case the pressure term can be neglected. +Consequently, $p_e$ has no effect on the dynamics of $\vb{B}$, +so we argue that it can be dropped from the original (non-curled) equation too, leaving: + +$$\begin{aligned} + \boxed{ + \vb{E} + \vb{u} \cross \vb{B} + \frac{\vb{J} \cross \vb{B}}{q_e n_e} + = \eta \vb{J} + } +\end{aligned}$$ + +This is known as the **generalized Ohm's law**, +since it contains the relation $\vb{E} = \eta \vb{J}$. + +Next, consider [Ampère's law](/know/concept/maxwells-equations/), +where we would like to neglect the last term: + +$$\begin{aligned} + \nabla \cross \vb{B} + = \mu_0 \vb{J} + \frac{1}{c^2} \pdv{\vb{E}}{t} +\end{aligned}$$ + +From Faraday's law, we can obtain a scale estimate for $\vb{E}$. +Recall that $\tau_\mathrm{char}$ is the characteristic timescale of the plasma, +and let $\lambda_\mathrm{char} \gg \lambda_D$ be its characteristic lengthscale: + +$$\begin{aligned} + \nabla \cross \vb{E} + = - \pdv{\vb{B}}{t} + \quad \implies \quad + |\vb{E}| + \sim \frac{\lambda_\mathrm{char}}{\tau_\mathrm{char}} |\vb{B}| +\end{aligned}$$ + +From this, we find when we can neglect +the last term in Ampère's law: +the characteristic velocity $v_\mathrm{char}$ +must be tiny compared to $c$, +i.e. the plasma must be non-relativistic: + +$$\begin{aligned} + 1 + \gg \frac{\big| (\ipdv{\vb{E}}{t}) / c^2 \big|}{\big| \nabla \cross \vb{B} \big|} + \sim \frac{|\vb{E}| / \tau_\mathrm{char}}{|\vb{B}| c^2 / \lambda_\mathrm{char}} + \sim \frac{|\vb{B}| \lambda_\mathrm{char}^2 / \tau_\mathrm{char}^2}{|\vb{B}| c^2} + = \frac{v_\mathrm{char}^2}{c^2} + \ll 1 +\end{aligned}$$ + +We thus have the following reduced form of Ampère's law, +in addition to Faraday's law: + +$$\begin{aligned} + \boxed{ + \nabla \cross \vb{B} + = \mu_0 \vb{J} + } + \qquad \quad + \boxed{ + \nabla \cross \vb{E} + = - \pdv{\vb{B}}{t} + } +\end{aligned}$$ + +Finally, we revisit the thermodynamic equation of state, +for a single fluid this time. +Using the product rule of differentiation yields: + +$$\begin{aligned} + 0 + &= \frac{\mathrm{D}}{\mathrm{D} t} \Big( \frac{p}{\rho^\gamma} \Big) + = \frac{\mathrm{D} p}{\mathrm{D} t} \rho^{-\gamma} - p \gamma \rho^{-\gamma - 1} \frac{\mathrm{D} \rho}{\mathrm{D} t} +\end{aligned}$$ + +The continuity equation allows us to rewrite +the [material derivative](/know/concept/material-derivative/) +$\mathrm{D} \rho / \mathrm{D} t$ as follows: + +$$\begin{aligned} + \pdv{\rho}{t} + \nabla \cdot (\rho \vb{u}) + = \pdv{\rho}{t} + \rho \nabla \cdot \vb{u} + \vb{u} \cdot \nabla \rho + = \rho \nabla \cdot \vb{u} + \frac{\mathrm{D} \rho}{\mathrm{D} t} + = 0 +\end{aligned}$$ + +Inserting this into the equation of state +leads us to a differential equation for $p$: + +$$\begin{aligned} + 0 + = \frac{\mathrm{D} p}{\mathrm{D} t} + p \gamma \frac{1}{\rho} \rho \nabla \cdot \vb{u} + \quad \implies \quad + \boxed{ + \frac{\mathrm{D} p}{\mathrm{D} t} = - p \gamma \nabla \cdot \vb{u} + } +\end{aligned}$$ + +This closes the set of 14 MHD equations for 14 unknowns. +Originally, the two-fluid model had 16 of each, +but we have merged $n_i$ and $n_e$ into $\rho$, +and $p_i$ and $p_i$ into $p$. + + +## Ohm's law variants + +It is worth discussing the generalized Ohm's law in more detail. +Its full form was: + +$$\begin{aligned} + \vb{E} + \vb{u} \cross \vb{B} + \frac{\vb{J} \cross \vb{B}}{q_e n_e} + = \eta \vb{J} +\end{aligned}$$ + +However, most authors neglect some of its terms: +this form is used for **Hall MHD**, +where $\vb{J} \cross \vb{B}$ is called the *Hall term*. +This term can be dropped in any of the following cases: + +$$\begin{gathered} + 1 + \gg \frac{\big| \vb{J} \cross \vb{B} / q_e n_e \big|}{\big| \vb{u} \cross \vb{B} \big|} + \sim \frac{\rho v_\mathrm{char} / \tau_\mathrm{char}}{v_\mathrm{char} |\vb{B}| q_i n_i} + \approx \frac{m_i n_i}{|\vb{B}| q_i n_i \tau_\mathrm{char}} + = \frac{1}{\omega_{ci} \tau_\mathrm{char}} + \ll 1 + \\ + 1 + \gg \frac{\big| \vb{J} \cross \vb{B} / q_e n_e \big|}{\big| \eta \vb{J} \big|} + \sim \frac{|\vb{J}| |\vb{B}| q_e^2 n_e}{f_{ei} m_e |\vb{J}| q_e n_e} + = \frac{|\vb{B}| q_e}{f_{ei} m_e} + = \frac{\omega_{ce}}{f_{ei}} + \ll 1 +\end{gathered}$$ + +Where we have used the MHD momentum equation with $\nabla p \approx 0$ +to obtain the scale estimate $\vb{J} \cross \vb{B} \sim \rho v_\mathrm{char} / \tau_\mathrm{char}$. +In other words, if the ion gyration period is short $\tau_\mathrm{char} \gg \omega_{ci}$, +and/or if the electron gyration period is long +compared to the electron-ion collision period $\omega_{ce} \ll f_{ei}$, +then we are left with this form of Ohm's law, used in **resistive MHD**: + +$$\begin{aligned} + \vb{E} + \vb{u} \cross \vb{B} + = \eta \vb{J} +\end{aligned}$$ + +Finally, we can neglect the resisitive term $\eta \vb{J}$ +if the Lorentz force is much larger. +We formalize this condition as follows, +where we have used Ampère's law to find $\vb{J} \sim \vb{B} / \mu_0 \lambda_\mathrm{char}$: + +$$\begin{aligned} + 1 + \ll \frac{\big| \vb{u} \cross \vb{B} \big|}{\big| \eta \vb{J} \big|} + \sim \frac{v_\mathrm{char} |\vb{B}|}{\eta \vb{J}} + \sim \frac{v_\mathrm{char} |\vb{B}|}{\eta |\vb{B}| / \mu_0 \lambda_\mathrm{char}} + = \mathrm{R_m} + \gg 1 +\end{aligned}$$ + +Where we have defined the **magnetic Reynolds number** $\mathrm{R_m}$ as follows, +which is analogous to the fluid [Reynolds number](/know/concept/reynolds-number/) $\mathrm{Re}$: + +$$\begin{aligned} + \boxed{ + \mathrm{R_m} + \equiv \frac{v_\mathrm{char} \lambda_\mathrm{char}}{\eta / \mu_0} + } +\end{aligned}$$ + +If $\mathrm{R_m} \ll 1$, the plasma is "electrically viscous", +such that resistivity needs to be accounted for, +whereas if $\mathrm{R_m} \gg 1$, the resistivity is negligible, +in which case we have **ideal MHD**: + +$$\begin{aligned} + \vb{E} + \vb{u} \cross \vb{B} + = 0 +\end{aligned}$$ + + + +## References +1. P.M. Bellan, + *Fundamentals of plasma physics*, + 1st edition, Cambridge. +2. M. Salewski, A.H. Nielsen, + *Plasma physics: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/markov-process/index.md b/source/know/concept/markov-process/index.md new file mode 100644 index 0000000..4a681e3 --- /dev/null +++ b/source/know/concept/markov-process/index.md @@ -0,0 +1,61 @@ +--- +title: "Markov process" +date: 2021-11-14 +categories: +- Mathematics +- Stochastic analysis +layout: "concept" +--- + +Given a [stochastic process](/know/concept/stochastic-process/) +$\{X_t : t \ge 0\}$ on a filtered probability space +$(\Omega, \mathcal{F}, \{\mathcal{F}_t\}, P)$, +it is said to be a **Markov process** +if it satisfies the following requirements: + +1. $X_t$ is $\mathcal{F}_t$-adapted, + meaning that the current and all past values of $X_t$ + can be reconstructed from the filtration $\mathcal{F}_t$. +2. For some function $h(x)$, + the [conditional expectation](/know/concept/conditional-expectation/) + $\mathbf{E}[h(X_t) | \mathcal{F}_s] = \mathbf{E}[h(X_t) | X_s]$, + i.e. at time $s \le t$, the expectation of $h(X_t)$ depends only on the current $X_s$. + Note that $h$ must be bounded and *Borel-measurable*, + meaning $\sigma(h(X_t)) \subseteq \mathcal{F}_t$. + +This last condition is called the **Markov property**, +and demands that the future of $X_t$ does not depend on the past, +but only on the present $X_s$. + +If both $t$ and $X_t$ are taken to be discrete, +then $X_t$ is known as a **Markov chain**. +This brings us to the concept of the **transition probability** +$P(X_t \in A | X_s = x)$, which describes the probability that +$X_t$ will be in a given set $A$, if we know that currently $X_s = x$. + +If $t$ and $X_t$ are continuous, we can often (but not always) express $P$ +using a **transition density** $p(s, x; t, y)$, +which gives the probability density that the initial condition $X_s = x$ +will evolve into the terminal condition $X_t = y$. +Then the transition probability $P$ can be calculated like so, +where $B$ is a given Borel set (see [$\sigma$-algebra](/know/concept/sigma-algebra/)): + +$$\begin{aligned} + P(X_t \in B | X_s = x) + = \int_B p(s, x; t, y) \dd{y} +\end{aligned}$$ + +A prime examples of a continuous Markov process is +the [Wiener process](/know/concept/wiener-process/). +Note that this is also a [martingale](/know/concept/martingale/): +often, a Markov process happens to be a martingale, or vice versa. +However, those concepts are not to be confused: +the Markov property does not specify *what* the expected future must be, +and the martingale property says nothing about the history-dependence. + + + +## References +1. U.H. Thygesen, + *Lecture notes on diffusions and stochastic differential equations*, + 2021, Polyteknisk Kompendie. diff --git a/source/know/concept/martingale/index.md b/source/know/concept/martingale/index.md new file mode 100644 index 0000000..f64c22e --- /dev/null +++ b/source/know/concept/martingale/index.md @@ -0,0 +1,62 @@ +--- +title: "Martingale" +date: 2021-10-31 +categories: +- Mathematics +- Stochastic analysis +layout: "concept" +--- + +A **martingale** is a type of +[stochastic process](/know/concept/stochastic-process/) +with important and useful properties, +especially for stochastic calculus. + +For a stochastic process $\{ M_t : t \ge 0 \}$ +on a probability filtered space $(\Omega, \mathcal{F}, \{ \mathcal{F}_t \}, P)$, +then $M_t$ is a martingale if it satisfies all of the following: + +1. $M_t$ is $\mathcal{F}_t$-adapted, meaning + the filtration $\mathcal{F}_t$ contains enough information + to reconstruct the current and all past values of $M_t$. +2. For all times $t \ge 0$, the expectation value exists $\mathbf{E}(M_t) < \infty$. +3. For all $s, t$ satisfying $0 \le s \le t$, + the [conditional expectation](/know/concept/conditional-expectation/) + $\mathbf{E}(M_t | \mathcal{F}_s) = M_s$, + meaning the increment $M_t \!-\! M_s$ is always expected + to be zero $\mathbf{E}(M_t \!-\! M_s | \mathcal{F}_s) = 0$. + +The last condition is called the **martingale property**, +and basically means that a martingale is an unbiased random walk. +Accordingly, the [Wiener process](/know/concept/wiener-process/) $B_t$ +(Brownian motion) is an example of a martingale, +since each of its increments $B_t \!-\! B_s$ has mean $0$ by definition. + +Martingales are easily confused with +[Markov processes](/know/concept/markov-process/), +because stochastic processes will often be both, +e.g. the Wiener process. +However, these are distinct concepts: +the martingale property says nothing about history-dependence, +and the Markov property does not say *what* the future expectation should be. + +Modifying property (3) leads to two common generalizations. +The stochastic process $M_t$ above is a **submartingale** +if the current value is a lower bound for the expectation: + +3. For $0 \le s \le t$, the conditional expectation $\mathbf{E}(M_t | \mathcal{F}_s) \ge M_s$. + +Analogouly, $M_t$ is a **supermartingale** +if the current value is an upper bound instead: + +3. For $0 \le s \le t$, the conditional expectation $\mathbf{E}(M_t | \mathcal{F}_s) \le M_s$. + +Clearly, submartingales and supermartingales are *biased* random walks, +since they will tend to increase and decrease with time, respectively. + + + +## References +1. U.H. Thygesen, + *Lecture notes on diffusions and stochastic differential equations*, + 2021, Polyteknisk Kompendie. diff --git a/source/know/concept/material-derivative/index.md b/source/know/concept/material-derivative/index.md new file mode 100644 index 0000000..6a02a22 --- /dev/null +++ b/source/know/concept/material-derivative/index.md @@ -0,0 +1,115 @@ +--- +title: "Material derivative" +date: 2021-03-30 +categories: +- Physics +- Fluid mechanics +- Fluid dynamics +- Continuum physics +layout: "concept" +--- + +Inside a fluid (or any other continuum), we might be interested in +the time evolution of a certain intensive quantity $f$, +e.g. the temperature or pressure, +represented by a scalar field $f(\va{r}, t)$. + +If the fluid is static, the evolution of $f$ is simply $\ipdv{f}{t}$, +since each point of the fluid is motionless. +However, if the fluid is moving, we have a problem: +the fluid molecules at position $\va{r} = \va{r}_0$ are not necessarily +the same ones at time $t = t_0$ and $t = t_1$. +Those molecules take $f$ with them as they move, +so we need to account for this transport somehow. + +To do so, we choose an infinitesimal "blob" or **parcel** of the fluid, +which always contains the same specific molecules, +and track its position $\va{r}(t)$ through time as it moves and deforms. +The value of $f$ for this parcel is then given by: + +$$\begin{aligned} + f(\va{r}, t) + = f(\va{r}(t), t) + = f\big(x(t), y(t), z(t), t\big) +\end{aligned}$$ + +In effect, we have simply made the coordinate $\va{r}$ dependent on time, +and have specifically chosen the time-dependence to track the parcel. +The net evolution of $f$ is then its "true" (i.e. non-partial) derivative with respect to $t$, +allowing us to apply the chain rule: + +$$\begin{aligned} + \dv{}{t}f\big(x(t), y(t), z(t), t\big) + &= \pdv{f}{t} + \pdv{f}{x} \dv{x}{t} + \pdv{f}{y} \dv{y}{t} + \pdv{f}{z} \dv{z}{t} + \\ + &= \pdv{f}{t} + v_x \pdv{f}{x} + v_y \pdv{f}{y} + v_z \pdv{f}{z} +\end{aligned}$$ + +Where $v_x$, $v_y$ and $v_z$ are the parcel's velocity components. +Let $\va{v} = (v_x, v_y, v_z)$ be the velocity vector field, +then we can rewrite this expression like so: + +$$\begin{aligned} + \dv{}{t}f\big(x(t), y(t), z(t), t\big) + &= \pdv{f}{t} + (\va{v} \cdot \nabla) f +\end{aligned}$$ + +Note that $\va{v} = \va{v}(\va{r}, t)$, +that is, the velocity can change with time ($t$-dependence), +and depends on which parcel we track ($\va{r}$-dependence). + +Of course, the parcel is in our imagination: +$\va{r}$ does not really depend on $t$; +after all, we are dealing with a continuum. +Nevertheless, the right-hand side of the equation is very useful, +and is known as the **material derivative** or **comoving derivative**: + +$$\begin{aligned} + \boxed{ + \frac{\mathrm{D}f}{\mathrm{D}t} + \equiv \pdv{f}{t} + (\va{v} \cdot \nabla) f + } +\end{aligned}$$ + +The first term is called the **local rate of change**, +and the second is the **advective rate of change**. +In effect, the latter moves the frame of reference along with the material, +so that we can find the evolution of $f$ +without needing to worry about the continuum's motion. + +That was for a scalar field $f(\va{r}, t)$, +but in fact the definition also works for vector fields $\va{U}(\va{r}, t)$: + +$$\begin{aligned} + \boxed{ + \frac{\mathrm{D} \va{U}}{\mathrm{D}t} + \equiv \pdv{\va{U}}{t} + (\va{v} \cdot \nabla) \va{U} + } +\end{aligned}$$ + +Where the advective term is to be evaluated in the following way in Cartesian coordinates: + +$$\begin{aligned} + (\va{v} \cdot \nabla) \va{U} + = + \begin{bmatrix} v_x \\ v_y \\ v_z \end{bmatrix} + \cdot + \begin{bmatrix} + \displaystyle\pdv{U_x}{x} & \displaystyle\pdv{U_x}{y} & \displaystyle\pdv{U_x}{z} \\ + \displaystyle\pdv{U_y}{x} & \displaystyle\pdv{U_y}{y} & \displaystyle\pdv{U_y}{z} \\ + \displaystyle\pdv{U_z}{x} & \displaystyle\pdv{U_z}{y} & \displaystyle\pdv{U_z}{z} + \end{bmatrix} + = + \begin{bmatrix} + v_x \displaystyle\pdv{U_x}{x} & v_y \displaystyle\pdv{U_x}{y} & v_z \displaystyle\pdv{U_x}{z} \\ + v_x \displaystyle\pdv{U_y}{x} & v_y \displaystyle\pdv{U_y}{y} & v_z \displaystyle\pdv{U_y}{z} \\ + v_x \displaystyle\pdv{U_z}{x} & v_y \displaystyle\pdv{U_z}{y} & v_z \displaystyle\pdv{U_z}{z} + \end{bmatrix} +\end{aligned}$$ + + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/matsubara-greens-function/index.md b/source/know/concept/matsubara-greens-function/index.md new file mode 100644 index 0000000..d54bbf2 --- /dev/null +++ b/source/know/concept/matsubara-greens-function/index.md @@ -0,0 +1,390 @@ +--- +title: "Matsubara Green's function" +date: 2021-11-12 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +The **Matsubara Green's function** is an +[imaginary-time](/know/concept/imaginary-time/) version +of the real-time [Green's functions](/know/concept/greens-functions/). +We define as follows in the imaginary-time +[Heisenberg picture](/know/concept/heisenberg-picture/): + +$$\begin{aligned} + \boxed{ + C_{AB}(\tau, \tau') + \equiv -\frac{1}{\hbar} \Expval{\mathcal{T} \big\{ \hat{A}(\tau) \hat{B}(\tau') \big\}} + } +\end{aligned}$$ + +Where the expectation value $\Expval{}$ is with respect to thermodynamic equilibrium, +and $\mathcal{T}$ is the [time-ordered product](/know/concept/time-ordered-product/) pseudo-operator. +Because the Hamiltonian $\hat{H}$ cannot depend on the imaginary time, +$C_{AB}$ is a function of the difference $\tau \!-\! \tau'$ only: + +$$\begin{aligned} + C_{AB}(\tau, \tau') + &= - \frac{1}{\hbar Z} \Tr\!\Big( e^{-\beta \hat{H}} \hat{A}(\tau) \hat{B}(\tau') \Big) + \\ + &= - \frac{1}{\hbar Z} \Tr\!\Big( e^{-\beta \hat{H}} e^{\tau \hat{H} / \hbar} \hat{A} e^{-\tau \hat{H} / \hbar} + e^{\tau' \hat{H} / \hbar} \hat{B} e^{-\tau' \hat{H} / \hbar} \Big) + \\ + &= - \frac{1}{\hbar Z} \Tr\!\Big( e^{-\beta \hat{H}} e^{(\tau - \tau') \hat{H} / \hbar} \hat{A} e^{-(\tau - \tau') \hat{H} / \hbar} \hat{B} \Big) +\end{aligned}$$ + +For $\tau > \tau'$, we see by expanding in the many-particle eigenstates $\Ket{n}$ +that we need to demand $\hbar \beta > \tau \!-\! \tau'$ to prevent +$C_{AB}$ from diverging for increasing temperatures: + +$$\begin{aligned} + C_{AB}(\tau \!-\! \tau') + &= - \frac{1}{\hbar Z} \sum_{n} \Matrixel{n}{e^{-\beta \hat{H}} e^{(\tau - \tau') \hat{H} / \hbar} + \hat{A} e^{-(\tau - \tau') \hat{H} / \hbar} \hat{B}}{n} + \\ + &= - \frac{1}{\hbar Z} \sum_{n} \Matrixel{n}{\hat{A} e^{-(\tau - \tau') \hat{H} / \hbar} \hat{B}}{n} e^{-\beta E_n} e^{(\tau - \tau') E_n / \hbar} +\end{aligned}$$ + +And likewise, for $\tau < \tau'$, +we must demand that $\tau \!-\! \tau' > -\hbar \beta$ +for the same reason: + +$$\begin{aligned} + C_{AB}(\tau \!-\! \tau') + &= \mp \frac{1}{\hbar Z} \Tr\!\Big( e^{-\beta \hat{H}} \hat{B}(\tau') \hat{A}(\tau) \Big) + \\ + &= \mp \frac{1}{\hbar Z} \Tr\!\Big( e^{-\beta \hat{H}} e^{-(\tau - \tau') \hat{H} / \hbar} \hat{B} e^{(\tau - \tau') \hat{H} / \hbar} \hat{A} \Big) + \\ + &= \mp \frac{1}{\hbar Z} \sum_{n} \Matrixel{n}{\hat{B} e^{(\tau - \tau') \hat{H} / \hbar} \hat{A}}{n} e^{-\beta E_n} e^{- (\tau - \tau') E_n / \hbar} +\end{aligned}$$ + +With $-$ for bosons, and $+$ for fermions, +due to the time-ordered product for $\tau > \tau'$. + +On this domain $[-\hbar \beta, \hbar \beta]$, +the Matsubara Green's function $C_{AB}$ +obeys a useful shift relation: +it is $\hbar \beta$-periodic for bosons, +and $\hbar \beta$-antiperiodic for fermions: + +$$\begin{aligned} + \boxed{ + C_{AB}(\tau \!-\! \tau') = + \begin{cases} + \pm C_{AB}(\tau \!-\! \tau' \!+\! \hbar \beta) + & \mathrm{if\;} \tau \!-\! \tau' < 0 + \\ + \pm C_{AB}(\tau \!-\! \tau' \!-\! \hbar \beta) + & \mathrm{if\;} \tau \!-\! \tau' > 0 + \end{cases} + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-period"/> +<label for="proof-period">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-period">Proof.</label> +First $\tau \!-\! \tau' < 0$. +We insert the argument $\tau \!-\! \tau' \!+\! \hbar \beta$, +and use the cyclic property: + +$$\begin{aligned} + C_{AB}(\tau \!-\! \tau' \!+\! \hbar \beta) + &= - \frac{1}{\hbar Z} \Tr\!\Big( e^{-\beta \hat{H}} e^{(\tau - \tau' + \hbar \beta) \hat{H} / \hbar} + \hat{A} e^{-(\tau - \tau' + \hbar \beta) \hat{H} / \hbar} \hat{B} \Big) + \\ + &= - \frac{1}{\hbar Z} \Tr\!\Big( e^{(\tau - \tau') \hat{H} / \hbar} \hat{A} e^{-(\tau - \tau') \hat{H} / \hbar} e^{-\beta \hat{H}} \hat{B} \Big) + \\ + &= - \frac{1}{\hbar Z} \Tr\!\Big( e^{-\beta \hat{H}} e^{\tau' \hat{H} / \hbar} \hat{B} e^{-\tau' \hat{H} / \hbar} + e^{\tau \hat{H} / \hbar} \hat{A} e^{-\tau \hat{H} / \hbar} \Big) + \\ + &= - \frac{1}{\hbar Z} \Tr\!\Big( e^{-\beta \hat{H}} \hat{B}(\tau') \hat{A}(\tau) \Big) +\end{aligned}$$ + +Since $\tau < \tau'$ by assumption, +we can bring back the time-ordered product $\mathcal{T}$: + +$$\begin{aligned} + C_{AB}(\tau \!-\! \tau' \!+\! \hbar \beta) + &= \mp \frac{1}{\hbar Z} \Tr\!\Big( e^{-\beta \hat{H}} \mathcal{T}\big\{ \hat{A}(\tau) \hat{B}(\tau') \big\} \Big) + \\ + &= \pm C_{AB}(\tau \!-\! \tau') +\end{aligned}$$ + +Moving on to $\tau \!-\! \tau' > 0$, the proof is perfectly analogous: + +$$\begin{aligned} + C_{AB}(\tau \!-\! \tau' \!-\! \hbar \beta) + &= \mp \frac{1}{\hbar Z} \Tr\!\Big( e^{-\beta \hat{H}} e^{-(\tau - \tau' - \hbar \beta) \hat{H} / \hbar} + \hat{B} e^{(\tau - \tau' - \hbar \beta) \hat{H} / \hbar} \hat{A} \Big) + \\ + &= \mp \frac{1}{\hbar Z} \Tr\!\Big( e^{-(\tau - \tau') \hat{H} / \hbar} \hat{B} e^{(\tau - \tau') \hat{H} / \hbar} e^{-\beta \hat{H}} \hat{A} \Big) + \\ + &= \mp \frac{1}{\hbar Z} \Tr\!\Big( e^{-\beta \hat{H}} e^{\tau \hat{H} / \hbar} \hat{A} e^{-\tau \hat{H} / \hbar} + e^{\tau' \hat{H} / \hbar} \hat{B} e^{-\tau' \hat{H} / \hbar} \Big) + \\ + &= \mp \frac{1}{\hbar Z} \Tr\!\Big( e^{-\beta \hat{H}} \hat{A}(\tau) \hat{B}(\tau') \Big) + \\ + &= \mp \frac{1}{\hbar Z} \Tr\!\Big( e^{-\beta \hat{H}} \mathcal{T}\big\{ \hat{A}(\tau) \hat{B}(\tau') \big\} \Big) + \\ + &= \pm C_{AB}(\tau \!-\! \tau') +\end{aligned}$$ +</div> +</div> + +Due to this limited domain $\tau \in [-\hbar \beta, \hbar \beta]$, +the [Fourier transform](/know/concept/fourier-transform/) +of $C_{AB}(\tau)$ consists of discrete frequencies +$k_n \equiv n \pi / (\hbar \beta)$. +The forward and inverse Fourier transforms +are therefore defined as given below (with $\tau' = 0$). +It is convention to write $C_{AB}(i k_n)$ instead of $C_{AB}(k_n)$: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + C_{AB}(i k_n) + &\equiv \frac{1}{2} \int_{-\hbar \beta}^{\hbar \beta} C_{AB}(\tau) \: e^{i k_n \tau} \dd{\tau} + \\ + C_{AB}(\tau) + &= \frac{1}{\hbar \beta} \sum_{n = -\infty}^\infty C_{AB}(i k_n) e^{-i k_n \tau} + \end{aligned} + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-FT-def"/> +<label for="proof-FT-def">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-FT-def">Proof.</label> +We will prove that one is indeed the inverse of the other. +We demand that the inverse FT of the forward FT of $C_{AB}(\tau)$ +is simply $C_{AB}(\tau)$ again: + +$$\begin{aligned} + C_{AB}(\tau) + &= \frac{1}{\hbar \beta} \sum_{n = -\infty}^\infty + \bigg( \frac{1}{2} \int_{-\hbar \beta}^{\hbar \beta} C_{AB}(\tau') \: e^{i k_n \tau'} \dd{\tau'} \bigg) e^{-i k_n \tau} + \\ + &= \frac{1}{\hbar \beta} \int_{-\hbar \beta}^{\hbar \beta} C_{AB}(\tau') + \bigg( \frac{1}{2} \sum_{n = -\infty}^\infty e^{i k_n (\tau' - \tau)} \bigg) \dd{\tau'} + \\ + &= \frac{\pi}{\hbar \beta} \int_{-\hbar \beta}^{\hbar \beta} C_{AB}(\tau') + \bigg( \frac{1}{2 \pi} \sum_{n = -\infty}^\infty e^{i \pi n (\tau' - \tau) / \hbar \beta} \bigg) \dd{\tau'} +\end{aligned}$$ + +Here, the inner expression turns out to be +a [Dirac delta function](/know/concept/dirac-delta-function/): + +$$\begin{aligned} + \frac{1}{2 \pi} \sum_{n = -\infty}^\infty e^{i n x} + = \delta(x) +\end{aligned}$$ + +From which the rest of the proof follows straightforwardly: + +$$\begin{aligned} + C_{AB}(\tau) + &= \frac{\pi}{\hbar \beta} \int_{-\hbar \beta}^{\hbar \beta} C_{AB}(\tau') \: \delta\big( (\tau' \!-\! \tau) \pi / \hbar \beta \big) \dd{\tau'} + \\ + &= \frac{\pi \hbar \beta}{\pi \hbar \beta} \int_{-\hbar \beta}^{\hbar \beta} C_{AB}(\tau') \: \delta(\tau' \!-\! \tau) \dd{\tau'} + \\ + &= \int_{-\hbar \beta}^{\hbar \beta} C_{AB}(\tau') \: \delta(\tau' \!-\! \tau) \dd{\tau'} + \\ + &= C_{AB}(\tau) +\end{aligned}$$ +</div> +</div> + +Let us now define the **Matsubara frequencies** $\omega_n$ +as a species-dependent subset of $k_n$: + +$$\begin{aligned} + \boxed{ + \omega_n \equiv + \begin{cases} + \displaystyle\frac{2 n \pi}{\hbar \beta} + & \mathrm{bosons} + \\ + \displaystyle\frac{(2 n + 1) \pi}{\hbar \beta} + & \mathrm{fermions} + \end{cases} + } +\end{aligned}$$ + +With this, we can rewrite the definition of the forward Fourier transform as follows: + +$$\begin{aligned} + \boxed{ + C_{AB}(i \omega_n) + = \int_0^{\hbar \beta} C_{AB}(\tau) \: e^{i \omega_n \tau} \dd{\tau} + = \int_{-\hbar \beta}^0 C_{AB}(\tau) \: e^{i \omega_n \tau} \dd{\tau} + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-FT-alt"/> +<label for="proof-FT-alt">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-FT-alt">Proof.</label> +We split the integral, shift its limits, +and use the (anti)periodicity of $C_{AB}$: + +$$\begin{aligned} + C_{AB}(i k_n) + &= \frac{1}{2} \int_0^{\hbar \beta} C_{AB}(\tau) \: e^{i k_n \tau} \dd{\tau} + + \frac{1}{2} \int_{-\hbar \beta}^0 C_{AB}(\tau) \: e^{i k_n \tau} \dd{\tau} + \\ + &= \frac{1}{2} \int_0^{\hbar \beta} C_{AB}(\tau) \: e^{i k_n \tau} \dd{\tau} + + \frac{1}{2} \int_0^{\hbar \beta} C_{AB}(\tau \!-\! \hbar \beta) \: e^{i k_n (\tau - \hbar \beta)} \dd{\tau} + \\ + &= \frac{1}{2} \int_0^{\hbar \beta} \Big( C_{AB}(\tau) \pm C_{AB}(\tau) \: e^{-i k_n \hbar \beta} \Big) \: e^{i k_n \tau} \dd{\tau} + \\ + &= \frac{1}{2} \big( 1 \pm e^{-i k_n \hbar \beta} \big) \int_0^{\hbar \beta} C_{AB}(\tau) \: e^{i k_n \tau} \dd{\tau} +\end{aligned}$$ + +With $+$ for bosons, and $-$ for fermions. Since $k_n \equiv n \pi / (\hbar \beta)$, +we know $e^{-i k_n \hbar \beta} \in \{-1, 1\}$, +so for bosons all odd $n$ vanish, and for fermions all even $n$, +yielding the desired result. + +For the other case, we simply shift the first integral's limits instead of the seconds': + +$$\begin{aligned} + C_{AB}(i k_n) + &= \frac{1}{2} \int_{-\hbar \beta}^0 C_{AB}(\tau \!+\! \hbar \beta) \: e^{i k_n (\tau + \hbar \beta)} \dd{\tau} + + \frac{1}{2} \int_0^{\hbar \beta} C_{AB}(\tau) \: e^{i k_n \tau} \dd{\tau} + \\ + &= \frac{1}{2} \int_{-\hbar \beta}^0 \Big( C_{AB}(\tau) \pm C_{AB}(\tau) \: e^{i k_n \hbar \beta} \Big) \: e^{i k_n \tau} \dd{\tau} + \\ + &= \frac{1}{2} \big( 1 \pm e^{-i k_n \hbar \beta} \big) \int_{-\hbar \beta}^0 C_{AB}(\tau) \: e^{i k_n \tau} \dd{\tau} +\end{aligned}$$ +</div> +</div> + +If we actually evaluate this, +we obtain the following form of $C_{AB}$, +which is almost identical to the +[Lehmann representation](/know/concept/lehmann-representation/) +of the "ordinary" retarded and advanced Green's functions: + +$$\begin{aligned} + \boxed{ + C_{AB}(i \omega_m) + = \frac{1}{Z} \sum_{n n'} \frac{\matrixel{n}{\hat{A}}{n'} \matrixel{n'}{\hat{B}}{n}}{i \hbar \omega_m + E_n - E_{n'}} + \Big( e^{-\beta E_n} \mp e^{- \beta E_{n'}} \Big) + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-Lehmann"/> +<label for="proof-Lehmann">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-Lehmann">Proof.</label> +For $\tau \!-\! \tau' > 0$, we start by expanding +in the many-particle eigenstates $\Ket{n}$: + +$$\begin{aligned} + C_{AB}(\tau \!-\! \tau') + &= - \frac{1}{\hbar Z} \sum_{n} + \Matrixel{n}{e^{-\beta \hat{H}} e^{(\tau - \tau') \hat{H} / \hbar} \hat{A} e^{-(\tau - \tau') \hat{H} / \hbar} \hat{B}}{n} + \\ + &= - \frac{1}{\hbar Z} \sum_{n n'} \Matrixel{n}{e^{-\beta \hat{H}} e^{(\tau - \tau') \hat{H} / \hbar} \hat{A}}{n'} + \Matrixel{n'}{e^{-(\tau - \tau') \hat{H} / \hbar} \hat{B}}{n} + \\ + &= - \frac{1}{\hbar Z} \sum_{n n'} e^{-\beta E_n} \matrixel{n}{\hat{A}}{n'} + \matrixel{n'}{\hat{B}}{n} e^{(E_n - E_{n'})(\tau - \tau') / \hbar} +\end{aligned}$$ + +We take the Fourier transform by integrating over $[0, \hbar \beta]$: + +$$\begin{aligned} + C_{AB}(i \omega_m) + &= - \frac{1}{\hbar Z} \sum_{n n'} e^{-\beta E_n} \matrixel{n}{\hat{A}}{n'} + \matrixel{n'}{\hat{B}}{n} \int_0^{\hbar \beta} e^{(E_n - E_{n'}) \tau / \hbar} e^{i \omega_m \tau} \dd{\tau} + \\ + &= - \frac{1}{\hbar Z} \sum_{n n'} e^{-\beta E_n} \matrixel{n}{\hat{A}}{n'} \matrixel{n'}{\hat{B}}{n} + \bigg[ \frac{\hbar e^{(i \hbar \omega_m + E_n - E_{n'}) \tau / \hbar}}{i \hbar \omega_m + E_n - E_{n'}} \bigg]_0^{\hbar \beta} + \\ + &= - \frac{1}{Z} \sum_{n n'} e^{-\beta E_n} \frac{\matrixel{n}{\hat{A}}{n'} \matrixel{n'}{\hat{B}}{n}}{i \hbar \omega_m + E_n - E_{n'}} + \Big( e^{(i \hbar \omega_m + E_n - E_{n'}) \beta} - 1 \Big) + \\ + &= - \frac{1}{Z} \sum_{n n'} \frac{\matrixel{n}{\hat{A}}{n'} \matrixel{n'}{\hat{B}}{n}}{i \hbar \omega_m + E_n - E_{n'}} + \Big( e^{i \hbar \omega_m \beta} e^{-\beta E_{n'}} - e^{-\beta E_n} \Big) + \\ + &= \frac{1}{Z} \sum_{n n'} \frac{\matrixel{n}{\hat{A}}{n'} \matrixel{n'}{\hat{B}}{n}}{i \hbar \omega_m + E_n - E_{n'}} + \Big( e^{-\beta E_n} \mp e^{- \beta E_{n'}} \Big) +\end{aligned}$$ + +Moving on to $\tau \!-\! \tau' < 0$, +we again expand in the many-particle eigenstates $\Ket{n}$: + +$$\begin{aligned} + C_{AB}(\tau \!-\! \tau') + &= \mp \frac{1}{\hbar Z} \sum_{n} + \Matrixel{n}{e^{-\beta \hat{H}} e^{- (\tau - \tau') \hat{H} / \hbar} \hat{B} e^{(\tau - \tau') \hat{H} / \hbar} \hat{A}}{n} + \\ + &= \mp \frac{1}{\hbar Z} \sum_{n n'} \Matrixel{n}{e^{-\beta \hat{H}} e^{-(\tau - \tau') \hat{H} / \hbar} \hat{B}}{n'} + \Matrixel{n'}{e^{(\tau - \tau') \hat{H} / \hbar} \hat{A}}{n} + \\ + &= \mp \frac{1}{\hbar Z} \sum_{n n'} e^{-\beta E_n} \matrixel{n}{\hat{B}}{n'} + \matrixel{n'}{\hat{A}}{n} e^{-(E_n - E_{n'})(\tau - \tau') / \hbar} +\end{aligned}$$ + +Since $\tau \!-\! \tau' < 0$ this time, +we take the Fourier transform over $[-\hbar \beta, 0]$: + +$$\begin{aligned} + C_{AB}(i \omega_m) + &= \mp \frac{1}{\hbar Z} \sum_{n n'} e^{-\beta E_n} \matrixel{n}{\hat{B}}{n'} + \matrixel{n'}{\hat{A}}{n} \int_{-\hbar \beta}^0 e^{-(E_n - E_{n'}) \tau / \hbar} e^{i \omega_m \tau} \dd{\tau} + \\ + &= \mp \frac{1}{\hbar Z} \sum_{n n'} e^{-\beta E_n} \matrixel{n}{\hat{B}}{n'} \matrixel{n'}{\hat{A}}{n} + \bigg[ \frac{\hbar e^{(i \hbar \omega_m - E_n + E_{n'}) \tau / \hbar}}{i \hbar \omega_m - E_n + E_{n'}} \bigg]_{-\hbar \beta}^0 + \\ + &= \mp \frac{1}{Z} \sum_{n n'} e^{-\beta E_n} \frac{\matrixel{n}{\hat{B}}{n'} \matrixel{n'}{\hat{A}}{n}}{i \hbar \omega_m - E_n + E_{n'}} + \Big( 1 - e^{(-i \hbar \omega_m + E_n - E_{n'}) \beta} \Big) + \\ + &= \mp \frac{1}{Z} \sum_{n n'} \frac{\matrixel{n}{\hat{B}}{n'} \matrixel{n'}{\hat{A}}{n}}{i \hbar \omega_m - E_n + E_{n'}} + \Big( e^{-\beta E_n} - e^{-i \hbar \omega_m \beta} e^{-\beta E_{n'}} \Big) + \\ + &= \mp \frac{1}{Z} \sum_{n n'} \frac{\matrixel{n}{\hat{B}}{n'} \matrixel{n'}{\hat{A}}{n}}{i \hbar \omega_m - E_n + E_{n'}} + \Big( e^{- \beta E_n} \pm e^{-\beta E_{n'}} \Big) + \\ + &= \frac{1}{Z} \sum_{n n'} \frac{\matrixel{n}{\hat{B}}{n'} \matrixel{n'}{\hat{A}}{n}}{i \hbar \omega_m - E_n + E_{n'}} + \Big( e^{- \beta E_{n'}} \mp e^{-\beta E_n} \Big) +\end{aligned}$$ + +Where swapping $n$ and $n'$ gives the desired result. +</div> +</div> + +This gives us the primary use of the Matsubara Green's function $C_{AB}$: +calculating the retarded $C_{AB}^R$ and advanced $C_{AB}^A$. +Once we have an expression for Matsubara's $C_{AB}$, +we can recover $C_{AB}^R$ and $C_{AB}^A$ by substituting +$i \omega_m \to \omega \!+\! i \eta$ and $i \omega_m \to \omega \!-\! i \eta$ respectively. + +In general, we can define the **canonical Green's function** $C_{AB}(z)$ +on the complex plane: + +$$\begin{aligned} + C_{AB}(z) + = \frac{1}{Z} \sum_{n n'} \frac{\matrixel{n}{\hat{A}}{n'} \matrixel{n'}{\hat{B}}{n}}{z + E_n - E_{n'}} + \Big( e^{-\beta E_n} \mp e^{- \beta E_{n'}} \Big) +\end{aligned}$$ + +This is a [holomorphic function](/know/concept/holomorphic-function/), +except for poles on the real axis. +It turns out that $C_{AB}(z)$ must have these properties +for the substitution $i \omega_n \to \omega \!\pm\! i \eta$ to be valid. + + + +## References +1. H. Bruus, K. Flensberg, + *Many-body quantum theory in condensed matter physics*, + 2016, Oxford. diff --git a/source/know/concept/matsubara-sum/index.md b/source/know/concept/matsubara-sum/index.md new file mode 100644 index 0000000..b61bc9a --- /dev/null +++ b/source/know/concept/matsubara-sum/index.md @@ -0,0 +1,142 @@ +--- +title: "Matsubara sum" +date: 2021-11-13 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +A **Matsubara sum** is a summation of the following form, +which notably appears as the inverse +[Fourier transform](/know/concept/fourier-transform/) of the +[Matsubara Green's function](/know/concept/matsubara-greens-function/): + +$$\begin{aligned} + S_{B,F} + = \frac{1}{\hbar \beta} \sum_{i \omega_n} g(i \omega_n) \: e^{i \omega_n \tau} +\end{aligned}$$ + +Where $i \omega_n$ are the Matsubara frequencies +for bosons ($B$) or fermions ($F$), +and $g(z)$ is a function on the complex plane +that is [holomorphic](/know/concept/holomorphic-function/) +except for a known set of simple poles, +and $\tau$ is a real parameter +(e.g. the [imaginary time](/know/concept/imaginary-time/)) +satisfying $-\hbar \beta < \tau < \hbar \beta$. + +Now, consider the following integral +over a (for now) unspecified counter-clockwise contour $C$, +with a (for now) unspecified weighting function $h(z)$: + +$$\begin{aligned} + \oint_C \frac{g(z) h(z)}{2 \pi i} e^{z \tau} \dd{z} + = \sum_{z_p} e^{z_p \tau} \: \underset{z \to z_p}{\mathrm{Res}}\big( g(z) h(z) \big) +\end{aligned}$$ + +Where we have applied the residue theorem +to get a sum over all simple poles $z_p$ +of either $g$ or $h$ (but not both) enclosed by $C$. +Clearly, we could make this look like a Matsubara sum, +if we choose $h$ such that it has poles at $i \omega_n$. + +Therefore, we choose the weighting function $h(z)$ as follows, +where $n_B(z)$ is the [Bose-Einstein distribution](/know/concept/bose-einstein-distribution/), +and $n_F(z)$ is the [Fermi-Dirac distribution](/know/concept/fermi-dirac-distribution/): + +$$\begin{aligned} + h(z) + = + \begin{cases} + n_{B,F}(z) & \mathrm{if}\; \tau \ge 0 + \\ + -n_{B,F}(-z) & \mathrm{if}\; \tau \le 0 + \end{cases} + \qquad \qquad + n_{B,F}(z) + = \frac{1}{e^{\hbar \beta z} \mp 1} +\end{aligned}$$ + +The distinction between the signs of $\tau$ is needed +to ensure that the integrand $h(z) e^{z \tau}$ decays for $|z| \to \infty$, +both for $\Real(z) > 0$ and $\Real(z) < 0$. +This choice of $h$ indeed has poles at the respective +Matsubara frequencies $i \omega_n$ of bosons and fermions, +and the residues are: + +$$\begin{aligned} + \underset{z \to i \omega_n}{\mathrm{Res}}\!\big( n_B(z) \big) + &= \lim_{z \to i \omega_n}\!\bigg( \frac{z - i \omega_n}{e^{\hbar \beta z} - 1} \bigg) + = \lim_{\eta \to 0}\!\bigg( \frac{i \omega_n + \eta - i \omega_n}{e^{i \hbar \beta \omega_n} e^{\hbar \beta \eta} - 1} \bigg) + \\ + &= \lim_{\eta \to 0}\!\bigg( \frac{\eta}{e^{\hbar \beta \eta} - 1} \bigg) + = \lim_{\eta \to 0}\!\bigg( \frac{\eta}{1 + \hbar \beta \eta - 1} \bigg) + = \frac{1}{\hbar \beta} + \\ + \underset{z \to i \omega_n}{\mathrm{Res}}\!\big( n_F(z) \big) + &= \lim_{z \to i \omega_n}\!\bigg( \frac{z - i \omega_n}{e^{\hbar \beta z} + 1} \bigg) + = \lim_{\eta \to 0}\!\bigg( \frac{i \omega_n + \eta - i \omega_n}{e^{i \hbar \beta \omega_n} e^{\hbar \beta \eta} + 1} \bigg) + \\ + &= \lim_{\eta \to 0}\!\bigg( \frac{\eta}{e^{\hbar \beta \eta} + 1} \bigg) + = \lim_{\eta \to 0}\!\bigg( \frac{\eta}{- 1 - \hbar \beta \eta + 1} \bigg) + = - \frac{1}{\hbar \beta} +\end{aligned}$$ + +In the definition of $h$, the sign flip for $\tau \le 0$ +is introduced because negating the argument also negates the residues, +i.e. $\mathrm{Res}\big( n_F(-z) \big) = -\mathrm{Res}\big( n_F(z) \big)$. +With this $h$, our contour integral can be rewritten as follows: + +$$\begin{aligned} + \oint_C \frac{g(z) h(z)}{2 \pi i} e^{z \tau} \dd{z} + &= \sum_{z_p} e^{z_p \tau} n_{B,F}(z_p) \: \underset{z \to z_p}{\mathrm{Res}}\big( g(z) \big) + + \sum_{i \omega_n} e^{i \omega_n \tau} g(i \omega_n) \: \underset{z \to i \omega_n}{\mathrm{Res}}\!\big( n_{B,F}(z) \big) + \\ + &= \sum_{z_p} e^{z_p \tau} n_{B,F}(z_p) \: \underset{z \to z_p}{\mathrm{Res}}\big( g(z) \big) + \pm \frac{1}{\hbar \beta} \sum_{i \omega_n} g(i \omega_n) \: e^{i \omega_n \tau} +\end{aligned}$$ + +Where $+$ is for bosons, and $-$ for fermions. +Here, we recognize the last term as the Matsubara sum $S_{F,B}$, +for which we isolate, yielding: + +$$\begin{aligned} + S_{B,F} + = \mp \sum_{z_p} e^{z_p \tau} n_{B,F}(z_p) \: \underset{z \to z_p}{\mathrm{Res}}\big( g(z) \big) + \pm \oint_C \frac{g(z) h(z)}{2 \pi i} e^{z \tau} \dd{z} +\end{aligned}$$ + +Now we must choose $C$. Assuming $g(z)$ does not interfere, +we know that $h(z) e^{z \tau}$ decays to zero +for $|z| \to \infty$, so a useful choice would be a circle of radius $R$. +If we then let $R \to \infty$, the contour encloses +the whole complex plane, including all of the integrand's poles. +However, thanks to the integrand's decay, +the resulting contour integral must vanish: + +$$\begin{aligned} + C + = R e^{i \theta} + \quad \implies \quad + \lim_{R \to \infty} + \oint_C g(z) \: h(z) \: e^{z \tau} \dd{z} + = 0 +\end{aligned}$$ + +We thus arrive at the following results +for bosonic and fermionic Matsubara sums $S_{B,F}$: + +$$\begin{aligned} + \boxed{ + S_{B,F} + = \mp \sum_{z_p} e^{z_p \tau} n_{B,F}(z_p) \: \underset{ {z \to z_p}}{\mathrm{Res}}\big(g(z)\big) + } +\end{aligned}$$ + + + +## References +1. H. Bruus, K. Flensberg, + *Many-body quantum theory in condensed matter physics*, + 2016, Oxford. diff --git a/source/know/concept/maxwell-bloch-equations/index.md b/source/know/concept/maxwell-bloch-equations/index.md new file mode 100644 index 0000000..86d7063 --- /dev/null +++ b/source/know/concept/maxwell-bloch-equations/index.md @@ -0,0 +1,447 @@ +--- +title: "Maxwell-Bloch equations" +date: 2021-10-02 +categories: +- Physics +- Quantum mechanics +- Two-level system +- Electromagnetism +- Laser theory +layout: "concept" +--- + +For an electron in a two-level system with time-independent states +$\Ket{g}$ (ground) and $\Ket{e}$ (excited), +consider the following general solution +to the full Schrödinger equation: + +$$\begin{aligned} + \Ket{\Psi} + &= c_g \: \Ket{g} \exp(-i E_g t / \hbar) + c_e \: \Ket{e} \exp(-i E_e t / \hbar) +\end{aligned}$$ + +Perturbing this system with +an [electromagnetic wave](/know/concept/electromagnetic-wave-equation/) +introduces a time-dependent sinusoidal term $\hat{H}_1$ to the Hamiltonian. +In the [electric dipole approximation](/know/concept/electric-dipole-approximation/), +$\hat{H}_1$ is given by: + +$$\begin{aligned} + \hat{H}_1(t) + = - \hat{\vb{p}} \cdot \vb{E}(t) + \qquad \qquad + \vu{p} + \equiv q \vu{x} + \qquad \qquad + \vb{E}(t) + = \vb{E}_0 \cos(\omega t) +\end{aligned}$$ + +Where $\vb{E}$ is an [electric field](/know/concept/electric-field/), +and $\hat{\vb{p}}$ is the dipole moment operator. +From [Rabi oscillation](/know/concept/rabi-oscillation/), +we know that the time-varying coefficients $c_g$ and $c_e$ +can then be described by: + +$$\begin{aligned} + \dv{c_g}{t} + &= i \frac{q \matrixel{g}{\vu{x}}{e} \cdot \vb{E}_0}{2 \hbar} \exp\!\big( i \omega t \!-\! i \omega_0 t \big) \: c_e + \\ + \dv{c_e}{t} + &= i \frac{q \matrixel{e}{\vu{x}}{g} \cdot \vb{E}_0}{2 \hbar} \exp\!\big(\!-\! i \omega t \!+\! i \omega_0 t \big) \: c_g +\end{aligned}$$ + +We want to rearrange these equations a bit. +Therefore, we split the electric field $\vb{E}$ like so, +where the amplitudes $\vb{E}_0^{-}$ and $\vb{E}_0^{+}$ may be slowly varying: + +$$\begin{aligned} + \vb{E}(t) + = \vb{E}^{-}(t) + \vb{E}^{+}(t) + = \vb{E}_0^{-} \exp(i \omega t) + \vb{E}_0^{+} \exp(-i \omega t) +\end{aligned}$$ + +Since $\vb{E}$ is real, $\vb{E}_0^{+} = (\vb{E}_0^{-})^*$. +Similarly, we define the transition dipole moment $\vb{p}_0^{-}$: + +$$\begin{aligned} + \vb{p}_0^{-} + \equiv q \matrixel{e}{\vu{x}}{g} + \qquad \qquad + \vb{p}_0^{+} + \equiv (\vb{p}_0^{-})^* + = q \matrixel{g}{\vu{x}}{e} +\end{aligned}$$ + +With these, the equations for $c_g$ and $c_e$ can be rewritten as shown below. +Note that $\vb{E}^{-}$ and $\vb{E}^{+}$ include the driving plane wave, and the +[rotating wave approximation](/know/concept/rotating-wave-approximation/) is still made: + +$$\begin{aligned} + \dv{c_g}{t} + &= \frac{i}{\hbar} \vb{p}_0^{+} \cdot \vb{E}^{-} \exp(- i \omega_0 t) \: c_e + \\ + \dv{c_e}{t} + &= \frac{i}{\hbar} \vb{p}_0^{-} \cdot \vb{E}^{+} \exp(i \omega_0 t) \: c_g +\end{aligned}$$ + + +## Optical Bloch equations + +For $\Ket{\Psi}$ as defined above, +the corresponding pure [density operator](/know/concept/density-operator/) +$\hat{\rho}$ is as follows: + +$$\begin{aligned} + \hat{\rho} + = \Ket{\Psi} \Bra{\Psi} + = + \begin{bmatrix} + c_e c_e^* & c_e c_g^* \exp(-i \omega_0 t) \\ + c_g c_e^* \exp(i \omega_0 t) & c_g c_g^* + \end{bmatrix} + \equiv + \begin{bmatrix} + \rho_{ee} & \rho_{eg} \\ + \rho_{ge} & \rho_{gg} + \end{bmatrix} +\end{aligned}$$ + +Where $\omega_0 \equiv (E_e \!-\! E_g) / \hbar$ is the resonance frequency. +We take the $t$-derivative of the matrix elements, +and insert the equations for $c_g$ and $c_e$: + +$$\begin{aligned} + \dv{\rho_{gg}}{t} + &= \dv{c_g}{t} c_g^* + c_g \dv{c_g^*}{t} + \\ + &= \frac{i}{\hbar} \vb{p}_0^{+} \cdot \vb{E}^{-} \exp(- i \omega_0 t) \: c_e c_g^* + - \frac{i}{\hbar} \vb{p}_0^{-} \cdot \vb{E}^{+} \exp(i \omega_0 t) \: c_g c_e^* + \\ + \dv{\rho_{ee}}{t} + &= \dv{c_e}{t} c_e^* + c_e \dv{c_e^*}{t} + \\ + &= \frac{i}{\hbar} \vb{p}_0^{-} \cdot \vb{E}^{+} \exp(i \omega_0 t) \: c_g c_e^* + - \frac{i}{\hbar} \vb{p}_0^{+} \cdot \vb{E}^{-} \exp(- i \omega_0 t) \: c_e c_g^* + \\ + \dv{\rho_{ge}}{t} + &= \dv{c_g}{t} c_e^* \exp(i \omega_0 t) + c_g \dv{c_e^*}{t} \exp(i \omega_0 t) + i \omega_0 c_g c_e^* \exp(i \omega_0 t) + \\ + &= \frac{i}{\hbar} \vb{p}_0^{+} \cdot \vb{E}^{-} \: c_e c_e^* + - \frac{i}{\hbar} \vb{p}_0^{+} \cdot \vb{E}^{-} \: c_g c_g^* + + i \omega_0 c_g c_e^* \exp(i \omega_0 t) + \\ + \dv{\rho_{eg}}{t} + &= \dv{c_e}{t} c_g^* \exp(-i \omega_0 t) + c_e \dv{c_g^*}{t} \exp(-i \omega_0 t) - i \omega_0 c_e c_g^* \exp(- i \omega_0 t) + \\ + &= \frac{i}{\hbar} \vb{p}_0^{-} \cdot \vb{E}^{+} \: c_g c_g^* + - \frac{i}{\hbar} \vb{p}_0^{-} \cdot \vb{E}^{+} \: c_e c_e^* + - i \omega_0 c_e c_g^* \: \exp(- i \omega_0 t) +\end{aligned}$$ + +Recognizing the density matrix elements allows us +to reduce these equations to: + +$$\begin{aligned} + \dv{\rho_{gg}}{t} + &= \frac{i}{\hbar} \Big( \vb{p}_0^{+} \cdot \vb{E}^{-} \rho_{eg} - \vb{p}_0^{-} \cdot \vb{E}^{+} \rho_{ge} \Big) + \\ + \dv{\rho_{ee}}{t} + &= \frac{i}{\hbar} \Big( \vb{p}_0^{-} \cdot \vb{E}^{+} \rho_{ge} - \vb{p}_0^{+} \cdot \vb{E}^{-} \rho_{eg} \Big) + \\ + \dv{\rho_{ge}}{t} + &= i \omega_0 \rho_{ge} + \frac{i}{\hbar} \vb{p}_0^{+} \cdot \vb{E}^{-} \big( \rho_{ee} - \rho_{gg} \big) + \\ + \dv{\rho_{eg}}{t} + &= - i \omega_0 \rho_{eg} + \frac{i}{\hbar} \vb{p}_0^{-} \cdot \vb{E}^{+} \big( \rho_{gg} - \rho_{ee} \big) +\end{aligned}$$ + +These equations are correct if nothing else is affecting $\hat{\rho}$. +But in practice, these quantities decay due to various processes, +e.g. spontaneous emission (see [Einstein coefficients](/know/concept/einstein-coefficients/)). + +Let $\rho_{ee}$ decays with rate $\gamma_e$. +Since the total probability $\rho_{ee} + \rho_{gg} = 1$, +we thus have: + +$$\begin{aligned} + \Big( \dv{\rho_{ee}}{t} \Big)_{e} + = - \gamma_e \rho_{ee} + \quad \implies \quad + \Big( \dv{\rho_{gg}}{t} \Big)_{e} + = \gamma_e \rho_{ee} +\end{aligned}$$ + +Meanwhile, for whatever reason, +let $\rho_{gg}$ decay into $\rho_{ee}$ with rate $\gamma_g$: + +$$\begin{aligned} + \Big( \dv{\rho_{gg}}{t} \Big)_{g} + = - \gamma_g \rho_{gg} + \quad \implies \quad + \Big( \dv{\rho_{gg}}{t} \Big)_{g} + = \gamma_g \rho_{gg} +\end{aligned}$$ + +And finally, let the diagonal (perpendicular) matrix elements +both decay with rate $\gamma_\perp$: + +$$\begin{aligned} + \Big( \dv{\rho_{eg}}{t} \Big)_{\perp} + = - \gamma_\perp \rho_{eg} + \qquad \qquad + \Big( \dv{\rho_{ge}}{t} \Big)_{\perp} + = - \gamma_\perp \rho_{ge} +\end{aligned}$$ + +Putting everything together, +we arrive at the **optical Bloch equations** governing $\hat{\rho}$: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \dv{\rho_{gg}}{t} + &= \gamma_e \rho_{ee} - \gamma_g \rho_{gg} + + \frac{i}{\hbar} \Big( \vb{p}_0^{+} \cdot \vb{E}^{-} \rho_{eg} - \vb{p}_0^{-} \cdot \vb{E}^{+} \rho_{ge} \Big) + \\ + \dv{\rho_{ee}}{t} + &= \gamma_g \rho_{gg} - \gamma_e \rho_{ee} + + \frac{i}{\hbar} \Big( \vb{p}_0^{-} \cdot \vb{E}^{+} \rho_{ge} - \vb{p}_0^{+} \cdot \vb{E}^{-} \rho_{eg} \Big) + \\ + \dv{\rho_{ge}}{t} + &= - \Big( \gamma_\perp - i \omega_0 \Big) \rho_{ge} + + \frac{i}{\hbar} \vb{p}_0^{+} \cdot \vb{E}^{-} \Big( \rho_{ee} - \rho_{gg} \Big) + \\ + \dv{\rho_{eg}}{t} + &= - \Big( \gamma_\perp + i \omega_0 \Big) \rho_{eg} + + \frac{i}{\hbar} \vb{p}_0^{-} \cdot \vb{E}^{+} \Big( \rho_{gg} - \rho_{ee} \Big) + \end{aligned} + } +\end{aligned}$$ + +Many authors simplify these equations a bit by choosing +$\gamma_g = 0$ and $\gamma_\perp = \gamma_e / 2$. + + +## Including Maxwell's equations + +This two-level system has a dipole moment $\vb{p}$ as follows, +where we use [Laporte's selection rule](/know/concept/selection-rules/) +to remove diagonal terms, by assuming that +the electron's orbitals are odd or even: + +$$\begin{aligned} + \vb{p} + &= \matrixel{\Psi}{\hat{\vb{p}}}{\Psi} + \\ + &= q \Big( c_g c_g^* \matrixel{g}{\vu{x}}{g} + c_e c_e^* \matrixel{e}{\vu{x}}{e} + + c_g c_e^* \matrixel{e}{\vu{x}}{g} \exp(i \omega_0 t) + c_e c_g^* \matrixel{g}{\vu{x}}{e} \exp(-i \omega_0 t) \Big) + \\ + &= q \Big( \rho_{ge} \matrixel{e}{\vu{x}}{g} + \rho_{eg} \matrixel{g}{\vu{x}}{e} \Big) + = \vb{p}_0^{-} \rho_{ge}(t) + \vb{p}_0^{+} \rho_{eg}(t) + \equiv \vb{p}^{-}(t) + \vb{p}^{+}(t) +\end{aligned}$$ + +Where we have split $\vb{p}$ analogously to $\vb{E}$ +by defining $\vb{p}^{+} \equiv \vb{p}_0^{+} \rho_{eg}$. +Its equation of motion can then be found from the optical Bloch equations: + +$$\begin{aligned} + \dv{\vb{p}^{+}}{t} + = \vb{p}_0^{+} \dv{\rho_{eg}}{t} + = - \vb{p}_0^{+} \Big( \gamma_\perp + i \omega_0 \Big) \rho_{eg} + + \frac{i}{\hbar} \vb{p}_0^{+} \Big( \vb{p}_0^{-} \cdot \vb{E}^{+} \Big) \Big( \rho_{gg} - \rho_{ee} \Big) +\end{aligned}$$ + +Some authors do not bother multiplying $\rho_{ge}$ by $\vb{p}_0^{+}$. +In any case, we arrive at: + +$$\begin{aligned} + \boxed{ + \dv{\vb{p}^{+}}{t} + = - \Big( \gamma_\perp + i \omega_0 \Big) \vb{p}^{+} + - \frac{i}{\hbar} \Big( \vb{p}_0^{-} \cdot \vb{E}^{+} \Big) \vb{p}_0^{+} d + } +\end{aligned}$$ + +Where we have defined the **population inversion** $d \in [-1, 1]$ as follows, +which quantifies the electron's excitedness: + +$$\begin{aligned} + d + \equiv \rho_{ee} - \rho_{gg} +\end{aligned}$$ + +From the optical Bloch equations, +we find its equation of motion to be: + +$$\begin{aligned} + \dv{d}{t} + &= \dv{\rho_{ee}}{t} - \dv{\rho_{gg}}{t} + = 2 \gamma_g \rho_{gg} - 2 \gamma_e \rho_{ee} + + \frac{i 2}{\hbar} \Big( \vb{p}^{-} \cdot \vb{E}^{+} - \vb{p}^{+} \cdot \vb{E}^{-} \Big) +\end{aligned}$$ + +We can rewrite the first two terms in the following intuitive form, +which describes a decay with +rate $\gamma_\parallel \equiv \gamma_g + \gamma_e$ +towards an equilbrium $d_0$: + +$$\begin{aligned} + 2 \gamma_g \rho_{gg} - 2 \gamma_e \rho_{ee} + = \gamma_\parallel (d_0 - d) + \qquad \qquad + d_0 + \equiv \frac{\gamma_g - \gamma_e}{\gamma_g + \gamma_e} +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-inversion-decay"/> +<label for="proof-inversion-decay">Proof</label> +<div class="hidden"> +<label for="proof-inversion-decay">Proof.</label> +We introduce some new terms, and reorganize the expression: + +$$\begin{aligned} + 2 \gamma_g \rho_{gg} - 2 \gamma_e \rho_{ee} + &= 2 \gamma_g \rho_{gg} - 2 \gamma_e \rho_{ee} + + \gamma_g \rho_{ee} - \gamma_g \rho_{ee} + + \gamma_e \rho_{gg} - \gamma_e \rho_{gg} + \\ + &= \gamma_g (\rho_{gg} + \rho_{ee}) - \gamma_e (\rho_{gg} + \rho_{ee}) + + \gamma_g (\rho_{gg} - \rho_{ee}) + \gamma_e (\rho_{gg} - \rho_{ee}) +\end{aligned}$$ + +Since the total probability $\rho_{gg} + \rho_{ee} = 1$, +and $d \equiv \rho_{ee} - \rho_{gg}$, this reduces to: + +$$\begin{aligned} + 2 \gamma_g \rho_{gg} - 2 \gamma_e \rho_{ee} + &= \gamma_g - \gamma_e - (\gamma_g + \gamma_e) d + \\ + &= (\gamma_g + \gamma_e) \Big( \frac{\gamma_g - \gamma_e}{\gamma_g + \gamma_e} - d \Big) + \\ + &= \gamma_\parallel ( d_0 - d ) +\end{aligned}$$ +</div> +</div> + +With this, the equation for the population inversion $d$ +takes the following final form: + +$$\begin{aligned} + \boxed{ + \dv{d}{t} + = \gamma_\parallel (d_0 - d) + \frac{i 2}{\hbar} \Big( \vb{p}^{-} \cdot \vb{E}^{+} - \vb{p}^{+} \cdot \vb{E}^{-} \Big) + } +\end{aligned}$$ + +Finally, we would like a relation between the polarization +and the electric field $\vb{E}$, +for which we turn to [Maxwell's equations](/know/concept/maxwells-equations/). +We start from Faraday's law, +and split $\vb{B} = \mu_0 (\vb{H} + \vb{M})$: + +$$\begin{aligned} + \nabla \cross \vb{E} + = - \pdv{\vb{B}}{t} + = - \mu_0 \pdv{\vb{H}}{t} - \mu_0 \pdv{\vb{M}}{t} +\end{aligned}$$ + +We assume that there is no magnetization $\vb{M} = 0$. +Then we we take the curl of both sides, +and replace $\nabla \cross \vb{H}$ with Ampère's circuital law: + +$$\begin{aligned} + \nabla \cross \big( \nabla \cross \vb{E} \big) + = - \mu_0 \pdv{}{t} \big( \nabla \cross \vb{H} \big) + = - \mu_0 \pdv{}{t} \Big( \vb{J}_\mathrm{free} + \pdv{\vb{D}}{t} \Big) +\end{aligned}$$ + +Inserting the definition $\vb{D} = \varepsilon_0 \vb{E} + \vb{P}$ +together with Ohm's law $\vb{J}_\mathrm{free} = \sigma \vb{E}$ yields: + +$$\begin{aligned} + \nabla \cross \big( \nabla \cross \vb{E} \big) + = - \mu_0 \sigma \pdv{\vb{E}}{t} - \mu_0 \varepsilon_0 \pdvn{2}{\vb{E}}{t} - \mu_0 \pdvn{2}{\vb{P}}{t} +\end{aligned}$$ + +Where $\sigma$ is the active material's conductivity, if any; +almost all authors assume $\sigma = 0$. + +Recall that we are describing the dynamics of a two-level system. +In reality, such a system (e.g. a quantum dot) +is suspended in a passive background medium, +which reacts with a polarization $\vb{P}_\mathrm{med}$ +to the electric field $\vb{E}$. +If the medium is linear, i.e. $\vb{P}_\mathrm{med} = \varepsilon_0 \chi \vb{E}$, +then: + +$$\begin{aligned} + \mu_0 \pdvn{2}{\vb{P}}{t} + &= - \nabla \cross \big( \nabla \cross \vb{E} \big) - \mu_0 \sigma \pdv{\vb{E}}{t} + - \mu_0 \varepsilon_0 \pdvn{2}{\vb{E}}{t} - \mu_0 \pdvn{2}{\vb{P}_\mathrm{med}}{t} + \\ + &= - \nabla \cross \big( \nabla \cross \vb{E} \big) - \mu_0 \sigma \pdv{\vb{E}}{t} + - \mu_0 \pdvn{2}{}{t}\Big( \varepsilon_0 \vb{E} + \varepsilon_0 \chi \vb{E} \Big) + \\ + &= - \nabla \cross \big( \nabla \cross \vb{E} \big) - \mu_0 \sigma \pdv{\vb{E}}{t} + - \mu_0 \varepsilon_0 \varepsilon_r \pdvn{2}{\vb{E}}{t} +\end{aligned}$$ + +Where $\varepsilon_r \equiv 1 + \chi_e$ is the medium's relative permittivity. +The speed of light $c^2 = 1 / (\mu_0 \varepsilon_0)$, +and the refractive index $n^2 = \mu_r \varepsilon_r$, +where $\mu_r = 1$ due to our assumption that $\vb{M} = 0$, so: + +$$\begin{aligned} + \boxed{ + \mu_0 \pdvn{2}{\vb{P}}{t} + = - \nabla \cross \big( \nabla \cross \vb{E} \big) - \mu_0 \sigma \pdv{\vb{E}}{t} - \frac{n^2}{c^2} \pdvn{2}{\vb{E}}{t} + } +\end{aligned}$$ + +$\vb{E}$ and $\vb{P}$ can trivially be replaced by $\vb{E}^{+}$ and $\vb{P}^{+}$. +It is also simple to convert $\vb{p}^{+}$ and $d$ +into the macroscopic $\vb{P}^{+}$ and total $D$ +by summing over all two-level systems in the medium: + +$$\begin{aligned} + \vb{P}^{+}(\vb{x}, t) + &= \sum_{\nu} \vb{p}^{+}_\nu \: \delta(\vb{x} - \vb{x}_\nu) + \\ + D(\vb{x}, t) + &= \sum_{\nu} d_\nu \: \delta(\vb{x} - \vb{x}_\nu) +\end{aligned}$$ + +We thus arrive at the **Maxwell-Bloch equations**, +which are the foundation of laser theory: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \mu_0 \pdvn{2}{\vb{P}^{+}}{t} + &= - \nabla \cross \nabla \cross \vb{E}^{+} - \mu_0 \sigma \pdv{\vb{E}^{+}}{t} - \frac{n^2}{c^2} \pdvn{2}{\vb{E}^{+}}{t} + \\ + \pdv{\vb{P}^{+}}{t} + &= - \Big( \gamma_\perp + i \omega_0 \Big) \vb{P}^{+} + - \frac{i}{\hbar} \Big( \vb{p}_0^{-} \cdot \vb{E}^{+} \Big) \vb{p}_0^{+} D + \\ + \pdv{D}{t} + &= \gamma_\parallel (D_0 - D) + \frac{i 2}{\hbar} \Big( \vb{P}^{-} \cdot \vb{E}^{+} - \vb{P}^{+} \cdot \vb{E}^{-} \Big) + \end{aligned} + } +\end{aligned}$$ + + + +## References +1. F. Kärtner, + [Ultrafast optics: lecture notes](https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-977-ultrafast-optics-spring-2005/lecture-notes/), + 2005, MIT. +2. H. Haken, + *Light: volume 2: laser light dynamics*, + 1985, North-Holland. +3. H.J. Metcalf, P. van der Straten, + *Laser cooling and trapping*, + 1999, Springer. diff --git a/source/know/concept/maxwell-boltzmann-distribution/index.md b/source/know/concept/maxwell-boltzmann-distribution/index.md new file mode 100644 index 0000000..5595514 --- /dev/null +++ b/source/know/concept/maxwell-boltzmann-distribution/index.md @@ -0,0 +1,214 @@ +--- +title: "Maxwell-Boltzmann distribution" +date: 2021-05-08 +categories: +- Physics +- Statistics +- Thermodynamics +layout: "concept" +--- + +The **Maxwell-Boltzmann distributions** are a set of closely related +probability distributions with applications in classical statistical physics. + + +## Velocity vector distribution + +In the [canonical ensemble](/know/concept/canonical-ensemble/) +(where a fixed-size system can exchange energy with its environment), +the probability of a microstate with energy $E$ is given by the Boltzmann distribution: + +$$\begin{aligned} + f(E) + \:\propto\: \exp\!\big(\!-\! \beta E\big) +\end{aligned}$$ + +Where $\beta = 1 / k_B T$. +We split $E = K + U$, +with $K$ and $U$ the total kinetic and potential energy contributions. +If there are $N$ particles in the system, +with positions $\tilde{r} = (\vec{r}_1, ..., \vec{r}_N)$ +and momenta $\tilde{p} = (\vec{p}_1, ..., \vec{p}_N)$, +then $K$ only depends on $\tilde{p}$, +and $U$ only depends on $\tilde{r}$, +so the probability of a specific microstate +$(\tilde{r}, \tilde{p})$ is as follows: + +$$\begin{aligned} + f(\tilde{r}, \tilde{p}) + \:\propto\: \exp\!\Big(\!-\! \beta \big( K(\tilde{p}) + U(\tilde{r}) \big) \Big) +\end{aligned}$$ + +Since this is classical physics, +we can split the exponential. +In quantum mechanics, +the canonical commutation relation would prevent that. +Anyway, splitting yields: + +$$\begin{aligned} + f(\tilde{r}, \tilde{p}) + \:\propto\: \exp\!\big(\!-\! \beta K(\tilde{p}) \big) \exp\!\big(\!-\! \beta U(\tilde{r}) \big) +\end{aligned}$$ + +Classically, the probability +distributions of the momenta and positions are independent: + +$$\begin{aligned} + f_K(\tilde{p}) + \:\propto\: \exp\!\big(\!-\! \beta K(\tilde{p}) \big) + \qquad \qquad + f_U(\tilde{r}) + \:\propto\: \exp\!\big(\!-\! \beta U(\tilde{r}) \big) +\end{aligned}$$ + +We cannot evaluate $f_U(\tilde{r})$ further without knowing $U(\tilde{r})$ for a system. +We thus turn to $f_K(\tilde{p})$, and see that the total kinetic +energy $K(\tilde{p})$ is simply the sum of the particles' individual +kinetic energies $K_n(\vec{p}_n)$, which are well-known: + +$$\begin{aligned} + K(\tilde{p}) + = \sum_{n = 1}^N K_n(\vec{p}_n) + \qquad \mathrm{where} \qquad + K_n(\vec{p}_n) + = \frac{|\vec{p}_n|^2}{2 m} +\end{aligned}$$ + +Consequently, the probability distribution $f(p_x, p_y, p_z)$ for the +momentum vector of a single particle is as follows, +after normalization: + +$$\begin{aligned} + f(p_x, p_y, p_z) + = \Big( \frac{1}{2 \pi m k_B T} \Big)^{3/2} \exp\!\Big( \!-\!\frac{(p_x^2 + p_y^2 + p_z^2)}{2 m k_B T} \Big) +\end{aligned}$$ + +We now rewrite this using the velocities $v_x = p_x / m$, +and update the normalization, giving: + +$$\begin{aligned} + \boxed{ + f(v_x, v_y, v_z) + = \Big( \frac{m}{2 \pi k_B T} \Big)^{3/2} \exp\!\Big( \!-\!\frac{m (v_x^2 + v_y^2 + v_z^2)}{2 k_B T} \Big) + } +\end{aligned}$$ + +This is the **Maxwell-Boltzmann velocity vector distribution**. +Clearly, this is a product of three exponentials, +so the velocity in each direction is independent of the others: + +$$\begin{aligned} + f(v_x) + = \sqrt{\frac{m}{2 \pi k_B T}} \exp\!\Big( \!-\!\frac{m v_x^2}{2 k_B T} \Big) +\end{aligned}$$ + +The distribution is thus an isotropic gaussian with standard deviations given by: + +$$\begin{aligned} + \sigma_x = \sigma_y = \sigma_z + = \sqrt{\frac{k_B T}{m}} +\end{aligned}$$ + + +## Speed distribution + +We know the distribution of the velocities along each axis, +but what about the speed $v = |\vec{v}|$? +Because we do not care about the direction of $\vec{v}$, only its magnitude, +the [density of states](/know/concept/density-of-states/) $g(v)$ is not constant: +it is the rate-of-change of the volume of a sphere of radius $v$: + +$$\begin{aligned} + g(v) + = \dv{}{v}\Big( \frac{4 \pi}{3} v^3 \Big) + = 4 \pi v^2 +\end{aligned}$$ + +Multiplying the velocity vector distribution by $g(v)$ +and substituting $v^2 = v_x^2 + v_y^2 + v_z^2$ +then gives us the **Maxwell-Boltzmann speed distribution**: + +$$\begin{aligned} + \boxed{ + f(v) + = 4 \pi \Big( \frac{m}{2 \pi k_B T} \Big)^{3/2} v^2 \exp\!\Big( \!-\!\frac{m v^2}{2 k_B T} \Big) + } +\end{aligned}$$ + +Some notable points on this distribution are +the most probable speed $v_{\mathrm{mode}}$, +the mean average speed $v_{\mathrm{mean}}$, +and the root-mean-square speed $v_{\mathrm{rms}}$: + +$$\begin{aligned} + f'(v_\mathrm{mode}) + = 0 + \qquad + v_\mathrm{mean} + = \int_0^\infty v \: f(v) \dd{v} + \qquad + v_\mathrm{rms} + = \bigg( \int_0^\infty v^2 \: f(v) \dd{v} \bigg)^{1/2} +\end{aligned}$$ + +Which can be calculated to have the following exact expressions: + +$$\begin{aligned} + \boxed{ + v_{\mathrm{mode}} + = \sqrt{\frac{2 k_B T}{m}} + } + \qquad + \boxed{ + v_{\mathrm{mean}} + = \sqrt{\frac{8 k_B T}{\pi m}} + } + \qquad + \boxed{ + v_{\mathrm{rms}} + = \sqrt{\frac{3 k_B T}{m}} + } +\end{aligned}$$ + + +## Kinetic energy distribution + +Using the speed distribution, +we can work out the kinetic energy distribution. +Because $K$ is not proportional to $v$, +we must do this by demanding that: + +$$\begin{aligned} + f(K) \dd{K} + = f(v) \dd{v} + \quad \implies \quad + f(K) + = f(v) \dv{v}{K} +\end{aligned}$$ + +We know that $K = m v^2 / 2$, +meaning $\dd{K} = m v \dd{v}$ +so the energy distribution $f(K)$ is: + +$$\begin{aligned} + f(K) + = \frac{f(v)}{m v} + = \sqrt{\frac{2 m}{\pi}} \: \bigg( \frac{1}{k_B T} \bigg)^{3/2} v \exp\!\Big( \!-\!\frac{m v^2}{2 k_B T} \Big) +\end{aligned}$$ + +Substituting $v = \sqrt{2 K/m}$ leads to +the **Maxwell-Boltzmann kinetic energy distribution**: + +$$\begin{aligned} + \boxed{ + f(K) + = 2 \sqrt{\frac{K}{\pi}} \: \bigg( \frac{1}{k_B T} \bigg)^{3/2} \exp\!\Big( \!-\!\frac{K}{k_B T} \Big) + } +\end{aligned}$$ + + + +## References +1. H. Gould, J. Tobochnik, + *Statistical and thermal physics*, 2nd edition, + Princeton. diff --git a/source/know/concept/maxwell-relations/index.md b/source/know/concept/maxwell-relations/index.md new file mode 100644 index 0000000..b546ef3 --- /dev/null +++ b/source/know/concept/maxwell-relations/index.md @@ -0,0 +1,290 @@ +--- +title: "Maxwell relations" +date: 2021-07-08 +categories: +- Physics +- Thermodynamics +layout: "concept" +--- + +The **Maxwell relations** are a useful set of relations in thermodynamics. +They arise from the fact that the order of differentiation is irrelevant +for well-behaved functions (sometimes known as the *Schwarz theorem*), +applied to the [thermodynamic potentials](/know/concept/thermodynamic-potential/). + +We start by proving the general "recipe". +Given that the differential element of some $z$ is defined in terms of +two constant quantities $A$ and $B$ and two independent variables $x$ and $y$: + +$$\begin{aligned} + \dd{z} \equiv A \dd{x} + B \dd{y} +\end{aligned}$$ + +Then the quantities $A$ and $B$ can be extracted +by dividing by $\dd{x}$ and $\dd{y}$ respectively: + +$$\begin{aligned} + A = \Big( \pdv{z}{x} \Big)_y + \qquad + B = \Big( \pdv{z}{y} \Big)_x +\end{aligned}$$ + +By differentiating $A$ and $B$, +and using that the order of differentiation is irrelevant, we find: + +$$\begin{aligned} + \mpdv{z}{y}{x} = + \boxed{ + \Big( \pdv{A}{y} \Big)_x + = \Big( \pdv{B}{x} \Big)_y + } + = \mpdv{z}{x}{y} +\end{aligned}$$ + +Using this, all Maxwell relations are derived. +Each relation also has a reciprocal form: + +$$\begin{aligned} + \Big( \pdv{A}{y} \Big)_x^{-1} = + \boxed{ + \Big( \pdv{y}{A} \Big)_x + = \Big( \pdv{x}{B} \Big)_y + } + = \Big( \pdv{B}{x} \Big)_y^{-1} +\end{aligned}$$ + +The following quantities are useful to rewrite some of the Maxwell relations: +the iso-$P$ thermal expansion coefficient $\alpha$, +the iso-$T$ combressibility $\kappa_T$, +the iso-$S$ combressibility $\kappa_S$, +the iso-$V$ heat capacity $C_V$, +and the iso-$P$ heat capacity $C_P$: + +$$\begin{gathered} + \alpha \equiv \frac{1}{V} \Big( \pdv{V}{T} \Big)_{P,N} + \\ + \kappa_T \equiv - \frac{1}{V} \Big( \pdv{V}{P} \Big)_{T,N} + \qquad \quad + \kappa_S \equiv - \frac{1}{V} \Big( \pdv{V}{P} \Big)_{S,N} + \\ + C_V \equiv T \Big( \pdv{S}{T} \Big)_{V,N} + \qquad \qquad + C_P \equiv T \Big( \pdv{S}{T} \Big)_{P,N} +\end{gathered}$$ + + +## Internal energy + +The following Maxwell relations can be derived +from the internal energy $U(S, V, N)$: + +$$\begin{gathered} + \mpdv{U}{V}{S} = + \boxed{ + \Big( \pdv{T}{V} \Big)_S = - \Big( \pdv{P}{S} \Big)_V + } + = \mpdv{U}{S}{V} + \\ + \mpdv{U}{V}{N} = + \boxed{ + \Big( \pdv{\mu}{V} \Big)_N = - \Big( \pdv{P}{N} \Big)_V + } + = \mpdv{U}{N}{V} + \\ + \mpdv{U}{S}{N} = + \boxed{ + \Big( \pdv{\mu}{S} \Big)_N = \Big( \pdv{T}{N} \Big)_S + } + = \mpdv{U}{N}{S} +\end{gathered}$$ + +And the corresponding reciprocal relations are then given by: + +$$\begin{gathered} + \boxed{ + \Big( \pdv{V}{T} \Big)_S = - \Big( \pdv{S}{P} \Big)_V + } + \\ + \boxed{ + \Big( \pdv{V}{\mu} \Big)_N = - \Big( \pdv{N}{P} \Big)_V + } + \\ + \boxed{ + \Big( \pdv{S}{\mu} \Big)_N = \Big( \pdv{N}{T} \Big)_S + } +\end{gathered}$$ + + +## Enthalpy + +The following Maxwell relations can be derived +from the enthalpy $H(S, P, N)$: + +$$\begin{gathered} + \mpdv{H}{P}{S} = + \boxed{ + \Big( \pdv{T}{P} \Big)_S = \Big( \pdv{V}{S} \Big)_P + } + = \mpdv{H}{S}{P} + \\ + \mpdv{H}{P}{N} = + \boxed{ + \Big( \pdv{\mu}{P} \Big)_N = \Big( \pdv{V}{N} \Big)_P + } + = \mpdv{H}{N}{P} + \\ + \mpdv{H}{N}{S} = + \boxed{ + \Big( \pdv{T}{N} \Big)_S = \Big( \pdv{\mu}{S} \Big)_N + } + = \mpdv{H}{S}{N} +\end{gathered}$$ + +And the corresponding reciprocal relations are then given by: + +$$\begin{gathered} + \boxed{ + \Big( \pdv{P}{T} \Big)_S = \Big( \pdv{S}{V} \Big)_P + } + \\ + \boxed{ + \Big( \pdv{P}{\mu} \Big)_N = \Big( \pdv{N}{V} \Big)_P + } + \\ + \boxed{ + \Big( \pdv{N}{T} \Big)_S = \Big( \pdv{S}{\mu} \Big)_N + } +\end{gathered}$$ + + +## Helmholtz free energy + +The following Maxwell relations can be derived +from the Helmholtz free energy $F(T, V, N)$: + +$$\begin{gathered} + - \mpdv{F}{V}{T} = + \boxed{ + \Big( \pdv{S}{V} \Big)_T = \Big( \pdv{P}{T} \Big)_V + } + = - \mpdv{F}{T}{V} + \\ + \mpdv{F}{V}{N} = + \boxed{ + \Big( \pdv{\mu}{V} \Big)_N = - \Big( \pdv{P}{N} \Big)_V + } + = \mpdv{F}{N}{V} + \\ + \mpdv{F}{T}{N} = + \boxed{ + \Big( \pdv{\mu}{T} \Big)_N = - \Big( \pdv{S}{N} \Big)_T + } + = \mpdv{F}{N}{T} +\end{gathered}$$ + +And the corresponding reciprocal relations are then given by: + +$$\begin{gathered} + \boxed{ + \Big( \pdv{V}{S} \Big)_T = \Big( \pdv{T}{P} \Big)_V + } + \\ + \boxed{ + \Big( \pdv{V}{\mu} \Big)_N = - \Big( \pdv{N}{P} \Big)_V + } + \\ + \boxed{ + \Big( \pdv{T}{\mu} \Big)_N = - \Big( \pdv{N}{S} \Big)_T + } +\end{gathered}$$ + + +## Gibbs free energy + +The following Maxwell relations can be derived +from the Gibbs free energy $G(T, P, N)$: + +$$\begin{gathered} + \mpdv{G}{T}{P} = + \boxed{ + \Big( \pdv{V}{T} \Big)_P = - \Big( \pdv{S}{P} \Big)_T + } + = \mpdv{G}{P}{T} + \\ + \mpdv{G}{N}{P} = + \boxed{ + \Big( \pdv{V}{N} \Big)_P = \Big( \pdv{\mu}{P} \Big)_N + } + = \mpdv{G}{P}{N} + \\ + \mpdv{G}{T}{N} = + \boxed{ + \Big( \pdv{\mu}{T} \Big)_N = - \Big( \pdv{S}{N} \Big)_T + } + = \mpdv{G}{N}{T} +\end{gathered}$$ + +And the corresponding reciprocal relations are then given by: + +$$\begin{gathered} + \boxed{ + \Big( \pdv{T}{V} \Big)_P = - \Big( \pdv{P}{S} \Big)_T + } + \\ + \boxed{ + \Big( \pdv{N}{V} \Big)_P = \Big( \pdv{P}{\mu} \Big)_N + } + \\ + \boxed{ + \Big( \pdv{T}{\mu} \Big)_N = - \Big( \pdv{N}{S} \Big)_T + } +\end{gathered}$$ + + +## Landau potential + +The following Maxwell relations can be derived +from the Gibbs free energy $\Omega(T, V, \mu)$: + +$$\begin{gathered} + - \mpdv{\Omega}{V}{T} = + \boxed{ + \Big( \pdv{S}{V} \Big)_T = \Big( \pdv{P}{T} \Big)_V + } + = - \mpdv{\Omega}{T}{V} + \\ + - \mpdv{\Omega}{\mu}{V} = + \boxed{ + \Big( \pdv{P}{\mu} \Big)_V = \Big( \pdv{N}{V} \Big)_\mu + } + = - \mpdv{\Omega}{V}{\mu} + \\ + - \mpdv{\Omega}{T}{\mu} = + \boxed{ + \Big( \pdv{N}{T} \Big)_\mu = \Big( \pdv{S}{\mu} \Big)_T + } + = - \mpdv{\Omega}{\mu}{T} +\end{gathered}$$ + +And the corresponding reciprocal relations are then given by: + +$$\begin{gathered} + \boxed{ + \Big( \pdv{V}{S} \Big)_T = \Big( \pdv{T}{P} \Big)_V + } + \\ + \boxed{ + \Big( \pdv{\mu}{P} \Big)_V = \Big( \pdv{V}{N} \Big)_\mu + } + \\ + \boxed{ + \Big( \pdv{T}{N} \Big)_\mu = \Big( \pdv{\mu}{S} \Big)_T + } +\end{gathered}$$ + + + +## References +1. H. Gould, J. Tobochnik, + *Statistical and thermal physics*, 2nd edition, + Princeton. diff --git a/source/know/concept/maxwells-equations/index.md b/source/know/concept/maxwells-equations/index.md new file mode 100644 index 0000000..033ebf7 --- /dev/null +++ b/source/know/concept/maxwells-equations/index.md @@ -0,0 +1,259 @@ +--- +title: "Maxwell's equations" +date: 2021-09-09 +categories: +- Physics +- Electromagnetism +layout: "concept" +--- + +In physics, **Maxwell's equations** govern +all macroscopic electromagnetism, +and notably lead to the +[electromagnetic wave equation](/know/concept/electromagnetic-wave-equation/), +which describes the existence of light. + + +## Gauss' law + +**Gauss' law** states that the electric flux $\Phi_E$ through +a closed surface $S(V)$ is equal to the total charge $Q$ +contained in the enclosed volume $V$, +divided by the vacuum permittivity $\varepsilon_0$: + +$$\begin{aligned} + \Phi_E + = \oint_{S(V)} \vb{E} \cdot \dd{\vb{A}} + = \frac{1}{\varepsilon_0} \int_{V} \rho \dd{V} + = \frac{Q}{\varepsilon_0} +\end{aligned}$$ + +Where $\vb{E}$ is the [electric field](/know/concept/electric-field/), +and $\rho$ is the charge density in $V$. +Gauss' law is usually more useful when written in its vector form, +which can be found by applying the divergence theorem +to the surface integral above. +It states that the divergence of $\vb{E}$ is proportional to $\rho$: + +$$\begin{aligned} + \boxed{ + \nabla \cdot \vb{E} = \frac{\rho}{\varepsilon_0} + } +\end{aligned}$$ + +This law can just as well be expressed for +the displacement field $\vb{D}$ +and polarization density $\vb{P}$. +We insert $\vb{E} = (\vb{D} - \vb{P}) / \varepsilon_0$ +into Gauss' law for $\vb{E}$, multiplied by $\varepsilon_0$: + +$$\begin{aligned} + \rho + = \nabla \cdot \big( \vb{D} - \vb{P} \big) + = \nabla \cdot \vb{D} - \nabla \cdot \vb{P} +\end{aligned}$$ + +To proceed, we split the net charge density $\rho$ +into a "free" part $\rho_\mathrm{free}$ +and a "bound" part $\rho_\mathrm{bound}$, +respectively corresponding to $\vb{D}$ and $\vb{P}$, +such that $\rho = \rho_\mathrm{free} + \rho_\mathrm{bound}$. +This yields: + +$$\begin{aligned} + \boxed{ + \nabla \cdot \vb{D} = \rho_{\mathrm{free}} + } + \qquad \quad + \boxed{ + \nabla \cdot \vb{P} = - \rho_{\mathrm{bound}} + } +\end{aligned}$$ + +By integrating over an arbitrary volume $V$ +we can get integral forms of these equations: + +$$\begin{aligned} + \Phi_D + &= \oint_{S(V)} \vb{D} \cdot \dd{\vb{A}} + = \int_{V} \rho_{\mathrm{free}} \dd{V} + = Q_{\mathrm{free}} + \\ + \Phi_P + &= \oint_{S(V)} \vb{P} \cdot \dd{\vb{A}} + = - \int_{V} \rho_{\mathrm{bound}} \dd{V} + = - Q_{\mathrm{bound}} +\end{aligned}$$ + + +## Gauss' law for magnetism + +**Gauss' law for magnetism** states that magnetic flux $\Phi_B$ +through a closed surface $S(V)$ is zero. +In other words, all magnetic field lines entering +the volume $V$ must leave it too: + +$$\begin{aligned} + \Phi_B + = \oint_{S(V)} \vb{B} \cdot \dd{\vb{A}} + = 0 +\end{aligned}$$ + +Where $\vb{B}$ is the [magnetic field](/know/concept/magnetic-field/). +Thanks to the divergence theorem, +this can equivalently be stated in vector form as follows: + +$$\begin{aligned} + \boxed{ + \nabla \cdot \vb{B} = 0 + } +\end{aligned}$$ + +A consequence of this law is the fact that magnetic monopoles cannot exist, +i.e. there is no such thing as "magnetic charge", +in contrast to electric charge. + + +## Faraday's law of induction + +**Faraday's law of induction** states that a magnetic field $\vb{B}$ +that changes with time will induce an electric field $E$. +Specifically, the change in magnetic flux through a non-closed surface $S$ +creates an electromotive force around the contour $C(S)$. +This is written as: + +$$\begin{aligned} + \oint_{C(S)} \vb{E} \cdot \dd{\vb{l}} + = - \dv{}{t}\int_{S} \vb{B} \cdot \dd{\vb{A}} +\end{aligned}$$ + +By using Stokes' theorem on the contour integral, +the vector form of this law is found to be: + +$$\begin{aligned} + \boxed{ + \nabla \times \vb{E} = - \pdv{\vb{B}}{t} + } +\end{aligned}$$ + + +## Ampère's circuital law + +**Ampère's circuital law**, with Maxwell's correction, +states that a magnetic field $\vb{B}$ +can be induced along a contour $C(S)$ by two things: +a current density $\vb{J}$ through the enclosed surface $S$, +and a change of the electric field flux $\Phi_E$ through $S$: + +$$\begin{aligned} + \oint_{C(S)} \vb{B} \cdot d\vb{l} + = \mu_0 \Big( \int_S \vb{J} \cdot d\vb{A} + \varepsilon_0 \dv{}{t}\int_S \vb{E} \cdot d\vb{A} \Big) +\end{aligned}$$ +$$\begin{aligned} + \boxed{ + \nabla \times \vb{B} = \mu_0 \Big( \vb{J} + \varepsilon_0 \pdv{\vb{E}}{t} \Big) + } +\end{aligned}$$ + +Where $\mu_0$ is the vacuum permeability. +This relation also exists for the "bound" fields $\vb{H}$ and $\vb{D}$, +and for $\vb{M}$ and $\vb{P}$. +We insert $\vb{B} = \mu_0 (\vb{H} + \vb{M})$ +and $\vb{E} = (\vb{D} - \vb{P})/\varepsilon_0$ +into Ampère's law, after dividing it by $\mu_0$ for simplicity: + +$$\begin{aligned} + \nabla \cross \big( \vb{H} + \vb{M} \big) + &= \vb{J} + \pdv{}{t}\big( \vb{D} - \vb{P} \big) +\end{aligned}$$ + +To proceed, we split the net current density $\vb{J}$ +into a "free" part $\vb{J}_\mathrm{free}$ +and a "bound" part $\vb{J}_\mathrm{bound}$, +such that $\vb{J} = \vb{J}_\mathrm{free} + \vb{J}_\mathrm{bound}$. +This leads us to: + +$$\begin{aligned} + \boxed{ + \nabla \times \vb{H} = \vb{J}_{\mathrm{free}} + \pdv{\vb{D}}{t} + } + \qquad \quad + \boxed{ + \nabla \times \vb{M} = \vb{J}_{\mathrm{bound}} - \pdv{\vb{P}}{t} + } +\end{aligned}$$ + +By integrating over an arbitrary surface $S$ +we can get integral forms of these equations: + +$$\begin{aligned} + \oint_{C(S)} \vb{H} \cdot d\vb{l} + &= \int_S \vb{J}_{\mathrm{free}} \cdot \dd{\vb{A}} + \dv{}{t}\int_S \vb{D} \cdot \dd{\vb{A}} + \\ + \oint_{C(S)} \vb{M} \cdot d\vb{l} + &= \int_S \vb{J}_{\mathrm{bound}} \cdot \dd{\vb{A}} - \dv{}{t}\int_S \vb{P} \cdot \dd{\vb{A}} +\end{aligned}$$ + +Note that $\vb{J}_\mathrm{bound}$ can be split into +the **magnetization current density** $\vb{J}_M = \nabla \cross \vb{M}$ +and the **polarization current density** $\vb{J}_P = \ipdv{\vb{P}}{t}$: + +$$\begin{aligned} + \vb{J}_\mathrm{bound} + = \vb{J}_M + \vb{J}_P + = \nabla \cross \vb{M} + \pdv{\vb{P}}{t} +\end{aligned}$$ + + +## Redundancy of Gauss' laws + +In fact, both of Gauss' laws are redundant, +because they are already implied by Faraday's and Ampère's laws. +Suppose we take the divergence of Faraday's law: + +$$\begin{aligned} + 0 + = \nabla \cdot \nabla \cross \vb{E} + = - \nabla \cdot \pdv{\vb{B}}{t} + = - \pdv{}{t}(\nabla \cdot \vb{B}) +\end{aligned}$$ + +Since the divergence of a curl is always zero, +the right-hand side must vanish. +We know that $\vb{B}$ can vary in time, +so our only option to satisfy this is to demand that $\nabla \cdot \vb{B} = 0$. +We thus arrive arrive at Gauss' law for magnetism from Faraday's law. + +The same technique works for Ampère's law. +Taking its divergence gives us: + +$$\begin{aligned} + 0 + = \frac{1}{\mu_0} \nabla \cdot \nabla \cross \vb{B} + = \nabla \cdot \vb{J} + \varepsilon_0 \pdv{}{t}(\nabla \cdot \vb{E}) +\end{aligned}$$ + +We integrate this over an arbitrary volume $V$, +and apply the divergence theorem: + +$$\begin{aligned} + 0 + &= \int_V \nabla \cdot \vb{J} \dd{V} + \pdv{}{t}\int_V \varepsilon_0 \nabla \cdot \vb{E} \dd{V} + \\ + &= \oint_S \vb{J} \cdot \dd{S} + \pdv{}{t}\int_V \varepsilon_0 \nabla \cdot \vb{E} \dd{V} +\end{aligned}$$ + +The first integral represents the current (charge flux) +through the surface of $V$. +Electric charge is not created or destroyed, +so the second integral *must* be the total charge in $V$: + +$$\begin{aligned} + Q + = \int_V \varepsilon_0 \nabla \cdot \vb{E} \dd{V} + \quad \implies \quad + \nabla \cdot \vb{E} + = \frac{\rho}{\varepsilon_0} +\end{aligned}$$ + +And we thus arrive at Gauss' law from Ampère's law and charge conservation. diff --git a/source/know/concept/meniscus/index.md b/source/know/concept/meniscus/index.md new file mode 100644 index 0000000..1373d63 --- /dev/null +++ b/source/know/concept/meniscus/index.md @@ -0,0 +1,189 @@ +--- +title: "Meniscus" +date: 2021-03-11 +categories: +- Physics +- Fluid mechanics +- Fluid statics +- Surface tension +layout: "concept" +--- + +When a fluid interface, e.g. the surface of a liquid, +touches a flat solid wall, it will curve to meet it. +This small rise or fall is called a **meniscus**, +and is caused by surface tension and gravity. + +In 2D, let the vertical $y$-axis be a flat wall, +and the fluid tend to $y = 0$ when $x \to \infty$. +Close to the wall, i.e. for small $x$, the liquid curves up or down +to touch the wall at a height $y = d$. + +Three forces are at work here: +the first two are the surface tension $\alpha$ of the fluid surface, +and the counter-pull $\alpha \sin\phi$ of the wall against the tension, +where $\phi$ is the contact angle. +The third is the [hydrostatic pressure](/know/concept/hydrostatic-pressure/) gradient +inside the small portion of the fluid above/below the ambient level, +which exerts a total force on the wall given by +(for $\phi < \pi/2$ so that $d > 0$): + +$$\begin{aligned} + \int_0^d \rho g y \dd{y} + = \frac{1}{2} \rho g d^2 +\end{aligned}$$ + +If you were wondering about the units, +keep in mind that there is an implicit $z$-direction here too. +This results in the following balance equation for the forces at the wall: + +$$\begin{aligned} + \alpha + = \alpha \sin\phi + \frac{1}{2} \rho g d^2 +\end{aligned}$$ + +We isolate this relation for $d$ +and use some trigonometric magic to rewrite it: + +$$\begin{aligned} + d + = \sqrt{\frac{\alpha}{\rho g}} \sqrt{2 (1 - \sin\phi)} + = \sqrt{\frac{\alpha}{\rho g}} \sqrt{4 \sin^2\!\Big(\frac{\pi}{4} - \frac{\phi}{2}\Big)} +\end{aligned}$$ + +Here, we recognize the definition of the capillary length $L_c = \sqrt{\alpha / (\rho g)}$, +yielding an expression for $d$ +that is valid both for $\phi < \pi/2$ (where $d > 0$) +and $\phi > \pi/2$ (where $d < 0$): + +$$\begin{aligned} + \boxed{ + d + = 2 L_c \sin\!\Big(\frac{\pi/2 - \phi}{2}\Big) + } +\end{aligned}$$ + +Next, we would like to know the exact shape of the meniscus. +To do this, we need to describe the liquid surface differently, +using the elevation angle $\theta$ relative to the $y = 0$ plane. +The curve $\theta(s)$ is a function of the arc length $s$, +where $\dd{s}^2 = \dd{x}^2 + \dd{y}^2$, +and is governed by: + +$$\begin{aligned} + \dv{x}{s} + = \cos\theta + \qquad + \dv{y}{s} + = \sin\theta + \qquad + \dv{\theta}{s} + = \frac{1}{R} +\end{aligned}$$ + +The last equation describes the curvature radius $R$ +of the surface along the $x$-axis. +Since we are considering a flat wall, +there is no curvature in the orthogonal principal direction. + +Just below the liquid surface in the meniscus, +we expect the hydrostatic pressure +and the [Young-Laplace law](/know/concept/young-laplace-law/) +to agree about the pressure $p$, +where $p_0$ is the external air pressure: + +$$\begin{aligned} + p_0 - \rho g y + = p_0 - \frac{\alpha}{R} +\end{aligned}$$ + +Rearranging this yields that $R = L_c^2 / y$. +Inserting this into the curvature equation gives us: + +$$\begin{aligned} + \dv{\theta}{s} + = \frac{y}{L_c^2} +\end{aligned}$$ + +By differentiating this equation with respect to $s$ +and using $\idv{y}{s} = \sin\theta$, we arrive at: + +$$\begin{aligned} + \boxed{ + L_c^2 \dvn{2}{\theta}{s} = \sin\theta + } +\end{aligned}$$ + +To solve this equation, we multiply it by $\idv{\theta}{s}$, +which is nonzero close to the wall: + +$$\begin{aligned} + L_c^2 \dvn{2}{\theta}{s} \dv{\theta}{s} + = \dv{\theta}{s} \sin\theta +\end{aligned}$$ + +We integrate both sides with respect to $s$ +and set the integration constant to $1$, +such that we get zero when $\theta \to 0$ away from the wall: + +$$\begin{aligned} + \frac{L_c^2}{2} \Big( \dv{\theta}{s} \Big)^2 + = 1 - \cos\theta +\end{aligned}$$ + +Isolating this for $\idv{\theta}{s}$ and using a trigonometric identity then yields: + +$$\begin{aligned} + \dv{\theta}{s} + = \frac{1}{L_c} \sqrt{2 (1 - \cos\theta)} + = \frac{1}{L_c} \sqrt{4 \sin^2\!\Big( \frac{\theta}{2} \Big)} + = - \frac{2}{L_c} \sin\!\Big( \frac{\theta}{2} \Big) +\end{aligned}$$ + +We use trigonometric relations on the equations +for $\idv{x}{s}$ and $\idv{y}{s}$ to get $\theta$-derivatives: + +$$\begin{aligned} + \dv{x}{\theta} + &= \dv{x}{s} \dv{s}{\theta} + = \bigg( 1 - 2 \sin^2\!\Big( \frac{\theta}{2} \Big) \bigg) \bigg( \dv{\theta}{s} \bigg)^{-1} + = L_c \sin\!\Big( \frac{\theta}{2} \Big) - \frac{L_c}{2 \sin(\theta/2)} + \\ + \dv{y}{\theta} + &= \dv{y}{s} \dv{s}{\theta} + = \bigg( 2 \sin\!\Big(\frac{\theta}{2}\Big) \cos\!\Big(\frac{\theta}{2}\Big) \bigg) \bigg( \dv{\theta}{s} \bigg)^{-1} + = - L_c \cos\!\Big( \frac{\theta}{2} \Big) +\end{aligned}$$ + +Let $\theta_0 = \phi - \pi/2$ be the initial elevation angle $\theta(0)$ at the wall. +Then, by integrating the above equations, we get the following solutions: + +$$\begin{gathered} + \boxed{ + \frac{x}{L_c} + = 2 \cos\!\Big(\frac{\theta_0}{2}\Big) + \log\!\bigg| \tan\!\Big(\frac{\theta_0}{4}\Big) \bigg| + - 2 \cos\!\Big(\frac{\theta}{2}\Big) + \log\!\bigg| \tan\!\Big(\frac{\theta}{4}\Big) \bigg| + } + \\ + \boxed{ + \frac{y}{L_c} + = - 2 \sin\!\Big(\frac{\theta}{2}\Big) + } +\end{gathered}$$ + +Where the integration constant has been chosen such that $y \to 0$ for $\theta \to 0$ away from the wall, +and $x = 0$ for $\theta = \theta_0$. +This result is consistent with our earlier expression for $d$: + +$$\begin{aligned} + d + = y(\theta_0) + = - 2 L_c \sin\!\Big(\frac{\theta_0}{2}\Big) + = 2 L_c \sin\!\Big( \frac{\pi/2 - \phi}{2} \Big) +\end{aligned}$$ + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/metacentric-height/index.md b/source/know/concept/metacentric-height/index.md new file mode 100644 index 0000000..7588196 --- /dev/null +++ b/source/know/concept/metacentric-height/index.md @@ -0,0 +1,179 @@ +--- +title: "Metacentric height" +date: 2022-03-11 +categories: +- Physics +- Fluid mechanics +layout: "concept" +--- + +Consider an object with center of mass $G$, +floating in a large body of liquid whose surface is flat at $z = 0$. +For our purposes, it is easiest to use a coordinate system +whose origin is at the area centroid +of the object's cross-section through the liquid's surface, namely: + +$$\begin{aligned} + (x_0, y_0) + \equiv \frac{1}{A_{wl}} \iint_{wl} (x, y) \dd{A} +\end{aligned}$$ + +Where $A_{wl}$ is the cross-sectional area +enclosed by the "waterline" around the "boat". +Note that the boat's center of mass $G$ +does not coincide with the origin in general, +as is illustrated in the following sketch +of our choice of coordinate system: + +<a href="sketch.png"> +<img src="sketch.png" style="width:67%"> +</a> + +Here, $B$ is the **center of buoyancy**, equal to +the center of mass of the volume of water displaced by the boat +as per [Archimedes' principle](/know/concept/archimedes-principle/). +At equilibrium, the forces of buoyancy $\vb{F}_B$ and gravity $\vb{F}_G$ +have equal magnitudes in opposite directions, +and $B$ is directly above or below $G$, +or in other words, $x_B = x_G$ and $y_B = y_G$, +which are calculated as follows: + +$$\begin{aligned} + (x_G, y_G, z_G) + &\equiv \frac{1}{V_{boat}} \iiint_{boat} (x, y, z) \dd{V} + \\ + (x_B, y_B, z_B) + &\equiv \frac{1}{V_{disp}} \iiint_{disp} (x, y, z) \dd{V} +\end{aligned}$$ + +Where $V_{boat}$ is the volume of the whole boat, +and $V_{disp}$ is the volume of liquid it displaces. + +Whether a given equilibrium is *stable* is more complicated. +Suppose the ship is tilted by a small angle $\theta$ around the $x$-axis, +in which case the old waterline, previously in the $z = 0$ plane, +gets shifted to a new plane, namely: + +$$\begin{aligned} + z + = \sin(\theta) \: y + \approx \theta y +\end{aligned}$$ + +Then $V_{disp}$ changes by $\Delta V_{disp}$, which is estimated below. +If a point of the old waterline is raised by $z$, +then the displaced liquid underneath it is reduced proportionally, +hence the sign: + +$$\begin{aligned} + \Delta V_{disp} + \approx - \iint_{wl} z \dd{A} + \approx - \theta \iint_{wl} y \dd{A} + = 0 +\end{aligned}$$ + +So $V_{disp}$ is unchanged, at least to first order in $\theta$. +However, the *shape* of the displaced volume may have changed significantly. +Therefore, the shift of the position of the buoyancy center from $B$ to $B'$ +involves a correction $\Delta y_B$ in addition to the rotation by $\theta$: + +$$\begin{aligned} + y_B' + = y_B - \theta z_B + \Delta y_B +\end{aligned}$$ + +We find $\Delta y_B$ by calculating the virtual buoyancy center of the shape difference: +on the side of the boat that has been lifted by the rotation, +the center of buoyancy is "pushed" away due to the reduced displacement there, +and vice versa on the other side. Consequently: + +$$\begin{aligned} + \Delta y_B + = - \frac{1}{V_{disp}} \iint_{wl} y z \dd{A} + \approx - \frac{\theta}{V_{disp}} \iint_{wl} y^2 \dd{A} + = - \frac{\theta I}{V_{disp}} +\end{aligned}$$ + +Where we have defined the so-called **area moment** $I$ of the waterline as follows: + +$$\begin{aligned} + \boxed{ + I + \equiv \iint_{wl} y^2 \dd{A} + } +\end{aligned}$$ + +Now that we have an expression for $\Delta y_B$, +the new center's position $y_B'$ is found to be: + +$$\begin{aligned} + y_B' + = y_B - \theta \Big( z_B + \frac{I}{V_{disp}} \Big) + \approx y_B - \sin(\theta) \: \Big( z_B + \frac{I}{V_{disp}} \Big) +\end{aligned}$$ + +This looks like a rotation by $\theta$ around a so-called **metacenter** $M$, +with a height $z_M$ known as the **metacentric height**, defined as: + +$$\begin{aligned} + \boxed{ + z_M + \equiv z_B + \frac{I}{V_{disp}} + } +\end{aligned}$$ + +Meanwhile, the position of $M$ is defined such that it lies +on the line between the old centers $G$ and $B$. +Our calculation of $y_B'$ has shown that the new $B'$ always lies below $M$. + +After the rotation, the boat is not in equilibrium anymore, +because the new $G'$ is not directly above or below $B'$. +The force of gravity then causes a torque $\vb{T}$ given by: + +$$\begin{aligned} + \vb{T} + = (\vb{r}_G' - \vb{r}_B') \cross m \vb{g} +\end{aligned}$$ + +Where $\vb{g}$ points downwards. +Since the rotation was around the $x$-axis, +we are only interested in the $x$-component $T_x$, which becomes: + +$$\begin{aligned} + T_x + = - (y_G' - y_B') m \mathrm{g} + = - \big((y_G - \theta z_G) - (y_B - \theta z_M)\big) m \mathrm{g} +\end{aligned}$$ + +With $y_G' = y_G - \theta z_G$ being a simple rotation of $G$. +At the initial equilibrium $y_G = y_B$, so: + +$$\begin{aligned} + T_x + = \theta (z_G - z_M) m \mathrm{g} +\end{aligned}$$ + +If $z_M < z_G$, then $T_x$ has the same sign as $\theta$, +so $\vb{T}$ further destabilizes the boat. +But if $z_M > z_G$, then $\vb{T}$ counteracts the rotation, +and the boat returns to the original equilibrium, +leading us to the following stability condition: + +$$\begin{aligned} + \boxed{ + z_M > z_G + } +\end{aligned}$$ + +In other words, for a given boat design (or general shape) +$z_G$ and $z_M$ can be calculated, +and as long as they satisfy the above inequality, +it will float stably in water (or any other fluid, +although the buoyancy depends significantly on the density). + + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/metacentric-height/sketch.png b/source/know/concept/metacentric-height/sketch.png Binary files differnew file mode 100644 index 0000000..1ee1d04 --- /dev/null +++ b/source/know/concept/metacentric-height/sketch.png diff --git a/source/know/concept/microcanonical-ensemble/index.md b/source/know/concept/microcanonical-ensemble/index.md new file mode 100644 index 0000000..8490767 --- /dev/null +++ b/source/know/concept/microcanonical-ensemble/index.md @@ -0,0 +1,120 @@ +--- +title: "Microcanonical ensemble" +date: 2021-07-09 +categories: +- Physics +- Thermodynamics +- Thermodynamic ensembles +layout: "concept" +--- + +The **microcanonical** or **NVE ensemble** is a statistical model +of a theoretical system with constant internal energy $U$, +volume $V$, and particle count $N$. + +Consider a box with those properties. +We now put an imaginary rigid wall inside the box, +thus dividing it into two subsystems $A$ and $B$, +which can exchange energy (i.e. heat), but no particles. +At any time, $A$ has energy $U_A$, and $B$ has $U_B$, +so that in total $U = U_A \!+\! U_B$. + +The particles in each subsystem are in a certain **microstate** (configuration). +For a given $U$, there is a certain number $c$ +of possible whole-box microstates with that energy, given by: + +$$\begin{aligned} + c(U) + = \sum_{U_A \le U} c_A(U_A) \: c_B(U - U_A) +\end{aligned}$$ + +Where $c_A$ and $c_B$ are the numbers of subsystem microstates +at the given energy levels. + +The core assumption of the microcanonical ensemble +is that each of these microstates has the same probability $1 / c$. +Consequently, the probability of finding an energy $U_A$ in $A$ is: + +$$\begin{aligned} + p_A(U_A) + = \frac{c_A(U_A) \: c_B(U - U_A)}{c(U)} +\end{aligned}$$ + +If a certain $U_A$ has a higher probability, +then there are more $A$-microstates with that energy, +so, statistically, for an *ensemble* of many boxes, +we expect that $U_A$ is more common. + +The maximum of $p_A$ will be the most common in the ensemble. +Assuming that we have given the boxes enough time to settle, +we go one step further, +and refer to this maximum as "equilibrium". +In other words, the subsystem microstates at equilibrium +are maxima of $p_A$ and $p_B$. + +We only need to look at $p_A$. +Clearly, a maximum of $p_A$ is also a maximum of $\ln p_A$: + +$$\begin{aligned} + \ln p_A(U_A) + = \ln{c_A(U_A)} + \ln{c_B(U - U_A)} - \ln{c(U)} +\end{aligned}$$ + +Here, in the quantity $\ln{c_A}$, +we recognize the definition of +the entropy $S_A \equiv k \ln{c_A}$, +where $k$ is Boltzmann's constant. +We thus multiply by $k$: + +$$\begin{aligned} + k \ln p_A(U_A) + = S_A(U_A) + S_B(U - U_A) - k \ln{c(U)} +\end{aligned}$$ + +Since entropy is additive over subsystems, +the total is $S = S_A + S_B$. +To reach equilibrium, we are thus +**maximizing the total entropy**, +meaning that $S$ is the [thermodynamic potential](/know/concept/thermodynamic-potential/) +that corresponds to the microcanonical ensemble. + +For our example, maximizing gives the following, +more concrete, equilibrium condition: + +$$\begin{aligned} + 0 + = k \dv{(\ln{p_A})}{U_A} + = \pdv{S_A}{U_A} + \pdv{S_B}{U_A} + = \pdv{S_A}{U_A} - \pdv{S_B}{U_B} +\end{aligned}$$ + +By definition, the energy-derivative of the entropy +is the reciprocal temperature $1 / T$. +In other words, +equilibrium is reached when both subsystems +are at the same temperature: + +$$\begin{aligned} + \frac{1}{T_A} + = \pdv{S_A}{U_A} + = \pdv{S_B}{U_B} + = \frac{1}{T_B} +\end{aligned}$$ + +Recall that our partitioning into $A$ and $B$ was arbitrary, +meaning that, in fact, the temperature $T$ must be uniform in the whole box. +We get this specific result because +heat was the only thing that $A$ and $B$ could exchange. + +The point is that the most likely state of the box +maximizes the total entropy $S$. +We also would have reached that conclusion +if our imaginary wall was permeable and flexible, +i.e if it allowed changes in volume $V_A$ and particle count $N_A$. + + + +## References +1. H. Gould, J. Tobochnik, + *Statistical and thermal physics*, 2nd edition, + Princeton. diff --git a/source/know/concept/modulational-instability/index.md b/source/know/concept/modulational-instability/index.md new file mode 100644 index 0000000..255a385 --- /dev/null +++ b/source/know/concept/modulational-instability/index.md @@ -0,0 +1,202 @@ +--- +title: "Modulational instability" +date: 2021-02-26 +categories: +- Physics +- Fiber optics +- Optics +- Perturbation +- Nonlinear optics +layout: "concept" +--- + +In fiber optics, **modulational instability** (MI) +is a nonlinear effect that leads to the exponential amplification +of background noise in certain frequency regions. +It only occurs in the [anomalous dispersion regime](/know/concept/dispersive-broadening/) +($\beta_2 < 0$), which we will prove shortly. + +Consider the following simple solution to the nonlinear Schrödinger equation: +a time-invariant constant power $P_0$ at the carrier frequency $\omega_0$, +which is experiencing [self-phase modulation](/know/concept/self-phase-modulation/): + +$$\begin{aligned} + A(z,t) = \sqrt{P_0} \exp( i \gamma P_0 z) +\end{aligned}$$ + +We add a small perturbation $\varepsilon(z,t)$ to this signal, +representing background noise: + +$$\begin{aligned} + A(z,t) = \big(\sqrt{P_0} + \varepsilon(z,t)\big) \exp( i \gamma P_0 z) +\end{aligned}$$ + +We insert this into the nonlinear Schrödinger equation to get a perturbation equation, +which we linearize by assuming that $|\varepsilon|^2$ is negligible compared to $P_0$, +such that all higher-order terms of $\varepsilon$ can be dropped, yielding: + +$$\begin{aligned} + 0 + &= - P_0 \sqrt{P_0} \gamma - P_0 \gamma \varepsilon + i \pdv{\varepsilon}{z} + - \frac{\beta_2}{2} \pdvn{2}{\varepsilon}{t} + + \gamma \big(\sqrt{P_0} + \varepsilon\big)^2 \big(\sqrt{P_0} + \varepsilon\big)^* + \\ + &= i \pdv{\varepsilon}{z} + - \frac{\beta_2}{2} \pdvn{2}{\varepsilon}{t} + + \gamma \big( P_0 (\varepsilon + \varepsilon^*) + \sqrt{P_0} |\varepsilon|^2 + + \sqrt{P_0} \varepsilon (\varepsilon + \varepsilon^*) + \varepsilon |\varepsilon|^2 \big) + \\ + &= i \pdv{\varepsilon}{z} - \frac{\beta_2}{2} \pdvn{2}{\varepsilon}{t} + \gamma P_0 (\varepsilon + \varepsilon^*) +\end{aligned}$$ + +We split the perturbation into real and imaginary parts +$\varepsilon(z,t) = \varepsilon_r(z,t) + i \varepsilon_i(z,t)$, +which we fill in in this equation. +The point is that $\varepsilon_r$ and $\varepsilon_i$ are real functions: + +$$\begin{aligned} + 0 + &= i \pdv{\varepsilon_r}{z} - \pdv{\varepsilon_i}{z} + - \frac{\beta_2}{2} \pdvn{2}{\varepsilon_r}{t} - i \frac{\beta_2}{2} \pdvn{2}{\varepsilon_i}{t} + + 2 \gamma P_0 \varepsilon_r +\end{aligned}$$ + +Splitting this into its real and imaginary parts gives two PDEs +relating $\varepsilon_r$ and $\varepsilon_i$: + +$$\begin{aligned} + \pdv{\varepsilon_r}{z} = \frac{\beta_2}{2} \pdvn{2}{\varepsilon_i}{t} + \qquad \quad + \pdv{\varepsilon_i}{z} = - \frac{\beta_2}{2} \pdvn{2}{\varepsilon_r}{t} + 2 \gamma P_0 \varepsilon_r +\end{aligned}$$ + +We [Fourier transform](/know/concept/fourier-transform/) +these in $t$ to turn them into ODEs relating +$\tilde{\varepsilon}_r(z,\omega)$ and $\tilde{\varepsilon}_i(z,\omega)$: + +$$\begin{aligned} + \pdv{\tilde{\varepsilon}_r}{z} = - \frac{\beta_2}{2} \omega^2 \tilde{\varepsilon}_i + \qquad \quad + \pdv{\tilde{\varepsilon}_i}{z} = \Big(\frac{\beta_2}{2} \omega^2 + 2 \gamma P_0 \Big) \tilde{\varepsilon}_r +\end{aligned}$$ + +We are interested in exponential growth, so let us make the following ansatz, +where $k$ may be a function of $\omega$, as long as it is $z$-invariant: + +$$\begin{aligned} + \tilde{\varepsilon}_r(z, \omega) = \tilde{\varepsilon}_r(0, \omega) \exp(k z) + \qquad \quad + \tilde{\varepsilon}_i(z, \omega) = \tilde{\varepsilon}_i(0, \omega) \exp(k z) +\end{aligned}$$ + +With this, we can write the system of ODEs for +$\tilde{\varepsilon}_r(z,\omega)$ and $\tilde{\varepsilon}_i(z,\omega)$ +in matrix form: + +$$\begin{aligned} + \begin{bmatrix} + k & \beta_2 \omega^2 / 2 \\ + \beta_2 \omega^2 / 2 \!+\! 2 \gamma P_0 & - k + \end{bmatrix} + \cdot + \begin{bmatrix} \tilde{\varepsilon}_r(0, \omega) \\ \tilde{\varepsilon}_i(0, \omega) \end{bmatrix} + = + \begin{bmatrix} 0 \\ 0 \end{bmatrix} +\end{aligned}$$ + +This has non-zero solutions if the system matrix' determinant is zero, +which is true when: + +$$\begin{aligned} + k = \pm \sqrt{ - \frac{\beta_2}{2} \omega^2 \Big( \frac{\beta_2}{2} \omega^2 + 2 \gamma P_0 \Big) } +\end{aligned}$$ + +To get exponential growth, it is essential that $\mathrm{Re}\{k\} > 0$, +so we discard the negative sign, +and get the following condition for MI: + +$$\begin{aligned} + - \frac{\beta_2}{2} \omega^2 \Big( \frac{\beta_2}{2} \omega^2 + 2 \gamma P_0 \Big) > 0 + \quad \implies \quad + \boxed{ + \omega^2 < -\frac{4 \gamma P_0}{\beta_2} + } +\end{aligned}$$ + +Since $\omega^2$ is positive, $\beta_2$ must be negative, +so MI can only occur in the ADR. +It is worth noting that $\beta_2 = \beta_2(\omega_0)$, +meaning there can only be exponential +noise growth when the "parent pulse" is in the anomalous dispersion regime, +but that growth may appear in areas of normal dispersion, +as long as the above condition is satisfied by the parent. + +This result has been derived using perturbation, +so only holds as long as $|\varepsilon|^2 \ll P_0$. +Over time, the noise gets amplified so greatly +that this approximation breaks down. + +Next, we define the **gain** $g(\omega)$, +which expresses how quickly the +perturbation grows as a function of the frequency offset $\omega$: + +$$\begin{aligned} + \boxed{ + g(\omega) + = \mathrm{Re}\{k\} + = \mathrm{Re} \bigg\{ \sqrt{ - \frac{\beta_2}{2} \omega^2 \Big( \frac{\beta_2}{2} \omega^2 + 2 \gamma P_0 \Big) } \bigg\} + } +\end{aligned}$$ + +The frequencies with maximum gain are then found as extrema of $g(\omega)$, +which satisfy: + +$$\begin{aligned} + g'(\omega_\mathrm{max}) = 0 + \qquad \implies \qquad + \boxed{ + \omega_\mathrm{max} = \pm \sqrt{\frac{2 \gamma P_0}{-\beta_2}} + } +\end{aligned}$$ + +A simulation of MI is illustrated below. +The pulse considered was a solition of the following form +with settings $T_0 = 10\:\mathrm{ps}$, $P_0 = 10\:\mathrm{kW}$, +$\beta = -10\:\mathrm{ps}^2/\mathrm{m}$ and $\gamma = 0.1/\mathrm{W}/\mathrm{m}$, +whose peak is approximately flat, so our derivation is valid there, +hence it "wrinkles" in the $t$-domain: + +$$\begin{aligned} + A(0, t) + = \sqrt{P_0} \sech\!\Big(\frac{t}{T_0}\Big) +\end{aligned}$$ + +<a href="pheno-mi.jpg"> +<img src="pheno-mi-small.jpg" style="width:100%"> +</a> + +Where $L_\mathrm{NL} = 1/(\gamma P_0)$ is the characteristic length of nonlinear effects. +Note that no noise was added to the simulation; +what you are seeing are pure numerical errors getting amplified. + +If one of the gain peaks accumulates a lot of energy quickly ($L_\mathrm{NL}$ is small), +and that peak is in the anomalous dispersion regime, +then it can in turn also cause MI in its own surroundings, +leading to a cascade of secondary and tertiary gain areas. +This is seen above for $z > 30 L_\mathrm{NL}$. + +What we described is "pure" MI, but there also exists +a different type caused by Raman scattering. +In that case, amplification occurs at the strongest peak of the Raman gain $\tilde{g}_R(\omega)$, +even when the parent pulse is in the NDR. +This is an example of stimulated Raman scattering (SRS). + + + +## References +1. O. Bang, + *Numerical methods in photonics: lecture notes*, 2019, + unpublished. +2. O. Bang, + *Nonlinear mathematical physics: lecture notes*, 2020, + unpublished. diff --git a/source/know/concept/modulational-instability/pheno-mi-small.jpg b/source/know/concept/modulational-instability/pheno-mi-small.jpg Binary files differnew file mode 100644 index 0000000..995ec81 --- /dev/null +++ b/source/know/concept/modulational-instability/pheno-mi-small.jpg diff --git a/source/know/concept/modulational-instability/pheno-mi.jpg b/source/know/concept/modulational-instability/pheno-mi.jpg Binary files differnew file mode 100644 index 0000000..e45f074 --- /dev/null +++ b/source/know/concept/modulational-instability/pheno-mi.jpg diff --git a/source/know/concept/multi-photon-absorption/index.md b/source/know/concept/multi-photon-absorption/index.md new file mode 100644 index 0000000..d5ed2d3 --- /dev/null +++ b/source/know/concept/multi-photon-absorption/index.md @@ -0,0 +1,353 @@ +--- +title: "Multi-photon absorption" +date: 2022-01-30 +categories: +- Physics +- Optics +- Quantum mechanics +- Nonlinear optics +- Perturbation +layout: "concept" +--- + +Consider a quantum system where there are many eigenstates $\Ket{n}$, +e.g. atomic orbitals, for an electron to occupy. +Suppose an [electromagnetic wave](/know/concept/electromagnetic-wave-equation/) +passes by, such that its Hamiltonian gets perturbed by $\hat{H}_1$, given in the +[electric dipole approximation](/know/concept/electric-dipole-approximation/) by: + +$$\begin{aligned} + \hat{H}_1(t) + = -\vu{p} \cdot \vb{E} \cos(\omega t) + \approx -\vu{p} \cdot \vb{E} e^{-i \omega t} +\end{aligned}$$ + +Where $\vb{E}$ is the [electric field](/know/concept/electric-field/) amplitude, +and $\vu{p} \equiv q \vu{x}$ is the transition dipole moment operator. +Here, we have made the +[rotating wave approximation](/know/concept/rotating-wave-approximation/) +to neglect the $e^{i \omega t}$ term, +because it turns out to be irrelevant in this discussion. + + +We call the ground state $\Ket{0}$, +but other than that, the other states need *not* be sorted by energy. +However, we demand that the following holds +for all even-numbered states $\Ket{e}$ and $\Ket{e'}$, +and for all odd-numbered ($u$neven) states $\Ket{u}$ and $\Ket{u'}$: + +$$\begin{aligned} + \matrixel{e}{\hat{H}_1}{e'} = \matrixel{u}{\hat{H}_1}{u'} = 0 + \qquad \quad + \matrixel{e}{\hat{H}_1}{u} \neq 0 +\end{aligned}$$ + +This is justified for atomic orbitals thanks to +[Laporte's selection rule](/know/concept/selection-rules/). +Therefore, [time-dependent perturbation theory](/know/concept/time-dependent-perturbation-theory/) +says that the $N$th-order coefficient corrections are: + +$$\begin{aligned} + c_e^{(N)}(t) + &= -\frac{i}{\hbar} \sum_{u}^{\mathrm{odd}} \int_0^t \matrixel{e}{\hat{H}_1(\tau)}{u} \: c_u^{(N-1)}(\tau) \: e^{i \omega_{eu} \tau} \dd{\tau} + \\ + c_u^{(N)}(t) + &= -\frac{i}{\hbar} \sum_{e}^{\mathrm{even}} \int_0^t \matrixel{u}{\hat{H}_1(\tau)}{e} \: c_e^{(N-1)}(\tau) \: e^{i \omega_{ue} \tau} \dd{\tau} +\end{aligned}$$ + +Where $\omega_{eu} = (E_e \!-\! E_u) / \hbar$. +For simplicity, the electron starts in the lowest-energy state $\Ket{0}$: + +$$\begin{aligned} + c_0^{(0)} = 1 + \qquad \qquad + c_u^{(0)} = c_{e \neq 0}^{(0)} = 0 +\end{aligned}$$ + +Finally, we prove the following useful relation for large $t$, +involving a [Dirac delta function](/know/concept/dirac-delta-function/) $\delta$: + +$$\begin{aligned} + \lim_{t \to \infty} \bigg| \frac{e^{i x t} - 1}{x} \bigg|^2 + = 2 \pi \: \delta(x) \: t +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-sinc"/> +<label for="proof-sinc">Proof</label> +<div class="hidden"> +<label for="proof-sinc">Proof.</label> +First, observe that we can rewrite the fraction using an integral: + +$$\begin{aligned} + \frac{e^{i x t} - 1}{x} + = e^{i x t / 2} \frac{e^{i x t / 2} - e^{-i x t / 2}}{x} + = i e^{i x t / 2} \int_{-t/2}^{t/2} e^{i x \tau} \dd{\tau} +\end{aligned}$$ + +By taking the limit $t \to \infty$, +it can be turned into a nascent Dirac delta function: + +$$\begin{aligned} + \lim_{t \to \infty} \frac{e^{i x t} - 1}{x} + = \lim_{t \to \infty} i e^{i x t / 2} \frac{2 \pi}{2 \pi} \int_{-\infty}^{\infty} e^{i x \tau} \dd{\tau} + = \lim_{t \to \infty} i 2 \pi e^{i x t / 2} \: \delta(x) +\end{aligned}$$ + +Consequently, the absolute value squared is as follows: + +$$\begin{aligned} + \lim_{t \to \infty} \bigg| \frac{e^{i x t} - 1}{x} \bigg|^2 + = 4 \pi^2 \delta^2(x) +\end{aligned}$$ + +However, a squared delta function $\delta^2$ is not ideal, +so we take a step back: + +$$\begin{aligned} + \delta^2(x) + = \delta(x) \lim_{t \to \infty} \frac{1}{2 \pi} \int_{-t/2}^{t/2} e^{i x \tau} \dd{\tau} + = \delta(x) \lim_{t \to \infty} \frac{t}{2 \pi} +\end{aligned}$$ + +Where we have set $x = 0$ according to the first delta function. +This gives the target: + +$$\begin{aligned} + \lim_{t \to \infty} \bigg| \frac{e^{i x t} - 1}{x} \bigg|^2 + = 4 \pi^2 \delta^2(x) + = 2 \pi \: \delta(x) \: t +\end{aligned}$$ +</div> +</div> + + +## One-photon absorption + +To warm up, we start at first-order perturbation theory. +Thanks to our choice of initial condition, +nothing at all happens to any of the even-numbered states $\Ket{e}$: + +$$\begin{aligned} + c_e^{(1)}(t) + &= -\frac{i}{\hbar} \sum_{u}^{\mathrm{odd}} \int_0^t \matrixel{e}{\hat{H}_1(\tau)}{u} \: c_u^{(0)} \: e^{i \omega_{eu} \tau} \dd{\tau} + = 0 +\end{aligned}$$ + +While the odd-numbered states $\Ket{u}$ have a nonzero correction $c_u^{(1)}$, +where $\vb{p}_{u0} = \matrixel{u}{\vu{p}}{0}$: + +$$\begin{aligned} + c_u^{(1)}(t) + &= -\frac{i}{\hbar} \int_0^t \matrixel{u}{\hat{H}_1(\tau)}{0} \: c_0^{(0)} \: e^{i \omega_{u0} \tau} \dd{\tau} + \\ + &= i \frac{\vb{p}_{u0} \cdot \vb{E}}{\hbar} \int_0^t e^{i (\omega_{u0} - \omega) \tau} \dd{\tau} + \\ + &= i \frac{\vb{p}_{u0} \cdot \vb{E}}{\hbar} \bigg[ \frac{e^{i (\omega_{u0} - \omega) \tau}}{i (\omega_{u0} - \omega)} \bigg]_0^t +\end{aligned}$$ + +Consequently, the first-order correction +(in the rotating wave approximation) is given by: + +$$\begin{aligned} + \boxed{ + c_u^{(1)}(t) + \approx \frac{\vb{p}_{u0} \cdot \vb{E}}{\hbar} \frac{e^{i (\omega_{u0} - \omega) t} - 1}{\omega_{u0} - \omega} + } +\end{aligned}$$ + +Since $\big| c_u^{(1)}(t) \big|^2$ is the probability +of finding the electron in $\Ket{u}$, +its transition rate $R_u^{(1)}(t)$ is as follows, +averaged since the beginning $t = 0$: + +$$\begin{aligned} + R_u^{(1)}(t) + = \frac{\big| c_u^{(1)}(t) \big|^2}{t} + = \frac{1}{t} \bigg| \frac{\vb{p}_{u0} \cdot \vb{E}}{\hbar} \bigg|^2 + \cdot \bigg| \frac{e^{i (\omega_{u0} - \omega) t} - 1}{\omega_{u0} - \omega} \bigg|^2 +\end{aligned}$$ + +For large $t \to \infty$, we can use the formula we proved earlier +to get [Fermi's golden rule](/know/concept/fermis-golden-rule/): + +$$\begin{aligned} + \boxed{ + R_u^{(1)} + = 2 \pi \bigg| \frac{\vb{p}_{u0} \cdot \vb{E}}{\hbar} \bigg|^2 \delta(\omega_{u0} - \omega) + } +\end{aligned}$$ + +This well-known formula represents **one-photon absorption**: +it peaks at $\omega_{u0} = \omega$, i.e. when one photon $\hbar \omega$ +has the exact energy of the transition $\hbar \omega_{u0}$. +Note that this transition is only possible when $\matrixel{u}{\vu{p}}{0} \neq 0$, +i.e. for any odd-numbered final state $\Ket{u}$. + + +## Two-photon absorption + +Next, we go to second-order perturbation theory. +Based on the previous result, this time +all odd-numbered states $\Ket{u}$ are unaffected: + +$$\begin{aligned} + c_u^{(2)}(t) + &= -\frac{i}{\hbar} \sum_{e}^{\mathrm{even}} \int_0^t \matrixel{u}{\hat{H}_1(\tau)}{e} \: c_e^{(1)}(\tau) \: e^{i \omega_{ue} \tau} \dd{\tau} + = 0 +\end{aligned}$$ + +While the even-numbered states $\Ket{e}$ have the following correction, +using $\omega_{eu} \!+\! \omega_{u0} = \omega_{e0}$: + +$$\begin{aligned} + c_e^{(2)}(t) + &= -\frac{i}{\hbar} \sum_{u}^{\mathrm{odd}} \int_0^t \matrixel{e}{\hat{H}_1(\tau)}{u} \: c_u^{(1)}(\tau) \: e^{i \omega_{eu} \tau} \dd{\tau} + \\ + &= i \sum_{u}^{\mathrm{odd}} \frac{(\vb{p}_{eu} \cdot \vb{E}) (\vb{p}_{u0} \cdot \vb{E})}{\hbar^2 (\omega_{u0} - \omega)} + \int_0^t e^{i (\omega_{eu} + \omega_{u0} - 2 \omega) \tau} - e^{i (\omega_{eu} - \omega) \tau} \dd{\tau} + \\ + &= i \sum_{u}^{\mathrm{odd}} \frac{(\vb{p}_{eu} \cdot \vb{E}) (\vb{p}_{u0} \cdot \vb{E})}{\hbar^2 (\omega_{u0} - \omega)} + \bigg[ \frac{e^{i (\omega_{e0} - 2 \omega) \tau}}{i (\omega_{e0} - 2 \omega)} + - \frac{e^{i (\omega_{eu} - \omega) \tau}}{i (\omega_{eu} - \omega)} \bigg]_0^t +\end{aligned}$$ + +The second term represents one-photon absorption between $\Ket{u}$ and $\Ket{e}$. +We do not care about that, so we drop it, leaving only the first term: + +$$\begin{aligned} + \boxed{ + c_e^{(2)}(t) + \approx \sum_{u}^{\mathrm{odd}} \frac{(\vb{p}_{eu} \cdot \vb{E}) (\vb{p}_{u0} \cdot \vb{E})}{\hbar^2 (\omega_{u0} - \omega)} + \frac{e^{i (\omega_{e0} - 2 \omega) t} - 1}{\omega_{e0} - 2 \omega} + } +\end{aligned}$$ + +As before, we can define a rate $R_e^{(2)}(t)$ +for all transitions represented by this term: + +$$\begin{aligned} + R_e^{(2)}(t) + = \frac{\big| c_e^{(2)}(t) \big|^2}{t} + = \frac{1}{t} \bigg| \sum_{u}^{\mathrm{odd}} \frac{(\vb{p}_{eu} \cdot \vb{E}) (\vb{p}_{u0} \cdot \vb{E})}{\hbar^2 (\omega_{u0} - \omega)} \bigg|^2 + \cdot \bigg| \frac{e^{i (\omega_{e0} - 2 \omega) t} - 1}{\omega_{e0} - 2 \omega} \bigg|^2 +\end{aligned}$$ + +Which for $t \to \infty$ takes a similar form to Fermi's golden rule, +using the formula we proved: + +$$\begin{aligned} + \boxed{ + R_e^{(2)} + = 2 \pi \bigg| \sum_{u}^{\mathrm{odd}} \frac{(\vb{p}_{eu} \cdot \vb{E}) (\vb{p}_{u0} \cdot \vb{E})}{\hbar^2 (\omega_{u0} - \omega)} \bigg|^2 + \delta(\omega_{e0} - 2 \omega) + } +\end{aligned}$$ + +This represents **two-photon absorption**, since it peaks at $\omega_{e0} = 2 \omega$: +two identical photons $\hbar \omega$ are absorbed simultaneously +to bridge the energy gap $\hbar \omega_{e0}$. +Surprisingly, such a transition can only occur when $\matrixel{e}{\vu{p}}{0} = 0$, +i.e. for any even-numbered final state $\Ket{e}$. +Notice that the rate is proportional to $|\vb{E}|^4$, +so this effect is only noticeable at high light intensities. + + +## Three-photon absorption + +For third-order perturbation theory, +all even-numbered states $\Ket{e}$ are unchanged: + +$$\begin{aligned} + c_e^{(3)}(t) + &= -\frac{i}{\hbar} \sum_{u}^{\mathrm{odd}} \int_0^t \matrixel{e}{\hat{H}_1(\tau)}{u} \: c_u^{(2)}(\tau) \: e^{i \omega_{eu} \tau} \dd{\tau} + = 0 +\end{aligned}$$ + +And the odd-numbered states $\Ket{u}$ get the following third-order corrections: + +$$\begin{aligned} + c_u^{(3)}(t) + &= -\frac{i}{\hbar} \sum_{e}^{\mathrm{even}} \int_0^t \matrixel{u}{\hat{H}_1(\tau)}{e} \: c_e^{(2)}(\tau) \: e^{i \omega_{ue} \tau} \dd{\tau} + \\ + &= i \sum_{e}^{\mathrm{even}} \sum_{u'}^{\mathrm{odd}} + \frac{(\vb{p}_{ue} \cdot \vb{E}) (\vb{p}_{eu'} \cdot \vb{E}) (\vb{p}_{u'0} \cdot \vb{E})}{\hbar^3 (\omega_{u'0} - \omega) (\omega_{e0} - 2 \omega)} + \int_0^t e^{i (\omega_{ue} + \omega_{e0} - 3 \omega) \tau} - e^{i (\omega_{ue} - \omega) \tau} \dd{\tau} + \\ + &= i \sum_{e}^{\mathrm{even}} \sum_{u'}^{\mathrm{odd}} + \frac{(\vb{p}_{ue} \cdot \vb{E}) (\vb{p}_{eu'} \cdot \vb{E}) (\vb{p}_{u'0} \cdot \vb{E})}{\hbar^3 (\omega_{u'0} - \omega) (\omega_{e0} - 2 \omega)} + \bigg[ \frac{e^{i (\omega_{u0} - 3 \omega) \tau}}{i (\omega_{u0} - 3 \omega)} + - \frac{e^{i (\omega_{ue} - \omega) \tau}}{i (\omega_{ue} - \omega)} \bigg]_0^t +\end{aligned}$$ + +Once again, the second term is uninteresting, +so we drop it and look at the first term only: + +$$\begin{aligned} + \boxed{ + c_u^{(3)}(t) + \approx \sum_{e}^{\mathrm{even}} \sum_{u'}^{\mathrm{odd}} + \frac{(\vb{p}_{ue} \cdot \vb{E}) (\vb{p}_{eu'} \cdot \vb{E}) (\vb{p}_{u'0} \cdot \vb{E})} + {\hbar^3 (\omega_{u'0} - \omega) (\omega_{e0} - 2 \omega)} + \frac{e^{i (\omega_{u0} - 3 \omega) t} - 1}{\omega_{u0} - 3 \omega} + } +\end{aligned}$$ + +The resulting transition rate $R_u^{(3)}(t)$ +is found to have the following familiar form: + +$$\begin{aligned} + R_u^{(3)}(t) + = \frac{\big| c_u^{(3)}(t) \big|^2}{t} + = \frac{1}{t} \bigg| \sum_{e}^{\mathrm{even}} \sum_{u'}^{\mathrm{odd}} + \frac{(\vb{p}_{ue} \cdot \vb{E}) (\vb{p}_{eu'} \cdot \vb{E}) (\vb{p}_{u'0} \cdot \vb{E})} + {\hbar^3 (\omega_{u'0} - \omega) (\omega_{e0} - 2 \omega)} \bigg|^2 + \cdot \bigg| \frac{e^{i (\omega_{u0} - 3 \omega) t} - 1}{\omega_{u0} - 3 \omega} \bigg|^2 +\end{aligned}$$ + +Applying our formula to this yields the following analogue of Fermi's golden rule: + +$$\begin{aligned} + \boxed{ + R_u^{(3)} + = 2 \pi \bigg| \sum_{e}^{\mathrm{even}} \sum_{u'}^{\mathrm{odd}} + \frac{(\vb{p}_{ue} \cdot \vb{E}) (\vb{p}_{eu'} \cdot \vb{E}) (\vb{p}_{u'0} \cdot \vb{E})} + {\hbar^3 (\omega_{u'0} - \omega) (\omega_{e0} - 2 \omega)} \bigg|^2 \delta(\omega_{u0} - 3 \omega) + } +\end{aligned}$$ + +This represents **three-photon absorption**, since it peaks at $\omega_{u0} = 3 \omega$: +three identical photons $\hbar \omega$ are absorbed simultaneously +to bridge the energy gap $\hbar \omega_{u0}$. +This process is similar to one-photon absorption, +in the sense that it can only occur if $\matrixel{u}{\vu{p}}{0} \neq 0$. +The rate is proportional to $|\vb{E}|^6$, +so this effect only appears at extremely high light intensities. + + +## N-photon absorption + +A pattern has appeared in these calculations: +in $N$th-order perturbation theory, +we get a term representing $N$-photon absorption, +with a transition rate proportional to $|\vb{E}|^{2N}$. +Indeed, we can derive infinitely many formulas in this way, +although the results become increasingly unrealistic +due to the dependence on $\vb{E}$. + +If $N$ is odd, only odd-numbered destinations $\Ket{u}$ are allowed +(assuming the electron starts in the ground state $\Ket{0}$), +and if $N$ is even, only even-numbered destinations $\Ket{e}$. +Note that nothing has been said about the energies of these states +(other than $\Ket{0}$ being the minimum); +everything is determined by the matrix elements $\matrixel{f}{\vu{p}}{i}$. + + + +## References +1. R.W. Boyd, + *Nonlinear optics*, 4th edition, + Academic Press. +2. R. Shankar, + *Principles of quantum mechanics*, 2nd edition, + Springer. diff --git a/source/know/concept/navier-cauchy-equation/index.md b/source/know/concept/navier-cauchy-equation/index.md new file mode 100644 index 0000000..b9db548 --- /dev/null +++ b/source/know/concept/navier-cauchy-equation/index.md @@ -0,0 +1,108 @@ +--- +title: "Navier-Cauchy equation" +date: 2021-04-02 +categories: +- Physics +- Continuum physics +layout: "concept" +--- + +The **Navier-Cauchy equation** describes **elastodynamics**: +the movements inside an elastic solid +in response to external forces and/or internal stresses. + +For a particle of the solid, whose position is given by the displacement field $\va{u}$, +Newton's second law is as follows, +where $\dd{m}$ and $\dd{V}$ are the particle's mass and volume, respectively: + +$$\begin{aligned} + \va{f^*} \dd{V} + = \pdvn{2}{\va{u}}{t} \dd{m} + = \rho \pdvn{2}{\va{u}}{t} \dd{V} +\end{aligned}$$ + +Where $\rho$ is the mass density, +and $\va{f^*}$ is the effective force density, +defined from the [Cauchy stress tensor](/know/concept/cauchy-stress-tensor/) $\hat{\sigma}$ +like so, with $\va{f}$ being an external body force, e.g. from gravity: + +$$\begin{aligned} + \va{f^*} + = \va{f} + \nabla \cdot \hat{\sigma}^\top +\end{aligned}$$ + +We can therefore write Newton's second law as follows, +while switching to index notation, +where $\nabla_j = \ipdv{}{x_j}$ is the partial derivative +with respect to the $j$th coordinate: + +$$\begin{aligned} + f_i + \sum_{j} \nabla_j \sigma_{ij} + = \rho \pdvn{2}{u_i}{t} +\end{aligned}$$ + +The components $\sigma_{ij}$ of the Cauchy stress tensor +are given by [Hooke's law](/know/concept/hookes-law/), +where $\mu$ and $\lambda$ are the Lamé coefficients, +which describe the material: + +$$\begin{aligned} + \sigma_{ij} + = 2 \mu u_{ij} + \lambda \delta_{ij} \sum_{k} u_{kk} +\end{aligned}$$ + +In turn, the components $u_{ij}$ of the +[Cauchy strain tensor](/know/concept/cauchy-strain-tensor/) +are defined as follows, +where $u_i$ are once again the components of the displacement vector $\va{u}$: + +$$\begin{aligned} + u_{ij} + = \frac{1}{2} \big( \nabla_i u_j + \nabla_j u_i \big) +\end{aligned}$$ + +To derive the Navier-Cauchy equation, +we start by inserting Hooke's law into Newton's law: + +$$\begin{aligned} + \rho \pdvn{2}{u_i}{t} + &= f_i + 2 \mu \sum_{j} \nabla_j u_{ij} + \lambda \sum_{j} \nabla_j \bigg( \delta_{ij} \sum_{k} u_{kk} \bigg) + \\ + &= f_i + 2 \mu \sum_{j} \nabla_j u_{ij} + \lambda \nabla_i \sum_{j} u_{jj} +\end{aligned}$$ + +And then into this we insert the definition of the strain components $u_{ij}$, yielding: + +$$\begin{aligned} + \rho \pdvn{2}{u_i}{t} + &= f_i + \mu \sum_{j} \nabla_j \big( \nabla_i u_j + \nabla_j u_i \big) + \lambda \nabla_i \sum_{j} \nabla_j u_{j} +\end{aligned}$$ + +Rearranging this a bit leads us to the Navier-Cauchy equation written in index notation: + +$$\begin{aligned} + \boxed{ + \rho \pdvn{2}{u_i}{t} + = f_i + \mu \sum_{j} \nabla_j^2 u_i + (\mu + \lambda) \nabla_i \sum_{j} \nabla_j u_j + } +\end{aligned}$$ + +Traditionally, it is written in vector notation instead, +in which case it looks like this: + +$$\begin{aligned} + \boxed{ + \rho \pdvn{2}{\va{u}}{t} + = \va{f} + \mu \nabla^2 \va{u} + (\mu + \lambda) \nabla (\nabla \cdot \va{u}) + } +\end{aligned}$$ + +A special case is the **Navier-Cauchy equilibrium equation**, +where the left-hand side is just zero. +That version describes **elastostatics**: the deformation of a solid at rest. + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/navier-stokes-equations/index.md b/source/know/concept/navier-stokes-equations/index.md new file mode 100644 index 0000000..cdffebf --- /dev/null +++ b/source/know/concept/navier-stokes-equations/index.md @@ -0,0 +1,128 @@ +--- +title: "Navier-Stokes equations" +date: 2021-04-12 +categories: +- Physics +- Fluid mechanics +- Fluid dynamics +layout: "concept" +--- + +While the [Euler equations](/know/concept/euler-equations/) govern *ideal* "dry" fluids, +the **Navier-Stokes equations** govern *nonideal* "wet" fluids, +i.e. fluids with nonzero [viscosity](/know/concept/viscosity/). + + +## Incompressible fluid + +First of all, we can reuse the incompressibility condition for ideal fluids, without modifications: + +$$\begin{aligned} + \boxed{ + \nabla \cdot \va{v} = 0 + } +\end{aligned}$$ + +Furthermore, from the derivation of the Euler equations, +we know that Newton's second law can be written as follows, +for an infinitesimal particle of the fluid: + +$$\begin{aligned} + \rho \frac{\mathrm{D} \va{v}}{\mathrm{D} t} + = \va{f^*} +\end{aligned}$$ + +$\mathrm{D}/\mathrm{D}t$ is the [material derivative](/know/concept/material-derivative/), +$\rho$ is the density, and $\va{f^*}$ is the effective force density, +expressed in terms of an external body force $\va{f}$ (e.g. gravity) +and the [Cauchy stress tensor](/know/concept/cauchy-stress-tensor/) $\hat{\sigma}$: + +$$\begin{aligned} + \va{f^*} + = \va{f} + \nabla \cdot \hat{\sigma}^\top +\end{aligned}$$ + +From the definition of viscosity, +the stress tensor's elements are like so for a Newtonian fluid: + +$$\begin{aligned} + \sigma_{ij} + = - p \delta_{ij} + \eta (\nabla_i v_j + \nabla_j v_i) +\end{aligned}$$ + +Where $\eta$ is the dynamic viscosity. +Inserting this, we calculate $\nabla \cdot \hat{\sigma}^\top$ in index notation: + +$$\begin{aligned} + \big( \nabla \cdot \hat{\sigma}^\top \big)_i + = \sum_{j} \nabla_j \sigma_{ij} + &= \sum_{j} \Big( \!-\! \delta_{ij} \nabla_j p + \eta (\nabla_i \nabla_j v_j + \nabla_j^2 v_i) \Big) + \\ + &= - \nabla_i p + \eta \nabla_i \sum_{j} \nabla_j v_j + \eta \sum_{j} \nabla_j^2 v_i +\end{aligned}$$ + +Thanks to incompressibility $\nabla \cdot \va{v} = 0$, +the middle term vanishes, leaving us with: + +$$\begin{aligned} + \va{f^*} + = \va{f} - \nabla p + \eta \nabla^2 \va{v} +\end{aligned}$$ + +We assume that the only body force is gravity $\va{f} = \rho \va{g}$. +Newton's second law then becomes: + +$$\begin{aligned} + \rho \frac{\mathrm{D} \va{v}}{\mathrm{D} t} + = \rho \va{g} - \nabla p + \eta \nabla^2 \va{v} +\end{aligned}$$ + +Dividing by $\rho$, and replacing $\eta$ +with the kinematic viscosity $\nu = \eta/\rho$, +yields the main equation: + +$$\begin{aligned} + \boxed{ + \frac{\mathrm{D} \va{v}}{\mathrm{D} t} + = \va{g} - \frac{\nabla p}{\rho} + \nu \nabla^2 \va{v} + } +\end{aligned}$$ + +Finally, we can optionally allow incompressible fluids +with an inhomogeneous "lumpy" density $\rho$, +by demanding conservation of mass, +just like for the Euler equations: + +$$\begin{aligned} + \boxed{ + \frac{\mathrm{D} \rho}{\mathrm{D} t} + = 0 + } +\end{aligned}$$ + +Putting it all together, the Navier-Stokes equations for an incompressible fluid are given by: + +$$\begin{aligned} + \boxed{ + \frac{\mathrm{D} \va{v}}{\mathrm{D} t} + = \va{g} - \frac{\nabla p}{\rho} + \nu \nabla^2 \va{v} + \qquad + \nabla \cdot \va{v} = 0 + \qquad + \frac{\mathrm{D} \rho}{\mathrm{D} t} + = 0 + } +\end{aligned}$$ + +Due to the definition of viscosity $\nu$ as the molecular "stickiness", +we have boundary conditions for the velocity field $\va{v}$: +at any interface, $\va{v}$ must be continuous. +Likewise, Newton's third law demands that the normal component +of stress $\hat{\sigma} \cdot \vu{n}$ is continuous there. + + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/newtons-bucket/index.md b/source/know/concept/newtons-bucket/index.md new file mode 100644 index 0000000..30fe079 --- /dev/null +++ b/source/know/concept/newtons-bucket/index.md @@ -0,0 +1,91 @@ +--- +title: "Newton's bucket" +date: 2021-05-13 +categories: +- Physics +- Fluid mechanics +- Fluid statics +layout: "concept" +--- + +**Newton's bucket** is a cylindrical bucket +that rotates at angular velocity $\omega$. +Due to [viscosity](/know/concept/viscosity/), +any liquid in the bucket is affected by the rotation, +eventually achieving the exact same $\omega$. + +However, once in equilibrium, the liquid's surface is not flat, +but curved upwards from the center. +This is due to the centrifugal force $\va{F}_\mathrm{f} = m \va{f}$ on a molecule with mass $m$: + +$$\begin{aligned} + \va{f} + = \omega^2 \va{r} +\end{aligned}$$ + +Where $\va{r}$ is the molecule's position relative to the axis of rotation. +This (fictitious) force can be written as the gradient +of a potential $\Phi_\mathrm{f}$, such that $\va{f} = - \nabla \Phi_\mathrm{f}$: + +$$\begin{aligned} + \Phi_\mathrm{f} + = - \frac{\omega^2}{2} r^2 + = - \frac{\omega^2}{2} (x^2 + y^2) +\end{aligned}$$ + +In addition, each molecule feels a gravitational force $\va{F}_\mathrm{g} = m \va{g}$, +where $\va{g} = - \nabla \Phi_\mathrm{g}$: + +$$\begin{aligned} + \Phi_\mathrm{g} + = \mathrm{g} z +\end{aligned}$$ + +Overall, the molecule therefore feels an "effective" force +with a potential $\Phi$ given by: + +$$\begin{aligned} + \Phi + = \Phi_\mathrm{g} + \Phi_\mathrm{f} + = \mathrm{g} z - \frac{\omega^2}{2} (x^2 + y^2) +\end{aligned}$$ + +At equilibrium, the [hydrostatic pressure](/know/concept/hydrostatic-pressure/) $p$ +in the liquid is the one that satisfies: + +$$\begin{aligned} + \frac{\nabla p}{\rho} + = - \nabla \Phi +\end{aligned}$$ + +Removing the gradients gives integration constants $p_0$ and $\Phi_0$, +so the equilibrium equation is: + +$$\begin{aligned} + p - p_0 + = - \rho (\Phi - \Phi_0) +\end{aligned}$$ + +We isolate this for $p$ and rewrite $\Phi_0 = \mathrm{g} z_0$, +where $z_0$ is the liquid height at the center: + +$$\begin{aligned} + p + = p_0 - \rho \mathrm{g} (z - z_0) + \frac{\omega^2}{2} \rho (x^2 + y^2) +\end{aligned}$$ + +At the surface, we demand that $p = p_0$, where $p_0$ is the air pressure. +The $z$-coordinate at which this is satisfied is as follows, +telling us that the surface is parabolic: + +$$\begin{aligned} + z + = z_0 + \frac{\omega^2}{2 \mathrm{g}} (x^2 + y^2) +\end{aligned}$$ + + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/no-cloning-theorem/index.md b/source/know/concept/no-cloning-theorem/index.md new file mode 100644 index 0000000..e5e5be4 --- /dev/null +++ b/source/know/concept/no-cloning-theorem/index.md @@ -0,0 +1,70 @@ +--- +title: "No-cloning theorem" +date: 2021-03-06 +categories: +- Physics +- Quantum mechanics +- Quantum information +layout: "concept" +--- + +In quantum mechanics, the **no-cloning theorem** states +there is no general way to make copies of an arbitrary quantum state $\ket{\psi}$. +This has profound implications for quantum information. + +To prove this theorem, let us pretend that a machine exists +that can do just that: copy arbitrary quantum states. +Given an input $\ket{\psi}$ and a blank $\ket{?}$, +this machines turns $\ket{?}$ into $\ket{\psi}$: + +$$\begin{aligned} + \ket{\psi} \ket{?} + \:\:\longrightarrow\:\: + \ket{\psi} \ket{\psi} +\end{aligned}$$ + +We can use this device to make copies of the basis vectors $\ket{0}$ and $\ket{1}$: + +$$\begin{aligned} + \ket{0} \ket{?} + \:\:\longrightarrow\:\: + \ket{0} \ket{0} + \qquad \quad + \ket{1} \ket{?} + \:\:\longrightarrow\:\: + \ket{1} \ket{1} +\end{aligned}$$ + +If we feed this machine a superposition $\ket{\psi} = \alpha \ket{0} + \beta \ket{1}$, +we *want* the following behaviour: + +$$\begin{aligned} + \Big( \alpha \ket{0} + \beta \ket{1} \Big) \ket{?} + \:\:\longrightarrow\:\: + &\Big( \alpha \ket{0} + \beta \ket{1} \Big) \Big( \alpha \ket{0} + \beta \ket{1} \Big) + \\ + &= \Big( \alpha^2 \ket{0} \ket{0} + \alpha \beta \ket{0} \ket{1} + \alpha \beta \ket{1} \ket{0} + \beta^2 \ket{1} \ket{1} \Big) +\end{aligned}$$ + +Note the appearance of the cross terms with a factor of $\alpha \beta$. +The problem is that the fundamental linearity of quantum mechanics +dictates different behaviour: + +$$\begin{aligned} + \Big( \alpha \ket{0} + \beta \ket{1} \Big) \ket{?} + = \alpha \ket{0} \ket{?} + \beta \ket{1} \ket{?} + \:\:\longrightarrow\:\: + \alpha \ket{0} \ket{0} + \beta \ket{1} \ket{1} +\end{aligned}$$ + +This is clearly not the same as before: we have a contradiction, +which implies that such a general cloning machine cannot ever exist. + + +## References +1. N. Brunner, + *Quantum information theory: lecture notes*, + 2019, unpublished. +2. J.B. Brask, + *Quantum information: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/optical-wave-breaking/index.md b/source/know/concept/optical-wave-breaking/index.md new file mode 100644 index 0000000..2fa6c31 --- /dev/null +++ b/source/know/concept/optical-wave-breaking/index.md @@ -0,0 +1,229 @@ +--- +title: "Optical wave breaking" +date: 2021-02-27 +categories: +- Physics +- Optics +- Fiber optics +- Nonlinear optics +layout: "concept" +--- + +In fiber optics, **optical wave breaking** (OWB) is a nonlinear effect +caused by interaction between +[group velocity dispersion](/know/concept/dispersive-broadening/) (GVD) and +[self-phase modulation](/know/concept/self-phase-modulation/) (SPM). +It only happens in the normal dispersion regime ($\beta_2 > 0$) +for pulses meeting a certain criterium, as we will see. + +SPM creates low frequencies at the front of the pulse, and high ones at the back, +and if $\beta_2 > 0$, GVD lets low frequencies travel faster than high ones. +When those effects interact, the pulse gets temporally stretched +in a surprisingly sophisticated way. + +To illustrate this, the instantaneous frequency $\omega_i(z, t) = -\ipdv{\phi}{t}$ +has been plotted below for a theoretical Gaussian input pulse experiencing OWB, +with settings $T_0 = 100\:\mathrm{fs}$, $P_0 = 5\:\mathrm{kW}$, +$\beta_2 = 2\:\mathrm{ps}^2/\mathrm{m}$ and $\gamma = 0.1/\mathrm{W}/\mathrm{m}$. + +In the left panel, we see the typical S-shape caused by SPM, +and the arrows indicate the direction that GVD is pushing the curve in. +This leads to steepening at the edges, i.e. the S gradually turns into a Z. +Shortly before the slope would become infinite, +small waves start "falling off" the edge of the pulse, +hence the name *wave breaking*: + +<a href="pheno-break-inst.jpg"> +<img src="pheno-break-inst-small.jpg" style="width:100%"> +</a> + +Several interesting things happen around this moment. +To demonstrate this, spectrograms of the same simulation +have been plotted below, together with pulse profiles +in both the $t$-domain and $\omega$-domain on an arbitrary linear scale +(click the image to get a better look). + +Initially, the spectrum broadens due to SPM in the usual way, +but shortly after OWB, this process is stopped by the appearance +of so-called **sidelobes** in the $\omega$-domain on either side of the pulse. +In the meantime, in the time domain, +the pulse steepens at the edges, but flattens at the peak. +After OWB, a train of small waves falls off the edges, +which eventually melt together, leading to a trapezoid shape in the $t$-domain. +Dispersive broadening then continues normally: + +<a href="pheno-break-sgram.jpg"> +<img src="pheno-break-sgram-small.jpg" style="width:80%"> +</a> + +We call the distance at which the wave breaks $L_\mathrm{WB}$, +and would like to analytically predict it. +We do this using the instantaneous frequency $\omega_i$, +by estimating when the SPM fluctuations overtake their own base, +as was illustrated earlier. + +To get $\omega_i$ of a Gaussian pulse experiencing both GVD and SPM, +it is a reasonable approximation, for small $z$, to simply add up +the instantaneous frequencies for these separate effects: + +$$\begin{aligned} + \omega_i(z,t) + &\approx \omega_\mathrm{GVD}(z,t) + \omega_\mathrm{SPM}(z,t) + = \frac{tz}{T_0^2} \bigg( \frac{\beta_2 / T_0^2}{1 + \beta_2^2 z^2 / T_0^4} + + 2\gamma P_0 \exp\!\Big(\!-\!\frac{t^2}{T_0^2}\Big) \bigg) +\end{aligned}$$ + +Assuming that $z$ is small enough such that $z^2 \approx 0$, this +expression can be reduced to: + +$$\begin{aligned} + \omega_i(z,t) + \approx \frac{\beta_2 tz}{T_0^4} \bigg( 1 + 2\frac{\gamma P_0 T_0^2}{\beta_2} \exp\!\Big(\!-\!\frac{t^2}{T_0^2}\Big) \bigg) + = \frac{\beta_2 t z}{T_0^4} \bigg( 1 + 2 N_\mathrm{sol}^2 \exp\!\Big(\!-\!\frac{t^2}{T_0^2}\Big) \bigg) +\end{aligned}$$ + +Where we have assumed $\beta_2 > 0$, +and $N_\mathrm{sol}$ is the **soliton number**, +which is defined as: + +$$\begin{aligned} + N_\mathrm{sol}^2 \equiv \frac{L_D}{L_N} = \frac{\gamma P_0 T_0^2}{|\beta_2|} +\end{aligned}$$ + +This quantity is very important in anomalous dispersion, +but even in normal dispesion, it is still a useful measure of the relative strengths of GVD and SPM. +As was illustrated earlier, $\omega_i$ overtakes itself at the edges, +so OWB occurs when $\omega_i$ oscillates there, +which starts when its $t$-derivative, +the **instantaneous chirpyness** $\xi_i$, +has *two* real roots for $t^2$: + +$$\begin{aligned} + 0 + = \xi_i(z,t) + = \pdv{\omega_i}{t} + &= \frac{\beta_2 z}{T_0^4} \bigg( 1 + 2 N_\mathrm{sol}^2 \Big( 1 - \frac{2 t^2}{T_0^2} \Big) \exp\!\Big(\!-\!\frac{t^2}{T_0^2}\Big) \bigg) + = \frac{\beta_2 z}{T_0^4} \: f\Big(\frac{t^2}{T_0^2}\Big) +\end{aligned}$$ + +Where the function $f(x)$ has been defined for convenience. As it turns +out, this equation can be solved analytically using the Lambert $W$ function, +leading to the following exact minimum value $N_\mathrm{min}^2$ for $N_\mathrm{sol}^2$, +such that OWB can only occur when $N_\mathrm{sol}^2 > N_\mathrm{min}^2$: + +$$\begin{aligned} + \boxed{ + N_\mathrm{min}^2 = \frac{1}{4} \exp\!\Big(\frac{3}{2}\Big) \approx 1.12 + } +\end{aligned}$$ + +If this condition $N_\mathrm{sol}^2 > N_\mathrm{min}^2$ is not satisfied, +$\xi_i$ cannot have two roots for $t^2$, meaning $\omega_i$ cannot overtake itself. +GVD is unable to keep up with SPM, so OWB will not occur. + +Next, consider two points at $t_1$ and $t_2$ in the pulse, +separated by a small initial interval $(t_2 - t_1)$. +The frequency difference between these points due to $\omega_i$ +will cause them to displace relative to each other +after a short distance $z$ by some amount $\Delta t$, +estimated by: + +$$\begin{aligned} + \Delta t + &\approx z \Delta\beta_1 + \qquad + &&\Delta\beta_1 \equiv \beta_1(\omega_i(z,t_2)) - \beta_1(\omega_i(z,t_1)) + \\ + &\approx z \beta_2 \Delta\omega_i + \qquad + &&\Delta\omega_i \equiv \omega_i(z,t_2) - \omega_i(z,t_1) + \\ + &\approx z \beta_2 \Delta\xi_i \,(t_2 - t_1) + \qquad \quad + &&\Delta\xi_i \equiv \xi_i(z,t_2) - \xi_i(z,t_1) +\end{aligned}$$ + +Where $\beta_1(\omega)$ is the inverse of the group velocity. +OWB takes place when $t_2$ and $t_1$ catch up to each other, +which is when $-\Delta t = (t_2 - t_1)$. +The distance where this happens first, $z = L_\mathrm{WB}$, +must therefore satisfy the following condition +for a particular value of $t$: + +$$\begin{aligned} + L_\mathrm{WB} \, \beta_2 \, \xi_i(L_\mathrm{WB}, t) = -1 + \qquad \implies \qquad + L_\mathrm{WB}^2 = - \frac{T_0^4}{\beta_2^2 \, f(t^2/T_0^2)} +\end{aligned}$$ + +The time $t$ of OWB must be where $\omega_i(t)$ has its steepest slope, +which is at the minimum value of $\xi_i(t)$, and by extension $f(x)$. +This turns out to be $f(3/2)$: + +$$\begin{aligned} + f_\mathrm{min} = f(3/2) + = 1 - 4 N_\mathrm{sol}^2 \exp(-3/2) + = 1 - N_\mathrm{sol}^2 / N_\mathrm{min}^2 +\end{aligned}$$ + +Clearly, $f_\mathrm{min} \ge 0$ when $N_\mathrm{sol}^2 \le N_\mathrm{min}^2$, +which, when inserted above, leads to an imaginary $L_\mathrm{WB}$, +confirming that OWB cannot occur in that case. +Otherwise, if $N_\mathrm{sol}^2 > N_\mathrm{min}^2$, then: + +$$\begin{aligned} + \boxed{ + L_\mathrm{WB} + = \frac{T_0^2}{\beta_2 \, \sqrt{- f_\mathrm{min}}} + = \frac{L_D}{\sqrt{N_\mathrm{sol}^2 / N_\mathrm{min}^2 - 1}} + } +\end{aligned}$$ + +This prediction for $L_\mathrm{WB}$ appears to agree well +with the OWB observed in the simulation: + +<a href="pheno-break.jpg"> +<img src="pheno-break-small.jpg" style="width:100%"> +</a> + +Because all spectral broadening up to $L_\mathrm{WB}$ is caused by SPM, +whose frequency behaviour is known, it is in fact possible to draw +some analytical conclusions about the achieved bandwidth when OWB sets in. +Filling $L_\mathrm{WB}$ in into $\omega_\mathrm{SPM}$ gives: + +$$\begin{aligned} + \omega_{\mathrm{SPM}}(L_\mathrm{WB},t) + = \frac{2 \gamma P_0 t}{\beta_2 \sqrt{4 N_\mathrm{sol}^2 \exp(-3/2) - 1}} \exp\!\Big(\!-\!\frac{t^2}{T_0^2}\Big) +\end{aligned}$$ + +Assuming that $N_\mathrm{sol}^2$ is large in the denominator, this can +be approximately reduced to: + +$$\begin{aligned} + \omega_\mathrm{SPM}(L_\mathrm{WB}, t) + \approx \frac{2 \gamma P_0 t}{\beta_2 N_\mathrm{sol}} \exp\!\Big(\!-\!\frac{t^2}{T_0^2}\Big) + = 2 \sqrt{\frac{\gamma P_0}{\beta_2}} \frac{t}{T_0} \exp\!\Big(\!-\!\frac{t^2}{T_0^2}\Big) +\end{aligned}$$ + +The expression $x \exp(-x^2)$ has its global extrema +$\pm 1 / \sqrt{2 e}$ at $x^2 = 1/2$. The maximum SPM frequency shift +achieved at $L_\mathrm{WB}$ is therefore given by: + +$$\begin{aligned} + \omega_\mathrm{max} = \sqrt{\frac{2 \gamma P_0}{e \beta_2}} +\end{aligned}$$ + +Interestingly, this expression does not contain $T_0$ at all, +so the achieved spectrum when SPM is halted by OWB +is independent of the pulse width, +for sufficiently large $N_\mathrm{sol}$. + + +## References +1. D. Anderson, M. Desaix, M. Lisak, M.L. Quiroga-Teixeiro, + [Wave breaking in nonlinear-optical fibers](https://doi.org/10.1364/JOSAB.9.001358), + 1992, Optical Society of America. +2. A.M. Heidt, A. Hartung, H. Bartelt, + [Generation of ultrashort and coherent supercontinuum light pulses in all-normal dispersion fibers](https://doi.org/10.1007/978-1-4939-3326-6_6), + 2016, Springer Media. + diff --git a/source/know/concept/optical-wave-breaking/pheno-break-inst-small.jpg b/source/know/concept/optical-wave-breaking/pheno-break-inst-small.jpg Binary files differnew file mode 100644 index 0000000..f7568e6 --- /dev/null +++ b/source/know/concept/optical-wave-breaking/pheno-break-inst-small.jpg diff --git a/source/know/concept/optical-wave-breaking/pheno-break-inst.jpg b/source/know/concept/optical-wave-breaking/pheno-break-inst.jpg Binary files differnew file mode 100644 index 0000000..de92efd --- /dev/null +++ b/source/know/concept/optical-wave-breaking/pheno-break-inst.jpg diff --git a/source/know/concept/optical-wave-breaking/pheno-break-sgram-small.jpg b/source/know/concept/optical-wave-breaking/pheno-break-sgram-small.jpg Binary files differnew file mode 100644 index 0000000..3c493f2 --- /dev/null +++ b/source/know/concept/optical-wave-breaking/pheno-break-sgram-small.jpg diff --git a/source/know/concept/optical-wave-breaking/pheno-break-sgram.jpg b/source/know/concept/optical-wave-breaking/pheno-break-sgram.jpg Binary files differnew file mode 100644 index 0000000..340343a --- /dev/null +++ b/source/know/concept/optical-wave-breaking/pheno-break-sgram.jpg diff --git a/source/know/concept/optical-wave-breaking/pheno-break-small.jpg b/source/know/concept/optical-wave-breaking/pheno-break-small.jpg Binary files differnew file mode 100644 index 0000000..f29a32a --- /dev/null +++ b/source/know/concept/optical-wave-breaking/pheno-break-small.jpg diff --git a/source/know/concept/optical-wave-breaking/pheno-break.jpg b/source/know/concept/optical-wave-breaking/pheno-break.jpg Binary files differnew file mode 100644 index 0000000..5b08714 --- /dev/null +++ b/source/know/concept/optical-wave-breaking/pheno-break.jpg diff --git a/source/know/concept/parsevals-theorem/index.md b/source/know/concept/parsevals-theorem/index.md new file mode 100644 index 0000000..43d3717 --- /dev/null +++ b/source/know/concept/parsevals-theorem/index.md @@ -0,0 +1,82 @@ +--- +title: "Parseval's theorem" +date: 2021-02-22 +categories: +- Mathematics +- Physics +layout: "concept" +--- + +**Parseval's theorem** is a relation between the inner product of two functions $f(x)$ and $g(x)$, +and the inner product of their [Fourier transforms](/know/concept/fourier-transform/) +$\tilde{f}(k)$ and $\tilde{g}(k)$. +There are two equivalent ways of stating it, +where $A$, $B$, and $s$ are constants from the FT's definition: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \Inprod{f(x)}{g(x)} &= \frac{2 \pi B^2}{|s|} \inprod{\tilde{f}(k)}{\tilde{g}(k)} + \\ + \inprod{\tilde{f}(k)}{\tilde{g}(k)} &= \frac{2 \pi A^2}{|s|} \Inprod{f(x)}{g(x)} + \end{aligned} + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-fourier"/> +<label for="proof-fourier">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-fourier">Proof.</label> +We insert the inverse FT into the defintion of the inner product: + +$$\begin{aligned} + \Inprod{f}{g} + &= \int_{-\infty}^\infty \big( \hat{\mathcal{F}}^{-1}\{\tilde{f}(k)\}\big)^* \: \hat{\mathcal{F}}^{-1}\{\tilde{g}(k)\} \dd{x} + \\ + &= B^2 \int + \Big( \int \tilde{f}^*(k_1) \exp(i s k_1 x) \dd{k_1} \Big) + \Big( \int \tilde{g}(k) \exp(- i s k x) \dd{k} \Big) + \dd{x} + \\ + &= 2 \pi B^2 \iint \tilde{f}^*(k_1) \tilde{g}(k) \Big( \frac{1}{2 \pi} \int_{-\infty}^\infty \exp(i s x (k_1 - k)) \dd{x} \Big) \dd{k_1} \dd{k} + \\ + &= 2 \pi B^2 \iint \tilde{f}^*(k_1) \: \tilde{g}(k) \: \delta(s (k_1 - k)) \dd{k_1} \dd{k} + \\ + &= \frac{2 \pi B^2}{|s|} \int_{-\infty}^\infty \tilde{f}^*(k) \: \tilde{g}(k) \dd{k} + = \frac{2 \pi B^2}{|s|} \inprod{\tilde{f}}{\tilde{g}} +\end{aligned}$$ + +Where $\delta(k)$ is the [Dirac delta function](/know/concept/dirac-delta-function/). +Note that we can equally well do this proof in the opposite direction, +which yields an equivalent result: + +$$\begin{aligned} + \inprod{\tilde{f}}{\tilde{g}} + &= \int_{-\infty}^\infty \big( \hat{\mathcal{F}}\{f(x)\}\big)^* \: \hat{\mathcal{F}}\{g(x)\} \dd{k} + \\ + &= A^2 \int + \Big( \int f^*(x_1) \exp(- i s k x_1) \dd{x_1} \Big) + \Big( \int g(x) \exp(i s k x) \dd{x} \Big) + \dd{k} + \\ + &= 2 \pi A^2 \iint f^*(x_1) g(x) \Big( \frac{1}{2 \pi} \int_{-\infty}^\infty \exp(i s k (x_1 - x)) \dd{k} \Big) \dd{x_1} \dd{x} + \\ + &= 2 \pi A^2 \iint f^*(x_1) \: g(x) \: \delta(s (x_1 - x)) \dd{x_1} \dd{x} + \\ + &= \frac{2 \pi A^2}{|s|} \int_{-\infty}^\infty f^*(x) \: g(x) \dd{x} + = \frac{2 \pi A^2}{|s|} \Inprod{f}{g} +\end{aligned}$$ +</div> +</div> + +For this reason, physicists like to define the Fourier transform +with $A\!=\!B\!=\!1 / \sqrt{2\pi}$ and $|s|\!=\!1$, because then it nicely +conserves the functions' normalization. + + + +## References +1. O. Bang, + *Applied mathematics for physicists: lecture notes*, 2019, + unpublished. diff --git a/source/know/concept/partial-fraction-decomposition/index.md b/source/know/concept/partial-fraction-decomposition/index.md new file mode 100644 index 0000000..86e1e27 --- /dev/null +++ b/source/know/concept/partial-fraction-decomposition/index.md @@ -0,0 +1,61 @@ +--- +title: "Partial fraction decomposition" +date: 2021-02-22 +categories: +- Mathematics +layout: "concept" +--- + +**Partial fraction decomposition** or **partial fraction expansion** +is a method to rewrite quotients of two polynomials $g(x)$ and $h(x)$, +where the numerator $g(x)$ is of lower order than $h(x)$, +as sums of fractions with $x$ in the denominator: + +$$\begin{aligned} + f(x) = \frac{g(x)}{h(x)} = \frac{c_1}{x - h_1} + \frac{c_2}{x - h_2} + ... +\end{aligned}$$ + +Where $h_n$ etc. are the roots of the denominator $h(x)$. If all $N$ of +these roots are distinct, then it is sufficient to simply posit: + +$$\begin{aligned} + \boxed{ + f(x) = \frac{c_1}{x - h_1} + \frac{c_2}{x - h_2} + ... + \frac{c_N}{x - h_N} + } +\end{aligned}$$ + +The constants $c_n$ can either be found the hard way, +by multiplying the denominators around and solving a system of $N$ +equations, or the easy way by using this trick: + +$$\begin{aligned} + \boxed{ + c_n = \lim_{x \to h_n} \big( f(x) (x - h_n) \big) + } +\end{aligned}$$ + +If $h_1$ is a root with multiplicity $m > 1$, then the sum takes the form of: + +$$\begin{aligned} + \boxed{ + f(x) + = \frac{c_{1,1}}{x - h_1} + \frac{c_{1,2}}{(x - h_1)^2} + ... + } +\end{aligned}$$ + +Where $c_{1,j}$ are found by putting the terms on a common denominator, e.g. + +$$\begin{aligned} + \frac{c_{1,1}}{x - h_1} + \frac{c_{1,2}}{(x - h_1)^2} + = \frac{c_{1,1} (x - h_1) + c_{1,2}}{(x - h_1)^2} +\end{aligned}$$ + +And then, using the linear independence of $x^0, x^1, x^2, ...$, solving +a system of $m$ equations to find all $c_{1,1}, ..., c_{1,m}$. + + + +## References +1. O. Bang, + *Applied mathematics for physicists: lecture notes*, 2019, + unpublished. diff --git a/source/know/concept/path-integral-formulation/index.md b/source/know/concept/path-integral-formulation/index.md new file mode 100644 index 0000000..9c2e301 --- /dev/null +++ b/source/know/concept/path-integral-formulation/index.md @@ -0,0 +1,182 @@ +--- +title: "Path integral formulation" +date: 2021-07-03 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +In quantum mechanics, the **path integral formulation** +is an alternative description of quantum mechanics, +which is equivalent to the "traditional" Schrödinger equation. +Whereas the latter is based on [Hamiltonian mechanics](/know/concept/hamiltonian-mechanics/), +the former comes from [Lagrangian mechanics](/know/concept/lagrangian-mechanics/). + +It expresses the [propagator](/know/concept/propagator/) $K$ +using the following sum over all possible paths $x(t)$, +which all go from the initial position $x_0$ at time $t_0$ +to the destination $x_N$ at time $t_N$: + +$$\begin{aligned} + \boxed{ + K(x_N, t_N; x_0, t_0) + = A \sum_{\mathrm{all}\:x(t)} \exp(i S[x] / \hbar) + } +\end{aligned}$$ + +Where $A$ normalizes. +$S[x]$ is the classical action of the path $x$, whose minimization yields +the Euler-Lagrange equation from Lagrangian mechanics. +Note that each path is given an equal weight, +even unrealistic paths that make big detours. + +This apparent problem solves itself, +thanks to the fact that paths close to the classical optimum $x_c(t)$ +have an action close to $S_c = S[x_c]$, +while the paths far away have very different actions. +Since $S[x]$ is inside a complex exponential, +this means that paths close to $x_c$ add contructively, +and the others add destructively and cancel out. + +An interesting way too look at it is by varying $\hbar$: +as its value decreases, minor action differences yield big phase differences, +which make the quantum wave function stay closer to $x_c$. +In the limit $\hbar \to 0$, quantum mechanics thus turns into classical mechanics. + +## Time-slicing derivation + +The most popular way to derive the path integral formulation proceeds as follows: +starting from the definition of the propagator $K$, +we divide the time interval $t_N - t_0$ into $N$ "slices" +of equal width $\Delta t = (t_N - t_0) / N$, +where $N$ is large: + +$$\begin{aligned} + K(x_N, t_N; x_0, t_0) + &= \matrixel{x_N}{e^{- i \hat{H} (t_N - t_0) / \hbar}}{x_0} + = \matrixel{x_N}{e^{- i \hat{H} \Delta t / \hbar} \cdots e^{- i \hat{H} \Delta t / \hbar}}{x_0} +\end{aligned}$$ + +Between the exponentials we insert $N\!-\!1$ identity operators +$\hat{I} = \int \Ket{x} \Bra{x} \dd{x}$, +and define $x_j = x(t_j)$ for an arbitrary path $x(t)$: + +$$\begin{aligned} + K + &= \int\cdots\int \matrixel{x_N}{e^{- i \hat{H} \Delta t / \hbar}}{x_{N-1}} \cdots \matrixel{x_1}{e^{- i \hat{H} \Delta t / \hbar}}{x_0} + \dd{x_1} \cdots \dd{x_{N - 1}} +\end{aligned}$$ + +For sufficiently small time steps $\Delta t$ (i.e. large $N$ +we make the following approximation +(which would be exact, were it not for the fact that +$\hat{T}$ and $\hat{V}$ are operators): + +$$\begin{aligned} + e^{- i \hat{H} \Delta t / \hbar} + = e^{- i (\hat{T} + \hat{V}) \Delta t / \hbar} + \approx e^{- i \hat{T} \Delta t / \hbar} e^{- i \hat{V} \Delta t / \hbar} +\end{aligned}$$ + +Since $\hat{V} = V(x_j)$, +we can take it out of the inner product as a constant factor: + +$$\begin{aligned} + \matrixel{x_{j+1}}{e^{- i \hat{T} \Delta t / \hbar} e^{- i \hat{V} \Delta t / \hbar}}{x_j} + = e^{- i V(x_j) \Delta t / \hbar} \matrixel{x_{j+1}}{e^{- i \hat{T} \Delta t / \hbar}}{x_j} +\end{aligned}$$ + +Here we insert the identity operator +expanded in the momentum basis $\hat{I} = \int \Ket{p} \Bra{p} \dd{p}$, +and commute it with the kinetic energy $\hat{T} = \hat{p}^2 / (2m)$ to get: + +$$\begin{aligned} + \matrixel{x_{j+1}}{e^{- i \hat{T} \Delta t / \hbar}}{x_j} + = \int_{-\infty}^\infty \Inprod{x_{j+1}}{p} \exp\!\Big(\!-\! i \frac{p^2 \Delta t}{2 m \hbar}\Big) \Inprod{p}{x_j} \dd{p} +\end{aligned}$$ + +In the momentum basis $\Ket{p}$, +the position basis vectors +are represented by plane waves: + +$$\begin{aligned} + \Inprod{p}{x_j} + = \frac{1}{\sqrt{2 \pi \hbar}} \exp\!\Big( \!-\! i \frac{x_j p}{\hbar} \Big) + \qquad + \Inprod{x_{j+1}}{p} + = \frac{1}{\sqrt{2 \pi \hbar}} \exp\!\Big( i \frac{x_{j+1} p}{\hbar} \Big) +\end{aligned}$$ + +With this, we return to the inner product and further evaluate the integral: + +$$\begin{aligned} + \matrixel{x_{j+1}}{e^{- i \hat{T} \Delta t / \hbar}}{x_j} + &= \frac{1}{2 \pi \hbar} \int_{-\infty}^\infty + \exp\!\Big(\!-\! i \frac{p^2 \Delta t}{2 m \hbar}\Big) \exp\!\Big(i \frac{(x_{j+1} - x_j) p}{\hbar}\Big) \:dp + \\ + &= \frac{1}{2 \pi \hbar} \sqrt{\frac{2 \pi m \hbar}{i \Delta t}} \exp\!\Big( i \frac{m (x_{j+1} - x_j)^2}{2 \hbar \Delta t} \Big) +\end{aligned}$$ + +Inserting this back into the definition of the propagator $K(x_N, t_N; x_0, t_0)$ yields: + +$$\begin{aligned} + K + = \Big( \frac{- i m}{2 \pi \hbar \Delta t} \Big)^{\!N / 2} + \int\cdots\int + \exp\!\bigg(\! \sum_{j = 0}^{N - 1} i \Big( \frac{m (x_{j+1} \!-\! x_j)^2}{2 \hbar \Delta t} - \frac{V(x_j) \Delta t}{\hbar} \Big) \!\bigg) + \dd{x_1} \cdots \dd{x_{N-1}} +\end{aligned}$$ + +For large $N$ and small $\Delta t$, the sum in the exponent becomes an integral: + +$$\begin{aligned} + \frac{i}{\hbar} \sum_{j = 0}^{N - 1} \Big( \frac{m (x_{j+1} \!-\! x_j)^2}{2 \Delta t^2} - V(x_j) \Big) \Delta t + \quad \to \quad + \frac{i}{\hbar} \int_{t_0}^{t_N} \Big( \frac{1}{2} m \dot{x}^2 - V(x) \Big) \dd{\tau} +\end{aligned}$$ + +Upon closer inspection, this integral turns out to be the classical action $S[x]$, +with the integrand being the Lagrangian $L$: + +$$\begin{aligned} + S[x(t)] + = \int_{t_0}^{t_N} L(x, \dot{x}, \tau) \dd{\tau} + = \int_{t_0}^{t_N} \Big( \frac{1}{2} m \dot{x}^2 - V(x) \Big) \dd{\tau} +\end{aligned}$$ + +The definition of the propagator $K$ is then further reduced to the following: + +$$\begin{aligned} + K + = \Big( \frac{- i m}{2 \pi \hbar \Delta t} \Big)^{\!N / 2} + \int\cdots\int \exp(i S[x] / \hbar) \dd{x_1} \cdots \dd{x_{N-1}} +\end{aligned}$$ + +Finally, for the purpose of normalization, +we define the integral over all paths $x(t)$ as follows, +where we write $D[x]$ instead of $\dd{x}$: + +$$\begin{aligned} + \int D[x] + \equiv \lim_{N \to \infty} \Big( \frac{- i m}{2 \pi \hbar \Delta t} \Big)^{\!N / 2} \int\cdots\int \dd{x_1} \cdots \dd{x_{N-1}} +\end{aligned}$$ + +We thus arrive at **Feynman's path integral**, +which sums over all possible paths $x(t)$: + +$$\begin{aligned} + K + = \int \exp(i S[x] / \hbar) \:D[x] + = A \sum_{\mathrm{all}\:x(t)} \exp(i S[x] / \hbar) +\end{aligned}$$ + + + +## References +1. R. Shankar, + *Principles of quantum mechanics*, 2nd edition, + Springer. +2. L.E. Ballentine, + *Quantum mechanics: a modern development*, 2nd edition, + World Scientific. diff --git a/source/know/concept/pauli-exclusion-principle/index.md b/source/know/concept/pauli-exclusion-principle/index.md new file mode 100644 index 0000000..56af39b --- /dev/null +++ b/source/know/concept/pauli-exclusion-principle/index.md @@ -0,0 +1,119 @@ +--- +title: "Pauli exclusion principle" +date: 2021-02-22 +categories: +- Quantum mechanics +- Physics +layout: "concept" +--- + +In quantum mechanics, the **Pauli exclusion principle** is a theorem with +profound consequences for how the world works. + +Suppose we have a composite state +$\ket{x_1}\ket{x_2} = \ket{x_1} \otimes \ket{x_2}$, where the two +identical particles $x_1$ and $x_2$ each can occupy the same two allowed +states $a$ and $b$. We then define the permutation operator $\hat{P}$ as +follows: + +$$\begin{aligned} + \hat{P} \Ket{a}\Ket{b} = \Ket{b}\Ket{a} +\end{aligned}$$ + +That is, it swaps the states of the particles. Obviously, swapping the +states twice simply gives the original configuration again, so: + +$$\begin{aligned} + \hat{P}^2 \Ket{a}\Ket{b} = \Ket{a}\Ket{b} +\end{aligned}$$ + +Therefore, $\Ket{a}\Ket{b}$ is an eigenvector of $\hat{P}^2$ with +eigenvalue $1$. Since $[\hat{P}, \hat{P}^2] = 0$, $\Ket{a}\Ket{b}$ +must also be an eigenket of $\hat{P}$ with eigenvalue $\lambda$, +satisfying $\lambda^2 = 1$, so we know that $\lambda = 1$ or $\lambda = -1$: + +$$\begin{aligned} + \hat{P} \Ket{a}\Ket{b} = \lambda \Ket{a}\Ket{b} +\end{aligned}$$ + +As it turns out, in nature, each class of particle has a single +associated permutation eigenvalue $\lambda$, or in other words: whether +$\lambda$ is $-1$ or $1$ depends on the type of particle that $x_1$ +and $x_2$ are. Particles with $\lambda = -1$ are called +**fermions**, and those with $\lambda = 1$ are known as **bosons**. We +define $\hat{P}_f$ with $\lambda = -1$ and $\hat{P}_b$ with +$\lambda = 1$, such that: + +$$\begin{aligned} + \hat{P}_f \Ket{a}\Ket{b} = \Ket{b}\Ket{a} = - \Ket{a}\Ket{b} + \qquad + \hat{P}_b \Ket{a}\Ket{b} = \Ket{b}\Ket{a} = \Ket{a}\Ket{b} +\end{aligned}$$ + +Another fundamental fact of nature is that identical particles cannot be +distinguished by any observation. Therefore it is impossible to tell +apart $\Ket{a}\Ket{b}$ and the permuted state $\Ket{b}\Ket{a}$, +regardless of the eigenvalue $\lambda$. There is no physical difference! + +But this does not mean that $\hat{P}$ is useless: despite not having any +observable effect, the resulting difference between fermions and bosons +is absolutely fundamental. Consider the following superposition state, +where $\alpha$ and $\beta$ are unknown: + +$$\begin{aligned} + \Ket{\Psi(a, b)} + = \alpha \Ket{a}\Ket{b} + \beta \Ket{b}\Ket{a} +\end{aligned}$$ + +When we apply $\hat{P}$, we can "choose" between two "intepretations" of +its action, both shown below. Obviously, since the left-hand sides are +equal, the right-hand sides must be equal too: + +$$\begin{aligned} + \hat{P} \Ket{\Psi(a, b)} + &= \lambda \alpha \Ket{a}\Ket{b} + \lambda \beta \Ket{b}\Ket{a} + \\ + \hat{P} \Ket{\Psi(a, b)} + &= \alpha \Ket{b}\Ket{a} + \beta \Ket{a}\Ket{b} +\end{aligned}$$ + +This gives us the equations $\lambda \alpha = \beta$ and +$\lambda \beta = \alpha$. In fact, just from this we could have deduced +that $\lambda$ can be either $-1$ or $1$. In any case, for bosons +($\lambda = 1$), we thus find that $\alpha = \beta$: + +$$\begin{aligned} + \Ket{\Psi(a, b)}_b = C \big( \Ket{a}\Ket{b} + \Ket{b}\Ket{a} \big) +\end{aligned}$$ + +Where $C$ is a normalization constant. As expected, this state is +**symmetric**: switching $a$ and $b$ gives the same result. Meanwhile, for +fermions ($\lambda = -1$), we find that $\alpha = -\beta$: + +$$\begin{aligned} + \Ket{\Psi(a, b)}_f = C \big( \Ket{a}\Ket{b} - \Ket{b}\Ket{a} \big) +\end{aligned}$$ + +This state is called **antisymmetric** under exchange: switching $a$ and $b$ +causes a sign change, as we would expect for fermions. + +Now, what if the particles $x_1$ and $x_2$ are in the same state $a$? +For bosons, we just need to update the normalization constant $C$: + +$$\begin{aligned} + \Ket{\Psi(a, a)}_b + = C \Ket{a}\Ket{a} +\end{aligned}$$ + +However, for fermions, the state is unnormalizable and thus unphysical: + +$$\begin{aligned} + \Ket{\Psi(a, a)}_f + = C \big( \Ket{a}\Ket{a} - \Ket{a}\Ket{a} \big) + = 0 +\end{aligned}$$ + +And this is the Pauli exclusion principle: **fermions may never +occupy the same quantum state**. One of the many notable consequences of +this is that the shells of atoms only fit a limited number of +electrons (which are fermions), since each must have a different quantum number. diff --git a/source/know/concept/plancks-law/index.md b/source/know/concept/plancks-law/index.md new file mode 100644 index 0000000..7ea06f5 --- /dev/null +++ b/source/know/concept/plancks-law/index.md @@ -0,0 +1,140 @@ +--- +title: "Planck's law" +date: 2021-09-09 +categories: +- Physics +layout: "concept" +--- + +**Planck's law** describes the radiation spectrum of a **black body**: +a theoretical object in thermal equilibrium, +which absorbs photons, +re-radiates them, and then re-absorbs them. + +Since the photon population varies with time, +this is a [grand canonical ensemble](/know/concept/grand-canonical-ensemble/), +and photons are bosons +(see [Pauli exclusion principle](/know/concept/pauli-exclusion-principle/)), +this system must obey the +[Bose-Einstein distribution](/know/concept/bose-einstein-distribution/), +with a chemical potential $\mu = 0$ (due to the freely varying population): + +$$\begin{aligned} + f_B(E) + = \frac{1}{\exp(\beta E) - 1} +\end{aligned}$$ + +Each photon has an energy $E = \hbar \omega = \hbar c k$, +so the [density of states](/know/concept/density-of-states/) +is as follows in 3D: + +$$\begin{aligned} + g(E) + = 2 \frac{g(k)}{E'(k)} + = \frac{V k^2}{\pi^2 \hbar c} + = \frac{V E^2}{\pi^2 \hbar^3 c^3} + = \frac{8 \pi V E^2}{h^3 c^3} +\end{aligned}$$ + +Where the factor of $2$ accounts for the photon's polarization degeneracy. +We thus expect that the number of photons $N(E)$ +with an energy between $E$ and $E + \dd{E}$ is given by: + +$$\begin{aligned} + N(E) \dd{E} + = f_B(E) \: g(E) \dd{E} + = \frac{8 \pi V}{h^3 c^3} \frac{E^2}{\exp(\beta E) - 1} \dd{E} +\end{aligned}$$ + +By substituting $E = h \nu$, we find that the number of photons $N(\nu)$ +with a frequency between $\nu$ and $\nu + \dd{\nu}$ must be as follows: + +$$\begin{aligned} + N(\nu) \dd{\nu} + = \frac{8 \pi V}{c^3} \frac{\nu^2}{\exp(\beta h \nu) - 1} \dd{\nu} +\end{aligned}$$ + +Multiplying by the energy $h \nu$ yields the distribution of the radiated energy, +which we divide by the volume $V$ to get Planck's law, +also called the **Plank distribution**, +describing a black body's radiated spectral energy density per unit volume: + +$$\begin{aligned} + \boxed{ + u(\nu) + = \frac{8 \pi h}{c^3} \frac{\nu^3}{\exp(\beta h \nu) - 1} + } +\end{aligned}$$ + + +## Wien's displacement law + +The Planck distribution peaks at a particular frequency $\nu_{\mathrm{max}}$, +which can be found by solving the following equation for $\nu$: + +$$\begin{aligned} + 0 + = u'(\nu) + \quad \implies \quad + 0 + = 3 \nu^2 (\exp(\beta h \nu) - 1) - \nu^3 \beta h \exp(\beta h \nu) +\end{aligned}$$ + +By defining $x \equiv \beta h \nu_{\mathrm{max}}$, +this turns into the following transcendental equation: + +$$\begin{aligned} + 3 + = (3 - x) \exp(x) +\end{aligned}$$ + +Whose numerical solution leads to **Wien's displacement law**, given by: + +$$\begin{aligned} + \boxed{ + \frac{h \nu_{\mathrm{max}}}{k_B T} + \approx 2.822 + } +\end{aligned}$$ + +Which states that the peak frequency $\nu_{\mathrm{max}}$ +is proportional to the temperature $T$. + + +## Stefan-Boltzmann law + +Because $u(\nu)$ represents the radiated spectral energy density, +we can find the total radiated energy $U$ per unit volume by integrating over $\nu$: + +$$\begin{aligned} + U + &= \int_0^\infty u(\nu) \dd{\nu} + = \frac{8 \pi h}{c^3} \int_0^\infty \frac{\nu^3}{\exp(\beta h \nu) - 1} \dd{\nu} + \\ + &= \frac{8 \pi h}{\beta^3 h^3 c^3} \int_0^\infty \frac{(\beta h \nu)^3}{\exp(\beta h \nu) - 1} \dd{\nu} + = \frac{8 \pi}{\beta^4 h^3 c^3} \int_0^\infty \frac{x^3}{\exp(x) - 1} \dd{x} +\end{aligned}$$ + +This definite integral turns out to be $\pi^4/15$, +leading us to the **Stefan-Boltzmann law**, +which states that the radiated energy is proportional to $T^4$: + +$$\begin{aligned} + \boxed{ + U = \frac{4 \sigma}{c} T^4 + } +\end{aligned}$$ + +Where $\sigma$ is the **Stefan-Boltzmann constant**, which is defined as follows: + +$$\begin{aligned} + \sigma + \equiv \frac{2 \pi^5 k_B^4}{15 c^2 h^3} +\end{aligned}$$ + + + +## References +1. H. Gould, J. Tobochnik, + *Statistical and thermal physics*, 2nd edition, + Princeton. diff --git a/source/know/concept/prandtl-equations/index.md b/source/know/concept/prandtl-equations/index.md new file mode 100644 index 0000000..9e9e745 --- /dev/null +++ b/source/know/concept/prandtl-equations/index.md @@ -0,0 +1,205 @@ +--- +title: "Prandtl equations" +date: 2021-05-29 +categories: +- Physics +- Fluid mechanics +- Fluid dynamics +layout: "concept" +--- + +In fluid dynamics, the **Prandtl equations** or **boundary layer equations** +describe the movement of a [viscous](/know/concept/viscosity/) fluid +with a large [Reynolds number](/know/concept/reynolds-number/) $\mathrm{Re} \gg 1$ +close to a solid surface. + +Fluids with a large Reynolds number +are often approximated as having zero viscosity, +since the simpler [Euler equations](/know/concept/euler-equations) +can then be used instead of the [Navier-Stokes equations](/know/concept/navier-stokes-equations/). + +However, in reality, a viscous fluid obeys the *no-slip* boundary condition: +at every solid surface the local velocity must be zero. +This implies the existence of a **boundary layer**: +a thin layer of fluid "stuck" to solid objects in the flow, +where viscosity plays an important role. +This is in contrast to the ideal flow far away from the surface. + +We consider a simple theoretical case in 2D: +a large flat surface located at $y = 0$ for all $x \in \mathbb{R}$, +with a fluid *trying* to flow parallel to it at $U$. +The 2D treatment can be justified by assuming that everything is constant in the $z$-direction. +We will not solve this case, +but instead derive general equations +to describe the flow close to a flat surface. + +At the wall, there is a very thin boundary layer of thickness $\delta$, +where the fluid is assumed to be completely stationary $\va{v} = 0$. +We are mainly interested in the region $\delta < y \ll L$, +where $L$ is the distance at which the fluid becomes practically ideal. +This the so-called **slip-flow** region, +in which the fluid is not stationary, +but still viscosity-dominated. + +In 2D, the steady Navier-Stokes equations are as follows, +where the flow $\va{v} = (v_x, v_y)$: + +$$\begin{aligned} + v_x \pdv{v_x}{x} + v_y \pdv{v_x}{y} + &= - \frac{1}{\rho} \pdv{p}{x} + \nu \Big( \pdvn{2}{v_x}{x} + \pdvn{2}{v_x}{y} \Big) + \\ + v_x \pdv{v_y}{x} + v_y \pdv{v_y}{y} + &= - \frac{1}{\rho} \pdv{p}{y} + \nu \Big( \pdvn{2}{v_y}{x} + \pdvn{2}{v_y}{y} \Big) + \\ + \pdv{v_x}{x} + \pdv{v_y}{y} + &= 0 +\end{aligned}$$ + +The latter represents the fluid's incompressibility. +We non-dimensionalize these equations, +and assume that changes along the $y$-axis +happen on a short scale (say, $\delta$), +and along the $x$-axis on a longer scale (say, $L$). +Let $\tilde{x}$ and $\tilde{y}$ be dimenionless variables of order $1$: + +$$\begin{aligned} + x + = L \tilde{x} + \qquad \quad + y + = \delta \tilde{x} + \qquad \quad + \pdv{}{x} + = \frac{1}{L} \pdv{}{\tilde{x}} + \qquad \quad + \pdv{}{y} + = \frac{1}{\delta} \pdv{}{\tilde{y}} +\end{aligned}$$ + +Furthermore, we choose velocity scales +to be consistent with the incompressibility condition, +and a pressure scale inspired +by [Bernoulli's theorem](/know/concept/bernoullis-theorem/): + +$$\begin{aligned} + v_x + = U \tilde{v}_x + \qquad \quad + v_y + = \frac{U \delta}{L} \tilde{v}_y + \qquad \quad + p + = \rho U^2 \tilde{p} +\end{aligned}$$ + +We insert these scalings into the Navier-Stokes equations, yielding: + +$$\begin{aligned} + \frac{U^2}{L} \tilde{v}_x \pdv{\tilde{v}_x}{\tilde{x}} + \frac{U^2}{L} \tilde{v}_y \pdv{\tilde{v}_x}{\tilde{y}} + &= - \frac{U^2}{L} \pdv{\tilde{p}}{\tilde{x}} + + \nu \Big( \frac{U}{L^2} \pdvn{2}{\tilde{v}_x}{\tilde{x}} + \frac{U}{\delta^2} \pdvn{2}{\tilde{v}_x}{\tilde{y}} \Big) + \\ + \frac{U^2 \delta}{L^2} \tilde{v}_x \pdv{\tilde{v}_y}{\tilde{x}} + \frac{U^2 \delta}{L^2} \tilde{v}_y \pdv{\tilde{v}_y}{\tilde{y}} + &= - \frac{U^2}{\delta} \pdv{\tilde{p}}{\tilde{y}} + + \nu \Big( \frac{U \delta}{L^3} \pdvn{2}{\tilde{v}_y}{\tilde{x}} + \frac{U}{L \delta} \pdvn{2}{\tilde{v}_y}{\tilde{y}} \Big) +\end{aligned}$$ + +For future convenience, +we multiply the former equation by $L / U^2$, and the latter by $\delta / U^2$: + +$$\begin{aligned} + \tilde{v}_x \pdv{\tilde{v}_x}{\tilde{x}} + \tilde{v}_y \pdv{\tilde{v}_x}{\tilde{y}} + &= - \pdv{\tilde{p}}{\tilde{x}} + + \nu \Big( \frac{1}{U L} \pdvn{2}{\tilde{v}_x}{\tilde{x}} + \frac{L}{U \delta^2} \pdvn{2}{\tilde{v}_x}{\tilde{y}} \Big) + \\ + \frac{\delta^2}{L^2} \tilde{v}_x \pdv{\tilde{v}_y}{\tilde{x}} + \frac{\delta^2}{L^2} \tilde{v}_y \pdv{\tilde{v}_y}{\tilde{y}} + &= - \pdv{\tilde{p}}{\tilde{y}} + + \nu \Big( \frac{\delta^2}{U L^3} \pdvn{2}{\tilde{v}_y}{\tilde{x}} + \frac{1}{U L} \pdvn{2}{\tilde{v}_y}{\tilde{y}} \Big) +\end{aligned}$$ + +We would like to estimate $\delta$. +Intuitively, we expect that higher viscosities $\nu$ give thicker layers, +and that faster velocities $U$ give thinner layers. +Furthermore, we expect *downstream thickening*: +with distance $x$, viscous stresses slow down the slip-flow, +leading to a gradual increase of $\delta(x)$. +Some dimensional analysis thus yields the following estimate: + +$$\begin{aligned} + \delta + \approx \sqrt{\frac{\nu x}{U}} + \sim \sqrt{\frac{\nu L}{U}} +\end{aligned}$$ + +We thus insert $\delta = \sqrt{\nu L / U}$ into the Navier-Stokes equations, giving us: + +$$\begin{aligned} + \tilde{v}_x \pdv{\tilde{v}_x}{\tilde{x}} + \tilde{v}_y \pdv{\tilde{v}_x}{\tilde{y}} + &= - \pdv{\tilde{p}}{\tilde{x}} + + \nu \Big( \frac{1}{U L} \pdvn{2}{\tilde{v}_x}{\tilde{x}} + \frac{1}{\nu} \pdvn{2}{\tilde{v}_x}{\tilde{y}} \Big) + \\ + \frac{\nu}{U L} \tilde{v}_x \pdv{\tilde{v}_y}{\tilde{x}} + \frac{\nu}{U L} \tilde{v}_y \pdv{\tilde{v}_y}{\tilde{y}} + &= - \pdv{\tilde{p}}{\tilde{y}} + + \nu \Big( \frac{\nu}{U^2 L^2} \pdvn{2}{\tilde{v}_y}{\tilde{x}} + \frac{1}{U L} \pdvn{2}{\tilde{v}_y}{\tilde{y}} \Big) +\end{aligned}$$ + +Here, we recognize the definition of the Reynolds number $\mathrm{Re} = U L / \nu$: + +$$\begin{aligned} + \tilde{v}_x \pdv{\tilde{v}_x}{\tilde{x}} + \tilde{v}_y \pdv{\tilde{v}_x}{\tilde{y}} + &= - \pdv{\tilde{p}}{\tilde{x}} + + \frac{1}{\mathrm{Re}} \pdvn{2}{\tilde{v}_x}{\tilde{x}} + \pdvn{2}{\tilde{v}_x}{\tilde{y}} + \\ + \frac{1}{\mathrm{Re}} \tilde{v}_x \pdv{\tilde{v}_y}{\tilde{x}} + \frac{1}{\mathrm{Re}} \tilde{v}_y \pdv{\tilde{v}_y}{\tilde{y}} + &= - \pdv{\tilde{p}}{\tilde{y}} + + \frac{1}{\mathrm{Re}^2} \pdvn{2}{\tilde{v}_y}{\tilde{x}} + \frac{1}{\mathrm{Re}} \pdvn{2}{\tilde{v}_y}{\tilde{y}} +\end{aligned}$$ + +Recall that we are only considering large Reynolds numbers $\mathrm{Re} \gg 1$, +in which case $\mathrm{Re}^{-1} \ll 1$, +so we can drop many terms, leaving us with these redimensionalized equations: + +$$\begin{aligned} + v_x \pdv{v_x}{x} + v_y \pdv{v_x}{y} + = - \frac{1}{\rho} \pdv{p}{x} + \nu \pdvn{2}{v_x}{y} + \qquad \quad + \pdv{p}{y} + = 0 +\end{aligned}$$ + +The second one tells us that for a given $x$-value, +the pressure is the same at the surface +as in the main flow $y > L$, where the fluid is ideal. +In the latter regime, we apply Bernoulli's theorem to rewrite $p$, +using the *Bernoulli head* $H$ and the mainstream velocity $U(x)$: + +$$\begin{aligned} + p + = \rho H - \frac{1}{2} \rho U^2 + = p_0 - \frac{1}{2} \rho U^2 +\end{aligned}$$ + +Inserting this into the reduced Navier-Stokes equations, +we arrive at the Prandtl equations: + +$$\begin{aligned} + \boxed{ + v_x \pdv{v_x}{x} + v_y \pdv{v_x}{y} + = U \dv{U}{x} + \nu \pdvn{2}{v_x}{y} + \qquad \quad + \pdv{v_x}{x} + \pdv{v_y}{y} + = 0 + } +\end{aligned}$$ + +A notable application of these equations is +the [Blasius boundary layer](/know/concept/blasius-boundary-layer/), +where the surface in question +is a semi-infinite plane. + + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/probability-current/index.md b/source/know/concept/probability-current/index.md new file mode 100644 index 0000000..6f85149 --- /dev/null +++ b/source/know/concept/probability-current/index.md @@ -0,0 +1,99 @@ +--- +title: "Probability current" +date: 2021-02-22 +categories: +- Quantum mechanics +- Physics +layout: "concept" +--- + +In quantum mechanics, the **probability current** describes the movement +of the probability of finding a particle at given point in space. +In other words, it treats the particle as a heterogeneous fluid with density $|\psi|^2$. +Now, the probability of finding the particle within a volume $V$ is: + +$$\begin{aligned} + P = \int_{V} | \psi |^2 \ddn{3}{\vb{r}} +\end{aligned}$$ + +As the system evolves in time, this probability may change, so we take +its derivative with respect to time $t$, and when necessary substitute +in the other side of the Schrödinger equation to get: + +$$\begin{aligned} + \pdv{P}{t} + &= \int_{V} \psi \pdv{\psi^*}{t} + \psi^* \pdv{\psi}{t} \ddn{3}{\vb{r}} + = \frac{i}{\hbar} \int_{V} \psi (\hat{H} \psi^*) - \psi^* (\hat{H} \psi) \ddn{3}{\vb{r}} + \\ + &= \frac{i}{\hbar} \int_{V} \psi \Big( \!-\! \frac{\hbar^2}{2 m} \nabla^2 \psi^* + V(\vb{r}) \psi^* \Big) + - \psi^* \Big( \!-\! \frac{\hbar^2}{2 m} \nabla^2 \psi + V(\vb{r}) \psi \Big) \ddn{3}{\vb{r}} + \\ + &= \frac{i \hbar}{2 m} \int_{V} - \psi \nabla^2 \psi^* + \psi^* \nabla^2 \psi \ddn{3}{\vb{r}} + = - \int_{V} \nabla \cdot \vb{J} \ddn{3}{\vb{r}} +\end{aligned}$$ + +Where we have defined the probability current $\vb{J}$ as follows in +the $\vb{r}$-basis: + +$$\begin{aligned} + \vb{J} + = \frac{i \hbar}{2 m} (\psi \nabla \psi^* - \psi^* \nabla \psi) + = \mathrm{Re} \Big\{ \psi \frac{i \hbar}{m} \psi^* \Big\} +\end{aligned}$$ + +Let us rewrite this using the momentum operator +$\vu{p} = -i \hbar \nabla$ as follows, noting that $\vu{p} / m$ is +simply the velocity operator $\vu{v}$: + +$$\begin{aligned} + \boxed{ + \vb{J} + = \frac{1}{2 m} ( \psi^* \vu{p} \psi - \psi \vu{p} \psi^*) + = \mathrm{Re} \Big\{ \psi^* \frac{\vu{p}}{m} \psi \Big\} + = \mathrm{Re} \{ \psi^* \vu{v} \psi \} + } +\end{aligned}$$ + +Returning to the derivation of $\vb{J}$, we now have the following +equation: + +$$\begin{aligned} + \pdv{P}{t} + = \int_{V} \pdv{|\psi|^2}{t} \ddn{3}{\vb{r}} + = - \int_{V} \nabla \cdot \vb{J} \ddn{3}{\vb{r}} +\end{aligned}$$ + +By removing the integrals, we thus arrive at the **continuity equation** +for $\vb{J}$: + +$$\begin{aligned} + \boxed{ + \nabla \cdot \vb{J} + = - \pdv{|\psi|^2}{t} + } +\end{aligned}$$ + +This states that the total probability is conserved, and is reminiscent of charge +conservation in electromagnetism. In other words, the probability at a +point can only change by letting it "flow" towards or away from it. Thus +$\vb{J}$ represents the flow of probability, which is analogous to the +motion of a particle. + +As a bonus, this still holds for a particle in an electromagnetic vector +potential $\vb{A}$, thanks to the gauge invariance of the Schrödinger +equation. We can thus extend the definition to a particle with charge +$q$ in an SI-unit field, neglecting spin: + +$$\begin{aligned} + \boxed{ + \vb{J} + = \mathrm{Re} \Big\{ \psi^* \frac{\vu{p} - q \vb{A}}{m} \psi \Big\} + } +\end{aligned}$$ + + + +## References +1. L.E. Ballentine, + *Quantum mechanics: a modern development*, 2nd edition, + World Scientific. diff --git a/source/know/concept/propagator/index.md b/source/know/concept/propagator/index.md new file mode 100644 index 0000000..3ed7fb7 --- /dev/null +++ b/source/know/concept/propagator/index.md @@ -0,0 +1,69 @@ +--- +title: "Propagator" +date: 2021-07-04 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +In quantum mechanics, the **propagator** $K(x_f, t_f; x_i, t_i)$ +gives the probability amplitude that a particle +starting at $x_i$ at $t_i$ ends up at position $x_f$ at $t_f$. +It is defined as follows: + +$$\begin{aligned} + \boxed{ + K(x_f, t_f; x_i, t_i) + \equiv \matrixel{x_f}{\hat{U}(t_f, t_i)}{x_i} + } +\end{aligned}$$ + +Where $\hat{U} \equiv \exp(- i t \hat{H} / \hbar)$ is the time-evolution operator. +The probability that a particle travels +from $(x_i, t_i)$ to $(x_f, t_f)$ is then given by: + +$$\begin{aligned} + P + &= \big| K(x_f, t_f; x_i, t_i) \big|^2 +\end{aligned}$$ + +Given a general (i.e. non-collapsed) initial state $\psi_i(x) \equiv \psi(x, t_i)$, +we must integrate over $x_i$: + +$$\begin{aligned} + P + &= \bigg| \int_{-\infty}^\infty K(x_f, t_f; x_i, t_i) \: \psi_i(x_i) \dd{x_i} \bigg|^2 +\end{aligned}$$ + +And if the final state $\psi_f(x) \equiv \psi(x, t_f)$ +is not a basis vector either, then we integrate twice: + +$$\begin{aligned} + P + &= \bigg| \iint_{-\infty}^\infty \psi_f^*(x_f) \: K(x_f, t_f; x_i, t_i) \: \psi_i(x_i) \dd{x_i} \dd{x_f} \bigg|^2 +\end{aligned}$$ + +Given a $\psi_i(x)$, the propagator can also be used +to find the full final wave function: + +$$\begin{aligned} + \boxed{ + \psi(x_f, t_f) + = \int_{-\infty}^\infty \psi_i(x_i) K(x_f, t_f; x_i, t_i) \:dx_i + } +\end{aligned}$$ + +Sometimes the name "propagator" is also used to refer to +the [fundamental solution](/know/concept/fundamental-solution/) $G$ +of the time-dependent Schrödinger equation, +which is related to $K$ by: + +$$\begin{aligned} + \boxed{ + G(x_f, t_f; x_i, t_i) + = - \frac{i}{\hbar} \: \Theta(t_f - t_i) \: K(x_f, t_f; x_i, t_i) + } +\end{aligned}$$ + +Where $\Theta(t)$ is the [Heaviside step function](/know/concept/heaviside-step-function/). diff --git a/source/know/concept/pulay-mixing/index.md b/source/know/concept/pulay-mixing/index.md new file mode 100644 index 0000000..030ad46 --- /dev/null +++ b/source/know/concept/pulay-mixing/index.md @@ -0,0 +1,160 @@ +--- +title: "Pulay mixing" +date: 2021-03-02 +categories: +- Numerical methods +layout: "concept" +--- + +Some numerical problems are most easily solved *iteratively*, +by generating a series $\rho_1$, $\rho_2$, etc. +converging towards the desired solution $\rho_*$. +**Pulay mixing**, also often called +**direct inversion in the iterative subspace** (DIIS), +can speed up the convergence for some types of problems, +and also helps to avoid periodic divergences. + +The key concept it relies on is the **residual vector** $R_n$ +of the $n$th iteration, which in some way measures the error of the current $\rho_n$. +Its exact definition varies, +but is generally along the lines of the difference between +the input of the iteration and the raw resulting output: + +$$\begin{aligned} + R_n + = R[\rho_n] + = \rho_n^\mathrm{new}[\rho_n] - \rho_n +\end{aligned}$$ + +It is not always clear what to do with $\rho_n^\mathrm{new}$. +Directly using it as the next input ($\rho_{n+1} = \rho_n^\mathrm{new}$) +often leads to oscillation, +and linear mixing ($\rho_{n+1} = (1\!-\!f) \rho_n + f \rho_n^\mathrm{new}$) +can take a very long time to converge properly. +Pulay mixing offers an improvement. + +The idea is to construct the next iteration's input $\rho_{n+1}$ +as a linear combination of the previous inputs $\rho_1$, $\rho_2$, ..., $\rho_n$, +such that it is as close as possible to the optimal $\rho_*$: + +$$\begin{aligned} + \boxed{ + \rho_{n+1} + = \sum_{m = 1}^n \alpha_m \rho_m + } +\end{aligned}$$ + +To do so, we make two assumptions. +Firstly, the current $\rho_n$ is already close to $\rho_*$, +so that such a linear combination makes sense. +Secondly, the iteration is linear, +such that the raw output $\rho_{n+1}^\mathrm{new}$ +is also a linear combination with the *same coefficients*: + +$$\begin{aligned} + \rho_{n+1}^\mathrm{new} + = \sum_{m = 1}^n \alpha_m \rho_m^\mathrm{new} +\end{aligned}$$ + +We will return to these assumptions later. +The point is that $R_{n+1}$ is also a linear combination: + +$$\begin{aligned} + R_{n+1} + = \rho_{n+1}^\mathrm{new} - \rho_{n+1} + = \sum_{m = 1}^n \alpha_m \rho_m^\mathrm{new} - \sum_{m = 1}^n \alpha_m \rho_m + = \sum_{m = 1}^n \alpha_m R_m +\end{aligned}$$ + +The goal is to choose the coefficients $\alpha_m$ such that +the norm of the error $|R_{n+1}| \approx 0$, +subject to the following constraint to preserve the normalization of $\rho_{n+1}$: + +$$\begin{aligned} + \sum_{m=1}^n \alpha_m = 1 +\end{aligned}$$ + +We thus want to minimize the following quantity, +where $\lambda$ is a [Lagrange multiplier](/know/concept/lagrange-multiplier/): + +$$\begin{aligned} + \Inprod{R_{n+1}}{R_{n+1}} + \lambda \sum_{m = 1}^n \alpha_m^* + = \sum_{m=1}^n \alpha_m^* \Big( \sum_{k=1}^n \alpha_k \Inprod{R_m}{R_k} + \lambda \Big) +\end{aligned}$$ + +By differentiating the right-hand side with respect to $\alpha_m^*$ +and demanding that the result is zero, +we get a system of equations that we can write in matrix form, +which is cheap to solve: + +$$\begin{aligned} + \begin{bmatrix} + \Inprod{R_1}{R_1} & \cdots & \Inprod{R_1}{R_n} & 1 \\ + \vdots & \ddots & \vdots & \vdots \\ + \Inprod{R_n}{R_1} & \cdots & \Inprod{R_n}{R_n} & 1 \\ + 1 & \cdots & 1 & 0 + \end{bmatrix} + \cdot + \begin{bmatrix} + \alpha_1 \\ \vdots \\ \alpha_n \\ \lambda + \end{bmatrix} + = + \begin{bmatrix} + 0 \\ \vdots \\ 0 \\ 1 + \end{bmatrix} +\end{aligned}$$ + +From this, we can also see that the Lagrange multiplier +$\lambda = - \Inprod{R_{n+1}}{R_{n+1}}$, +where $R_{n+1}$ is the *predicted* residual of the next iteration, +subject to the two assumptions. + +However, in practice, the earlier inputs $\rho_1$, $\rho_2$, etc. +are much further from $\rho_*$ than $\rho_n$, +so usually only the most recent $N\!+\!1$ inputs $\rho_{n - N}$, ..., $\rho_n$ are used: + +$$\begin{aligned} + \rho_{n+1} + = \sum_{m = n-N}^n \alpha_m \rho_m +\end{aligned}$$ + +You might be confused by the absence of any $\rho_m^\mathrm{new}$ +in the creation of $\rho_{n+1}$, as if the iteration's outputs are being ignored. +This is due to the first assumption, +which states that $\rho_n^\mathrm{new}$ and $\rho_n$ are already similar, +such that they are basically interchangeable. + +Speaking of which, about those assumptions: +while they will clearly become more accurate as $\rho_n$ approaches $\rho_*$, +they might be very dubious in the beginning. +A consequence of this is that the early iterations might get "trapped" +in a suboptimal subspace spanned by $\rho_1$, $\rho_2$, etc. +To say it another way, we would be varying $n$ coefficients $\alpha_m$ +to try to optimize a $D$-dimensional $\rho_{n+1}$, +where in general $D \gg n$, at least in the beginning. + +There is an easy fix to this problem: +add a small amount of the raw residual $R_m$ +to "nudge" $\rho_{n+1}$ towards the right subspace, +where $\beta \in [0,1]$ is a tunable parameter: + +$$\begin{aligned} + \boxed{ + \rho_{n+1} + = \sum_{m = N}^n \alpha_m (\rho_m + \beta R_m) + } +\end{aligned}$$ + +In other words, we end up introducing a small amount of the raw outputs $\rho_m^\mathrm{new}$, +while still giving more weight to iterations with smaller residuals. + +Pulay mixing is very effective for certain types of problems, +e.g. density functional theory, +where it can accelerate convergence by up to two orders of magnitude! + + + +## References +1. P. Pulay, + [Convergence acceleration of iterative sequences. The case of SCF iteration](https://doi.org/10.1016/0009-2614(80)80396-4), + 1980, Elsevier. diff --git a/source/know/concept/quantum-entanglement/index.md b/source/know/concept/quantum-entanglement/index.md new file mode 100644 index 0000000..72aa91b --- /dev/null +++ b/source/know/concept/quantum-entanglement/index.md @@ -0,0 +1,151 @@ +--- +title: "Quantum entanglement" +date: 2021-03-07 +categories: +- Physics +- Quantum mechanics +- Quantum information +layout: "concept" +--- + +Consider a composite quantum system which consists of two subsystems $A$ and $B$, +respectively with basis states $\Ket{a_n}$ and $\Ket{b_n}$. +All accessible states of the sytem $\Ket{\Psi}$ lie in +the tensor product of the subsystems' +[Hilbert spaces](/know/concept/hilbert-space/) $\mathbb{H}_A$ and $\mathbb{H}_B$: + +$$\begin{aligned} + \Ket{\Psi} \in \mathbb{H}_A \otimes \mathbb{H}_B +\end{aligned}$$ + +A subset of these states can be written as the tensor product (i.e. Kronecker product in a basis) +of a state $\Ket{\alpha}$ in $A$ and a state $\Ket{\beta}$ in $B$, +often abbreviated as $\Ket{\alpha} \Ket{\beta}$: + +$$\begin{aligned} + \Ket{\Psi} + = \Ket{\alpha} \Ket{\beta} + = \Ket{\alpha} \otimes \Ket{\beta} +\end{aligned}$$ + +The states that can be written in this way are called **separable**, +and states that cannot are called **entangled**. +Therefore, we are dealing with **quantum entanglement** +if the state of subsystem $A$ cannot be fully described +independently of the state of subsystem $B$, and vice versa. + +To detect and quantify entanglement, +we can use the [density operator](/know/concept/density-operator/) $\hat{\rho}$. +For a pure ensemble in a given (possibly entangled) state $\Ket{\Psi}$, +$\hat{\rho}$ is given by: + +$$\begin{aligned} + \hat{\rho} = \Ket{\Psi} \Bra{\Psi} +\end{aligned}$$ + +From this, we would like to extract the corresponding state of subsystem $A$. +For that purpose, we define the **reduced density operator** $\hat{\rho}_A$ of subsystem $A$ as follows: + +$$\begin{aligned} + \boxed{ + \hat{\rho}_A + = \Tr_B(\hat{\rho}) + = \sum_m \Bra{b_m} \Big( \hat{\rho} \Big) \Ket{b_m} + } +\end{aligned}$$ + +Where $\Tr_B(\hat{\rho})$ is called the **partial trace** of $\hat{\rho}$, +which basically eliminates subsystem $B$ from $\hat{\rho}$. +For a pure composite state $\Ket{\Psi}$, +the resulting $\hat{\rho}_A$ describes a pure state in $A$ if $\Ket{\Psi}$ is separable, +else, if $\Ket{\Psi}$ is entangled, it describes a mixed state in $A$. +In the former case we simply find: + +$$\begin{aligned} + \boxed{ + \Ket{\Psi} = \Ket{\alpha} \otimes \Ket{\beta} + \quad \implies \quad + \hat{\rho}_A = \Ket{\alpha} \Bra{\alpha} + } +\end{aligned}$$ + +We call $\Ket{\Psi}$ **maximally entangled** +if its reduced density operators are **maximally mixed**, +where $N$ is the dimension of $\mathbb{H}_A$ and $\hat{I}$ is the identity matrix: + +$$\begin{aligned} + \hat{\rho}_A + = \frac{1}{N} \hat{I} +\end{aligned}$$ + +Suppose that we are given an entangled pure state +$\Ket{\Psi} \neq \Ket{\alpha} \otimes \Ket{\beta}$. +Then the partial traces $\hat{\rho}_A$ and $\hat{\rho}_B$ +of $\hat{\rho} = \Ket{\Psi} \Bra{\Psi}$ are mixed states with the same probabilities $p_n$ +(assuming $\mathbb{H}_A$ and $\mathbb{H}_B$ have the same dimensions, +which is usually the case): + +$$\begin{aligned} + \hat{\rho}_A + = \Tr_B(\hat{\rho}) + = \sum_n p_n \Ket{a_n} \Bra{a_n} + \qquad \quad + \hat{\rho}_B + = \Tr_A(\hat{\rho}) + = \sum_n p_n \Ket{b_n} \Bra{b_n} +\end{aligned}$$ + +There exists an orthonormal choice +of the subsystem basis states $\Ket{a_n}$ and $\Ket{b_n}$, +such that $\Ket{\Psi}$ can be written as follows, +where $p_n$ are the probabilities in the reduced density operators: + +$$\begin{aligned} + \Ket{\Psi} + = \sum_n \sqrt{p_n} \Big( \Ket{a_n} \otimes \Ket{b_n} \Big) +\end{aligned}$$ + +This is the **Schmidt decomposition**, +and the **Schmidt number** is the number of nonzero terms in the summation, +which can be used to determine if the state $\Ket{\Psi}$ +is entangled (greater than one) or separable (equal to one). + +By looking at the Schmidt decomposition, we can notice that, +if $\hat{O}_A$ and $\hat{O}_B$ are the subsystem observables +with basis eigenstates $\Ket{a_n}$ and $\Ket{b_n}$, +then measurement results of these operators +will be perfectly correlated across $A$ and $B$. +This is a general property of entangled systems, +but beware: correlation does not imply entanglement! + +But what if the composite system is in a mixed state $\hat{\rho}$? +The state is separable if and only if: + +$$\begin{aligned} + \boxed{ + \hat{\rho} + = \sum_m p_m \Big( \hat{\rho}_A \otimes \hat{\rho}_B \Big) + } +\end{aligned}$$ + +Where $p_m$ are probabilities, +and $\hat{\rho}_A$ and $\hat{\rho}_B$ can be any subsystem states. +In reality, it is very hard to determine, using this criterium, +whether an arbitrary given $\hat{\rho}$ is separable or not. + +As a final side note, the expectation value +of an obervable $\hat{O}_A$ acting only on $A$ is given by: + +$$\begin{aligned} + \expval{\hat{O}_A} + = \Tr\!\big(\hat{\rho} \hat{O}_A\big) + = \Tr_A\!\big(\Tr_B(\hat{\rho} \hat{O}_A)\big) + = \Tr_A\!\big(\Tr_B(\hat{\rho}) \hat{O}_A)\big) + = \Tr_A\!\big(\hat{\rho}_A \hat{O}_A\big) +\end{aligned}$$ + + +## References +1. J.B. Brask, + *Quantum information: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/quantum-fourier-transform/index.md b/source/know/concept/quantum-fourier-transform/index.md new file mode 100644 index 0000000..1ebf1d1 --- /dev/null +++ b/source/know/concept/quantum-fourier-transform/index.md @@ -0,0 +1,198 @@ +--- +title: "Quantum Fourier transform" +date: 2021-05-01 +categories: +- Algorithms +- Quantum information +layout: "concept" +--- + +The **quantum Fourier transform (QFT)** is a quantum counterpart +of the classical discrete Fourier transform. +It is defined like so, where $\Ket{x}$ +is an $n$-qubit computational basis state $\Ket{x_1} \cdots \Ket{x_n}$, +and $\omega_N$ is an $N$th complex root of unity $\omega_N^N = 1$ with $N = 2^n$: + +$$\begin{aligned} + \boxed{ + \Ket{x} + \:\to\: + \frac{1}{\sqrt{N}} \sum_{k = 0}^{N - 1} \omega_N^{xk} \Ket{k} + } +\end{aligned}$$ + +Note that $\Ket{x}$ and $\Ket{k}$ refer to the same basis set; +we use these names to clarify which "space" we are considering. +Furthermore, note the sign of the exponent of $\omega_N$, +which is the opposite of the classical DFT convention. +In other words, the *forward* QFT corresponds to the *inverse* DFT. + +The **inverse quantum Fourier transform (iQFT)** has a different sign in the exponent: + +$$\begin{aligned} + \boxed{ + \Ket{k} + \:\to\: + \frac{1}{\sqrt{N}} \sum_{x = 0}^{N - 1} \omega_N^{-xk} \Ket{x} + } +\end{aligned}$$ + +The above definitions of the QFT and iQFT describe +the effect on a single basis vector $\Ket{x}$, +so the effect on an abitrary superposition follows from linearity, +e.g. for the QFT: + +$$\begin{aligned} + \sum_{x = 0}^{N - 1} c_x \Ket{x} + \:\to\: + \sum_{x = 0}^{N - 1} c_x \bigg( \frac{1}{\sqrt{N}} \sum_{k = 0}^{N - 1} \omega_N^{xk} \Ket{k} \bigg) +\end{aligned}$$ + +Classically, such a double sum takes +$\mathcal{O}(N^2) = \mathcal{O}(2^{2n})$ time to evaluate naively, +with a potential improvement to $\mathcal{O}(N \log{N}) = \mathcal{O}(n 2^n)$ +for smarter algorithms. +Quantum computers can do a QFT in $\mathcal{O}(\log^2(N)) = \mathcal{O}(n^2)$ time, +and approximate it in $\mathcal{O}(n \log{n})$ time. + +To find out how, we look at the forward QFT, +which maps a basis state $\Ket{x}$ to another state $\Ket{\tilde{x}}$: + +$$\begin{aligned} + \Ket{x} + \:\to\: + \Ket{\tilde{x}} + = \frac{1}{\sqrt{N}} \sum_{k = 0}^{N - 1} \omega_N^{xk} \Ket{k} + = \frac{1}{\sqrt{N}} \sum_{k = 0}^{N - 1} \exp\!\bigg( \frac{i 2 \pi x k}{N} \bigg) \Ket{k} +\end{aligned}$$ + +We can decompose $k$ into its binary representation +$k_1 2^{n-1} + k_2 2^{n-2} + ... + k_n 2^{0}$: + +$$\begin{aligned} + \Ket{\tilde{x}} + &= \frac{1}{\sqrt{2^n}} \sum_{k = 0}^{2^n - 1} \exp\!\bigg( \frac{i 2 \pi x}{2^n} \sum_{j = 1}^{n} k_j 2^{n-j} \bigg) \Ket{k} + \\ + &= \frac{1}{\sqrt{2^n}} \sum_{k = 0}^{2^n - 1} \exp\!\bigg( i 2 \pi x \sum_{j = 1}^{n} \frac{k_j}{2^j} \bigg) \Ket{k} +\end{aligned}$$ + +Expanding the exponential-of-a-sum into a product-of-exponentials then yields: + +$$\begin{aligned} + \Ket{\tilde{x}} + &= \frac{1}{\sqrt{2^n}} \sum_{k = 0}^{2^n - 1} \prod_{j = 1}^{n} \exp\!\bigg( i 2 \pi x \frac{k_j}{2^j} \bigg) \Ket{k} +\end{aligned}$$ + +If $k_j = 0$, the exponential is zero. +We can thus separate this state into its individual qubits: + +$$\begin{aligned} + \Ket{\tilde{x}} + &= \bigotimes_{j = 1}^{n} \frac{1}{\sqrt{2}} \bigg( \Ket{0} + \exp\!\Big( \frac{i 2 \pi x}{2^j} \Big) \Ket{1} \bigg) +\end{aligned}$$ + +Next, we use the trick from before: +decompose $x$ as $x_1 2^{n-1} + x_2 2^{n-2} + ... + x_n 2^{0}$: + +$$\begin{aligned} + \Ket{\tilde{x}} + &= \bigotimes_{j = 1}^{n} \frac{1}{\sqrt{2}} \bigg( \Ket{0} + \exp\!\Big( i 2 \pi \sum_{r = 1}^{n} x_r 2^{n-r-j} \Big) \Ket{1} \bigg) +\end{aligned}$$ + +The factor $2^{n-r-j}$ may be smaller or bigger than $1$, +so it is convenient for us to use the following notation +for non-integer binary numbers. +Note the decimal point in the middle: + +$$\begin{aligned} + \left[ a_1 \cdots a_{d} \:.\: a_{d+1} \cdots a_{n} \right] + = \sum_{r = 1}^{n} a_r 2^{d - r} +\end{aligned}$$ + +In the above QFT state, the position of the decimal point is $d = n - j$, +so we write it as: + +$$\begin{aligned} + \Ket{\tilde{x}} + &= \bigotimes_{j = 1}^{n} \frac{1}{\sqrt{2}} \bigg( \Ket{0} + + \exp\!\Big( i 2 \pi \big[ x_1 \cdots x_{n-j} \:.\: x_{n-j+1} \cdots x_n \big] \Big) \Ket{1} \bigg) +\end{aligned}$$ + +Because $\exp(i 2 \pi m) = 1$ for all integers $m$, +we can discard bits before the decimal point: + +$$\begin{aligned} + \Ket{\tilde{x}} + &= \frac{1}{\sqrt{2^n}} \bigotimes_{j = 1}^{n} \bigg( \Ket{0} + \exp\!\Big( i 2 \pi \big[ 0\:.\: x_{n-j+1} \cdots x_n \big] \Big) \Ket{1} \bigg) + \\ + &= \frac{1}{\sqrt{2^n}} \bigg( \Ket{0} + \exp\!\Big( i 2 \pi \big[ 0. x_n \big] \Big) \Ket{1} \bigg) + \otimes \bigg( \Ket{0} + \exp\!\Big( i 2 \pi \big[ 0. x_{n-1} x_n \big] \Big) \Ket{1} \bigg) + \otimes \cdots +\end{aligned}$$ + +Furthermore, each exponential can be factorized, +with every factor containing one bit of $x$: + +$$\begin{aligned} + \exp\!\Big( i 2 \pi \big[ 0\:.\: x_{n-j+1} \cdots x_n \big] \Big) + = \exp\!\Big( i 2 \pi \frac{x_{n-j+1}}{2} \Big) \cdots \exp\!\Big( i 2 \pi \frac{x_{n}}{2^{j}} \Big) +\end{aligned}$$ + +This suggests a way to implement the QFT using +[quantum gates](/know/concept/quantum-gate/) in a circuit. +If the $j$th qubit is in $\Ket{+} = (\Ket{0} + \Ket{1})/\sqrt{2}$, +then for each bit $x_{n-j+r}$ where $r \in \{1, ..., j\}$: + ++ If $x_{n-j+r} = 0$, do nothing. ++ If $x_{n-j+r} = 1$, add a relative phase $2 \pi / 2^{r}$. + +The full QFT algorithm therefore proceeds as follows, +for the $(n\!-\!j\!+\!1)$'th input $\Ket{x_{n-j+1}}$: + +1. Apply the Hadamard gate $H$. + If $x_{n-j+1} = 0$, this puts the qubit in $\Ket{+}$. + If $x_{n-j+1} = 1$, this puts the qubit in $\Ket{+}$, + and then adds a phase $\pi$, yielding $\Ket{-}$. +2. Apply the phase shift gate $R_{\phi}$ controlled by $x_{n-j+2}$, + with angle $\phi = 2 \pi / 2^{2}$. +3. Apply $R_{\phi}$ controlled by $x_{n-j+3}$, + with angle $\phi = 2 \pi / 2^{3}$... +4. And so on, until the $n$th bit $x_n$ is reached, + and used to control $R_\phi$ with $\phi = 2 \pi / 2^{j}$. + +And so on, for each $j \in \{1, ..., n\}$, +and we reach the above expression for $\Ket{\tilde{x}}$. +We started from the $(n\!-\!j\!+\!1)$'th input qubit, +i.e. we read the input in reverse order. +Therefore all the qubits need to be swapped back to front, +either before or after the above algorithm is run. + +The quantum circuit to execute the mentioned steps is illustrated below, +excluding the swapping part to get the right order. +Here, $R_m$ means $R_\phi$ with $\phi = 2 \pi / 2^m$: + +<a href="qft-circuit-noswap.png"> +<img src="qft-circuit-noswap.png" style="width:100%"> +</a> + +Again, note how the inputs $\Ket{x_j}$ and outputs $\Ket{k_j}$ are in the opposite order. +The complete circuit, including the swapping at the end, +therefore looks like this: + +<a href="qft-circuit-swap.png"> +<img src="qft-circuit-swap.png" style="width:85%"> +</a> + +For each of the $n$ qubits, $\mathcal{O}(n)$ gates are applied, +so overall the QFT algorithm is $\mathcal{O}(n^2)$. + + + +## References +1. J.S. Neergaard-Nielsen, + *Quantum information: lectures notes*, + 2021, unpublished. +2. S. Aaronson, + *Introduction to quantum information science: lecture notes*, + 2018, unpublished. + diff --git a/source/know/concept/quantum-fourier-transform/qft-circuit-noswap.png b/source/know/concept/quantum-fourier-transform/qft-circuit-noswap.png Binary files differnew file mode 100644 index 0000000..01f5190 --- /dev/null +++ b/source/know/concept/quantum-fourier-transform/qft-circuit-noswap.png diff --git a/source/know/concept/quantum-fourier-transform/qft-circuit-swap.png b/source/know/concept/quantum-fourier-transform/qft-circuit-swap.png Binary files differnew file mode 100644 index 0000000..6557e3a --- /dev/null +++ b/source/know/concept/quantum-fourier-transform/qft-circuit-swap.png diff --git a/source/know/concept/quantum-gate/cnot.png b/source/know/concept/quantum-gate/cnot.png Binary files differnew file mode 100644 index 0000000..5389d11 --- /dev/null +++ b/source/know/concept/quantum-gate/cnot.png diff --git a/source/know/concept/quantum-gate/cu.png b/source/know/concept/quantum-gate/cu.png Binary files differnew file mode 100644 index 0000000..a75b9e7 --- /dev/null +++ b/source/know/concept/quantum-gate/cu.png diff --git a/source/know/concept/quantum-gate/index.md b/source/know/concept/quantum-gate/index.md new file mode 100644 index 0000000..e7a83b0 --- /dev/null +++ b/source/know/concept/quantum-gate/index.md @@ -0,0 +1,296 @@ +--- +title: "Quantum gate" +date: 2021-03-29 +categories: +- Quantum information +layout: "concept" +--- + +In quantum computing, **quantum gates** are the equivalent +of classical binary logic gates such as $\mathrm{NOT}$, $\mathrm{AND}$, etc. +Because of the continuous nature of qubits, +the number of possible quantum gates is uncountably infinite, +so we only consider the most important examples here. + + +## One-qubit gates + +As an example, consider the following must general single-qubit state $\Ket{\psi}$: + +$$\begin{aligned} + \Ket{\psi} + = \alpha \Ket{0} + \beta \Ket{1} + = \begin{bmatrix} \alpha \\ \beta \end{bmatrix} +\end{aligned}$$ + +Arguably the most famous and/or most fundamental quantum gates are the **Pauli matrices**: + +$$\begin{aligned} + \boxed{ + X = + \begin{bmatrix} + 0 & 1 \\ + 1 & 0 + \end{bmatrix} + } + \qquad + \boxed{ + Y = + \begin{bmatrix} + 0 & -i \\ + i & 0 + \end{bmatrix} + } + \qquad + \boxed{ + Z = + \begin{bmatrix} + 1 & 0 \\ + 0 & -1 + \end{bmatrix} + } +\end{aligned}$$ + +They have the following effect on $\Ket{\psi}$. +Note that $X$ is equivalent to the classical $\mathrm{NOT}$ gate +(and is often given that name), +and $Z$ is sometimes called the **phase-flip gate**: + +$$\begin{aligned} + X \Ket{\psi} + = \begin{bmatrix} \beta \\ \alpha \end{bmatrix} + \qquad + Y \Ket{\psi} + = \begin{bmatrix} -i \beta \\ i \alpha \end{bmatrix} + \qquad + Z \Ket{\psi} + = \begin{bmatrix} \alpha \\ -\beta \end{bmatrix} +\end{aligned}$$ + +In fact, $Z$ is a specific case of the **phase shift gate** $R_\phi$, +which modifies the qubit's phase without changing its amplitudes. +For an angle $\phi$, it is given by: + +$$\begin{aligned} + \boxed{ + R_\phi = + \begin{bmatrix} + 1 & 0 \\ + 0 & e^{i \phi} + \end{bmatrix} + } +\end{aligned}$$ + +For $\phi = \pi$, we recover the Pauli-$Z$ gate. +In general, the action of $R_\phi$ is as follows: + +$$\begin{aligned} + R_\phi \Ket{\psi} + = \begin{bmatrix} \alpha \\ e^{i \phi} \beta \end{bmatrix} +\end{aligned}$$ + +Two common special cases of $R_\phi$ +are $\phi = \pi/2$ and $\phi = \pi/4$, +respectively called $S$ and $T$: + +$$\begin{aligned} + \boxed{ + S = R_{\pi/2} = + \begin{bmatrix} + 1 & 0 \\ + 0 & i + \end{bmatrix} + } + \qquad \quad + \boxed{ + T = R_{\pi/4} = + \frac{1}{\sqrt{2}} + \begin{bmatrix} + \sqrt{2} & 0 \\ + 0 & 1 + i + \end{bmatrix} + } +\end{aligned}$$ + +Finally, we have the **Hadamard gate** $H$, +which is defined as follows: + +$$\begin{aligned} + \boxed{ + H = \frac{1}{\sqrt{2}} + \begin{bmatrix} + 1 & 1 \\ + 1 & -1 + \end{bmatrix} + } +\end{aligned}$$ + +Its action consists of rotating the qubit +by $\pi$ around the axis $(X + Z) / \sqrt{2}$ of the Bloch sphere: + +$$\begin{aligned} + H \Ket{\psi} + = \frac{1}{\sqrt{2}} \begin{bmatrix} \alpha + \beta \\ \alpha - \beta \end{bmatrix} +\end{aligned}$$ + +Notably, it maps the eigenstates of $X$ and $Z$ to each other, +and is its own inverse (i.e. unitary): + +$$\begin{aligned} + H \Ket{0} = \Ket{+} + \qquad + H \Ket{1} = \Ket{-} + \qquad + H \Ket{+} = \Ket{0} + \qquad + H \Ket{-} = \Ket{1} +\end{aligned}$$ + +The **Clifford gates** are a set including $X$, $Y$, $Z$, $H$ and $S$, +or more generally any gates that rotate +by multiples of $\pi/2$ around the Bloch sphere. +This set is **not universal**, meaning that if we start from $\Ket{0}$, +we can only reach $\Ket{0}$, $\Ket{1}$, $\Ket{+}$, $\Ket{-}$, $\Ket{+i}$ $\Ket{-i}$ using these gates. + +If we add *any* non-Clifford gate, for example $T$, +then we can reach any point on the Bloch sphere, +which means that the set is **universal**. + +However, there is a problem: a qubit has an uncountable infinity of states, +but a quantum circuit consists of a countably infinite sequence of gates, at most. +Therefore, technically, we can never reach the whole Bloch sphere, +but we *can* come up with circuits that approximate a target state to some degree $\varepsilon$. +This is the definition of universality: +any state can be approximated. + + +## Two-qubit gates + +As an example, let us consider +the following two pure one-qubit states $\Ket{\psi_1}$ and $\Ket{\psi_2}$: + +$$\begin{aligned} + \Ket{\psi_1} + = \alpha_1 \Ket{0} + \beta_1 \Ket{1} + = \begin{bmatrix} \alpha_1 \\ \beta_1 \end{bmatrix} + \qquad \quad + \Ket{\psi_2} + = \alpha_2 \Ket{0} + \beta_2 \Ket{1} + = \begin{bmatrix} \alpha_2 \\ \beta_2 \end{bmatrix} +\end{aligned}$$ + +The composite state of both qubits, assuming they are pure, +is then their tensor product $\otimes$: + +$$\begin{aligned} + \Ket{\psi_1 \psi_2} + = \Ket{\psi_1} \otimes \Ket{\psi_2} + &= \alpha_1 \alpha_2 \Ket{00} + \alpha_1 \beta_2 \Ket{01} + \beta_1 \alpha_2 \Ket{10} + \beta_1 \beta_2 \Ket{11} + \\ + &= c_{00} \Ket{00} + c_{01} \Ket{01} + c_{10} \Ket{10} + c_{11} \Ket{11} +\end{aligned}$$ + +Note that a two-qubit system may be [entangled](/know/concept/quantum-entanglement/), +in which case the coefficients $c_{00}$ etc. cannot be written as products, +i.e. $\Ket{\psi_2}$ cannot be expressed separately from $\Ket{\psi_1}$, and vice versa. + +In other words, the general action of a two-qubit quantum gate +can be expressed in the basis of $\Ket{00}$, $\Ket{01}$, $\Ket{10}$ and $\Ket{11}$, +but not always in the basis of $\Ket{0}_1$, $\Ket{1}_1$, $\Ket{0}_2$ and $\Ket{1}_2$. + +With that said, the first two-qubit gate is $\mathrm{SWAP}$, +which simply swaps $\Ket{\psi_1}$ and $\Ket{\psi_2}$: + +<a href="swap.png"> +<img src="swap.png" style="width:22%"> +</a> + +$$\begin{aligned} + \boxed{ + \mathrm{SWAP} = + \begin{bmatrix} + 1 & 0 & 0 & 0 \\ + 0 & 0 & 1 & 0 \\ + 0 & 1 & 0 & 0 \\ + 0 & 0 & 0 & 1 + \end{bmatrix} + } +\end{aligned}$$ + +This matrix is given in the basis of $\Ket{00}$, $\Ket{01}$, $\Ket{10}$ and $\Ket{11}$. +Note that $\mathrm{SWAP}$ cannot generate entanglement, +so if its input is separable, its output is too. +In any case, its effect is clear: + +$$\begin{aligned} + \mathrm{SWAP} \Ket{\psi_1 \psi_2} + &= c_{00} \Ket{00} + c_{10} \Ket{01} + c_{01} \Ket{10} + c_{11} \Ket{11} +\end{aligned}$$ + +Next, there is the **controlled NOT gate** $\mathrm{CNOT}$, +which "flips" (applies $X$ to) $\Ket{\psi_2}$ if $\Ket{\psi_1}$ is true: + +<a href="cnot.png"> +<img src="cnot.png" style="width:22%"> +</a> + +$$\begin{aligned} + \boxed{ + \mathrm{CNOT} = + \begin{bmatrix} + 1 & 0 & 0 & 0 \\ + 0 & 1 & 0 & 0 \\ + 0 & 0 & 0 & 1 \\ + 0 & 0 & 1 & 0 + \end{bmatrix} + } +\end{aligned}$$ + +That is, it swaps the last two coefficients $c_{10}$ and $c_{11}$ in the composite state vector: + +$$\begin{aligned} + \mathrm{CNOT} \Ket{\psi_1 \psi_2} + &= c_{00} \Ket{00} + c_{01} \Ket{01} + c_{11} \Ket{10} + c_{10} \Ket{11} +\end{aligned}$$ + +More generally, from every one-qubit gate $U$, +we can define a two-qubit **controlled U gate** $\mathrm{CU}$, +which applies $U$ to $\Ket{\psi_2}$ if $\Ket{\psi_1}$ is true: + +<a href="cu.png"> +<img src="cu.png" style="width:22%"> +</a> + +$$\begin{aligned} + \boxed{ + \mathrm{CU} = + \begin{bmatrix} + 1 & 0 & 0 & 0 \\ + 0 & 1 & 0 & 0 \\ + 0 & 0 & u_{00} & u_{01} \\ + 0 & 0 & u_{10} & u_{11} + \end{bmatrix} + } +\end{aligned}$$ + +Where the lower-right 2x2 block is simply $U$. +The general action of this gate is given by: + +$$\begin{aligned} + \mathrm{CU} \Ket{\psi_1 \psi_2} + &= c_{00} \Ket{00} + c_{01} \Ket{01} + (c_{10} u_{00} + c_{11} u_{01}) \Ket{10} + (c_{10} u_{10} + c_{11} u_{11}) \Ket{11} +\end{aligned}$$ + +A set of gates is **universal** if all possible mappings +from $n$ to $n$ qubits can be approximated using only these gates. +A minimal universal set is $\{\mathrm{CNOT}, T, S\}$, +and there exist many others. + + +## References +1. J.S. Neergaard-Nielsen, + *Quantum information: lectures notes*, + 2021, unpublished. +2. S. Aaronson, + *Introduction to quantum information science: lecture notes*, + 2018, unpublished. diff --git a/source/know/concept/quantum-gate/swap.png b/source/know/concept/quantum-gate/swap.png Binary files differnew file mode 100644 index 0000000..2262c53 --- /dev/null +++ b/source/know/concept/quantum-gate/swap.png diff --git a/source/know/concept/quantum-teleportation/index.md b/source/know/concept/quantum-teleportation/index.md new file mode 100644 index 0000000..24df7ed --- /dev/null +++ b/source/know/concept/quantum-teleportation/index.md @@ -0,0 +1,145 @@ +--- +title: "Quantum teleportation" +date: 2021-03-07 +categories: +- Quantum information +layout: "concept" +--- + +**Quantum teleportation** is a method to transfer quantum information +between systems without the use of a quantum channel. +It is based on [quantum entanglement](/know/concept/quantum-entanglement/). + +Suppose that Alice has a qubit $\Ket{q}_{A'}$ that she wants to send to Bob. +Since she has not measured it yet, she does not know $\alpha$ or $\beta$; +she just wants Bob to get the same qubit: + +$$\begin{aligned} + \Ket{q} + = \alpha \Ket{0}_{A'} + \beta \Ket{1}_{A'} +\end{aligned}$$ + +She can only directly communicate with Bob over a classical channel. +This is not enough: even if Alice did know $\alpha$ and $\beta$ exactly +(which would need her having infinitely many copies to measure), +sending an arbitrary real number requires an infinite amount of classical data. + +However, between them, she and Bob also have an entangled [Bell state](/know/concept/bell-state/), +e.g. $\ket{\Phi^+}_{AB}$ (it does not matter which Bell state it is) +The state of the composite system is then as follows, +with $A'$ being Alice' qubit, $A$ her side of the Bell state, and $B$ Bob's side: + +$$\begin{aligned} + \Ket{q}_{A'} \otimes \ket{\Phi^+}_{AB} + &= \frac{1}{\sqrt{2}} \Big( \alpha \Ket{0} + \beta \Ket{1} \Big)_{A'} \Big( \Ket{00} + \Ket{11} \Big)_{AB} + \\ + &= \frac{1}{\sqrt{2}} \Big( \alpha \Ket{000} + \beta \Ket{100} + + \alpha \Ket{011} + \beta \Ket{111} \Big)_{A'AB} +\end{aligned}$$ + +Now, observe that we can write any combination of $\Ket{0}$ and $\Ket{1}$ +in the Bell basis like so: + +$$\begin{aligned} + \Ket{00} + &= \frac{\Ket{\Phi^{+}} + \Ket{\Phi^{-}}}{\sqrt{2}} + \qquad \quad + \Ket{11} + = \frac{\Ket{\Phi^{+}} - \Ket{\Phi^{-}}}{\sqrt{2}} + \\ + \Ket{01} + &= \frac{\Ket{\Psi^{+}} + \Ket{\Psi^{-}}}{\sqrt{2}} + \qquad \quad + \Ket{10} + = \frac{\Ket{\Psi^{+}} - \Ket{\Psi^{-}}}{\sqrt{2}} +\end{aligned}$$ + +Using this, we can rewrite our previous result in terms of the Bell states as follows: + +$$\begin{aligned} + \Ket{q}_{A'} \ket{\Phi^+}_{AB} + &= \frac{\alpha}{2} \Big( \ket{\Phi^{+}} + \ket{\Phi^{-}} \Big)_{A'A} \Ket{0}_B + + \frac{\beta}{2} \Big( \ket{\Psi^{+}} - \ket{\Psi^{-}} \Big)_{A'A} \Ket{0}_B + \\ + &+ \frac{\alpha}{2} \Big( \ket{\Psi^{+}} + \ket{\Psi^{-}} \Big)_{A'A} \Ket{1}_B + + \frac{\beta}{2} \Big( \ket{\Phi^{+}} - \ket{\Phi^{-}} \Big)_{A'A} \Ket{1}_B +\end{aligned}$$ + +If we group all terms according to the Bell states, +we end up with an interesting expression: + +$$\begin{aligned} + \Ket{q}_{A'} \ket{\Phi^+}_{AB} + = \frac{1}{2} \bigg( &\ket{\Phi^{+}}_{A'A} \Big( \alpha \Ket{0} + \beta \Ket{1} \Big)_{B} + + \ket{\Phi^{-}}_{A'A} \Big( \alpha \Ket{0} - \beta \Ket{1} \Big)_{B} + \\ + + &\ket{\Psi^{+}}_{A'A} \Big( \alpha \Ket{1} + \beta \Ket{0} \Big)_{B} + + \ket{\Psi^{-}}_{A'A} \Big( \alpha \Ket{1} - \beta \Ket{0} \Big)_{B} \bigg) +\end{aligned}$$ + +Thus, purely due to entanglement, +Bob's qubit $B$ is in a superposition of the following states: + +$$\begin{aligned} + \Ket{q} + &= \alpha \Ket{0} + \beta \Ket{1} + \qquad \quad + \quad \hat{\sigma}_z \Ket{q} + = \alpha \Ket{0} - \beta \Ket{1} + \\ + \hat{\sigma}_x \Ket{q} + &= \alpha \Ket{1} + \beta \Ket{0} + \qquad \quad + \hat{\sigma}_x \hat{\sigma}_z \Ket{q} + = \alpha \Ket{1} - \beta \Ket{0} +\end{aligned}$$ + +Consequently, Alice and Bob are sharing (or, to be precise, seeing different sides of) +the following entangled three-qubit state: + +$$\begin{aligned} + \Ket{q}_{A'} \ket{\Phi^+}_{AB} + = \frac{1}{2} \bigg( &\ket{\Phi^{+}}_{A'A} \Big( \Ket{q} \Big)_B \quad\, + \ket{\Phi^{-}}_{A'A} \Big( \hat{\sigma}_z \Ket{q} \Big)_B + \\ + + &\ket{\Psi^{+}}_{A'A} \Big( \hat{\sigma}_x \Ket{q} \Big)_B + \ket{\Psi^{-}}_{A'A} \Big( \hat{\sigma}_x \hat{\sigma}_z \Ket{q} \Big)_B \bigg) +\end{aligned}$$ + +The point is that, thanks to the initial entanglement between Alice and Bob, +adding $\Ket{q}_{A'}$ into the mix somehow "teleports" that information to Bob, +although it is not in a usable form yet. + +To finish the process, Alice measures her side $A'A$ in the Bell basis. +Consequently, $A'A$ collapses into one of +$\ket{\Phi^{+}}$, $\ket{\Phi^{-}}$, $\ket{\Psi^{+}}$, $\ket{\Psi^{-}}$ +with equal probability, and she knows which. +This collapse leaves Bob's side $B$ in $\Ket{q}$, $\hat{\sigma}_z \Ket{q}$, +$\hat{\sigma}_x \Ket{q}$, or $\hat{\sigma}_x \hat{\sigma}_z \Ket{q}$, respectively. +The entanglement between $A$ and $B$ is thus broken, +and instead Alice has local entanglement between $A'$ and $A$. + +She then uses the classical channel to tell Bob her result, +who then either does nothing (for $\Ket{q}$), +applies $\hat{\sigma}_z$ (for $\hat{\sigma}_z \Ket{q}$), +applies $\hat{\sigma}_x$ (for $\hat{\sigma}_x \Ket{q}$), +or applies $\hat{\sigma}_z \hat{\sigma}_x$ (for $\hat{\sigma}_x \hat{\sigma}_z \Ket{q}$). +Then, due to the fact that $\hat{\sigma}_x^2 = \hat{\sigma}_z^2 = \hat{I}$, +he recovers $\Ket{q}$ in his local qubit $B$. + +This is not violating the [no-cloning theorem](/know/concept/no-cloning-theorem) +because Alice does not require any knowledge of $\Ket{q}$, +and after the measurement, her qubit $A'$ will no longer be in that state. +In other words, quantum teleportation *moves* states, +rather than copying them. + +Nor does this conflict with Einstein's relativity, +since the information travels no faster than light: +the entangled $\ket{\Phi^{+}}_{AB}$ state must be distributed in advance, +and Alice' declaration of her result is sent classically. +Before receiving that, Bob only sees his side of the maximally entangled +Bell state $\ket{\Phi^{+}}_{AB}$, which contains nothing of $\Ket{q}$. + + +## References +1. J.B. Brask, + *Quantum information: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/rabi-oscillation/index.md b/source/know/concept/rabi-oscillation/index.md new file mode 100644 index 0000000..8f2b918 --- /dev/null +++ b/source/know/concept/rabi-oscillation/index.md @@ -0,0 +1,215 @@ +--- +title: "Rabi oscillation" +date: 2021-09-22 +categories: +- Physics +- Quantum mechanics +- Two-level system +- Optics +layout: "concept" +--- + +In quantum mechanics, from the derivation of +[time-dependent perturbation theory](/know/concept/time-dependent-perturbation-theory/), +we know that a time-dependent term $\hat{H}_1$ in the Hamiltonian +affects the state as follows, +where $c_n(t)$ are the coefficients of the linear combination +of basis states $\Ket{n} \exp(-i E_n t / \hbar)$: + +$$\begin{aligned} + i \hbar \dv{c_m}{t} + = \sum_{n} c_n(t) \matrixel{m}{\hat{H}_1}{n} \exp(i \omega_{mn} t) +\end{aligned}$$ + +Where $\omega_{mn} \equiv (E_m \!-\! E_n) / \hbar$ +for energies $E_m$ and $E_n$. +Note that this equation is exact, +despite being used for deriving perturbation theory. +Consider a two-level system where $n \in \{a, b\}$, +in which case the above equation can be expanded to the following: + +$$\begin{aligned} + \dv{c_a}{t} + &= - \frac{i}{\hbar} \matrixel{a}{\hat{H}_1}{b} \exp(- i \omega_0 t) \: c_b - \frac{i}{\hbar} \matrixel{a}{\hat{H}_1}{a} \: c_a + \\ + \dv{c_b}{t} + &= - \frac{i}{\hbar} \matrixel{b}{\hat{H}_1}{a} \exp(i \omega_0 t) \: c_a - \frac{i}{\hbar} \matrixel{b}{\hat{H}_1}{b} \: c_b +\end{aligned}$$ + +Where $\omega_0 \equiv \omega_{ba}$ is positive. +We assume that $\hat{H}_1$ has odd spatial parity, +in which case [Laporte's selection rule](/know/concept/selection-rules/) +states that the diagonal matrix elements vanish, leaving: + +$$\begin{aligned} + \dv{c_a}{t} + &= - \frac{i}{\hbar} \matrixel{a}{\hat{H}_1}{b} \exp(- i \omega_0 t) \: c_b + \\ + \dv{c_b}{t} + &= - \frac{i}{\hbar} \matrixel{b}{\hat{H}_1}{a} \exp(i \omega_0 t) \: c_a +\end{aligned}$$ + +We now choose $\hat{H}_1$ to be as follows, +sinusoidally oscillating with a spatially odd $V(\vec{r})$: + +$$\begin{aligned} + \hat{H}_1(t) + = V \cos(\omega t) + = \frac{V}{2} \Big( \exp(i \omega t) + \exp(-i \omega t) \Big) +\end{aligned}$$ + +We insert this into the equations for $c_a$ and $c_b$, +and define $V_{ab} \equiv \matrixel{a}{V}{b}$, leading us to: + +$$\begin{aligned} + \dv{c_a}{t} + &= - i \frac{V_{ab}}{2 \hbar} \Big( \exp\!\big(i (\omega \!-\! \omega_0) t\big) + \exp\!\big(\!-\! i (\omega \!+\! \omega_0) t\big) \Big) \: c_b + \\ + \dv{c_b}{t} + &= - i \frac{V_{ab}}{2 \hbar} \Big( \exp\!\big(i (\omega \!+\! \omega_0) t\big) + \exp\!\big(\!-\! i (\omega \!-\! \omega_0) t\big) \Big) \: c_a +\end{aligned}$$ + +Here, we make the +[rotating wave approximation](/know/concept/rotating-wave-approximation/): +assuming we are close to resonance $\omega \approx \omega_0$, +we argue that $\exp(i (\omega \!+\! \omega_0) t)$ +oscillates so fast that its effect is negligible +when the system is observed over a reasonable time interval. +Dropping those terms leaves us with: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \dv{c_a}{t} + &= - i \frac{V_{ab}}{2 \hbar} \exp\!\big(i (\omega \!-\! \omega_0) t \big) \: c_b + \\ + \dv{c_b}{t} + &= - i \frac{V_{ba}}{2 \hbar} \exp\!\big(\!-\! i (\omega \!-\! \omega_0) t \big) \: c_a + \end{aligned} + } +\end{aligned}$$ + +Now we can solve this system of coupled equations exactly. +We differentiate the first equation with respect to $t$, +and then substitute $\idv{c_b}{t}$ for the second equation: + +$$\begin{aligned} + \dvn{2}{c_a}{t} + &= - i \frac{V_{ab}}{2 \hbar} \bigg( i (\omega - \omega_0) \: c_b + \dv{c_b}{t} \bigg) \exp\!\big(i (\omega \!-\! \omega_0) t \big) + \\ + &= - i \frac{V_{ab}}{2 \hbar} \bigg( i (\omega - \omega_0) \: c_b + - i \frac{V_{ba}}{2 \hbar} \exp\!\big(\!-\! i (\omega \!-\! \omega_0) t \big) \: c_a \bigg) + \exp\!\big(i (\omega \!-\! \omega_0) t \big) + \\ + &= \frac{V_{ab}}{2 \hbar} (\omega - \omega_0) \exp\!\big(i (\omega \!-\! \omega_0) t \big) \: c_b - \frac{|V_{ab}|^2}{(2 \hbar)^2} c_a +\end{aligned}$$ + +In the first term, we recognize $\idv{c_a}{t}$, +which we insert to arrive at an equation for $c_a(t)$: + +$$\begin{aligned} + 0 + = \dvn{2}{c_a}{t} - i (\omega - \omega_0) \dv{c_a}{t} + \frac{|V_{ab}|^2}{(2 \hbar)^2} \: c_a +\end{aligned}$$ + +To solve this, we make the ansatz $c_a(t) = \exp(\lambda t)$, +which, upon insertion, gives us: + +$$\begin{aligned} + 0 + = \lambda^2 - i (\omega - \omega_0) \lambda + \frac{|V_{ab}|^2}{(2 \hbar)^2} +\end{aligned}$$ + +This quadratic equation has two complex roots $\lambda_1$ and $\lambda_2$, +which are found to be: + +$$\begin{aligned} + \lambda_1 + = i \frac{\omega - \omega_0 + \tilde{\Omega}}{2} + \qquad \quad + \lambda_2 + = i \frac{\omega - \omega_0 - \tilde{\Omega}}{2} +\end{aligned}$$ + +Where we have defined the **generalized Rabi frequency** $\tilde{\Omega}$ to be given by: + +$$\begin{aligned} + \boxed{ + \tilde{\Omega} + \equiv \sqrt{(\omega - \omega_0)^2 + \frac{|V_{ab}|^2}{\hbar^2}} + } +\end{aligned}$$ + +So that the general solution $c_a(t)$ is as follows, +where $A$ and $B$ are arbitrary constants, +to be determined from initial conditions (and normalization): + +$$\begin{aligned} + \boxed{ + c_a(t) + = \Big( A \sin(\tilde{\Omega} t / 2) + B \cos(\tilde{\Omega} t / 2) \Big) \exp\!\big(i (\omega \!-\! \omega_0) t / 2 \big) + } +\end{aligned}$$ + +And then the corresponding $c_b(t)$ can be found +from the coupled equation we started at, +or, if we only care about the probability density $|c_a|^2$, +we can use $|c_b|^2 = 1 - |c_a|^2$. +For example, if $A = 0$ and $B = 1$, +we get the following probabilities + +$$\begin{aligned} + |c_a(t)|^2 + &= \cos^2(\tilde{\Omega} t / 2) + = \frac{1}{2} \Big( 1 + \cos(\tilde{\Omega} t) \Big) + \\ + |c_b(t)|^2 + &= \sin^2(\tilde{\Omega} t / 2) + = \frac{1}{2} \Big( 1 - \cos(\tilde{\Omega} t) \Big) +\end{aligned}$$ + +Note that the period was halved by squaring. +This periodic "flopping" of the particle between $\Ket{a}$ and $\Ket{b}$ +is known as **Rabi oscillation**, **Rabi flopping** or the **Rabi cycle**. +This is a more accurate treatment +of the flopping found from first-order perturbation theory. + +The name **generalized Rabi frequency** suggests +that there is a non-general version. +Indeed, the **Rabi frequency** $\Omega$ is based on +the special case of exact resonance $\omega = \omega_0$: + +$$\begin{aligned} + \Omega + \equiv \frac{V_{ba}}{\hbar} +\end{aligned}$$ + +As an example, Rabi oscillation arises +in the [electric dipole approximation](/know/concept/electric-dipole-approximation/), +where $\hat{H}_1$ is: + +$$\begin{aligned} + \hat{H}_1(t) + = - q \vec{r} \cdot \vec{E}_0 \cos(\omega t) +\end{aligned}$$ + +After making the rotating wave approximation, +the resulting Rabi frequency is given by: + +$$\begin{aligned} + \Omega + = - \frac{\vec{d} \cdot \vec{E}_0}{\hbar} +\end{aligned}$$ + +Where $\vec{E}_0$ is the [electric field](/know/concept/electric-field/) amplitude, +and $\vec{d} \equiv q \matrixel{b}{\vec{r}}{a}$ is the transition dipole moment +of the electron between orbitals $\Ket{a}$ and $\Ket{b}$. +Apparently, some authors define $\vec{d}$ with the opposite sign, +thereby departing from its classical interpretation. + + + +## References +1. D.J. Griffiths, D.F. Schroeter, + *Introduction to quantum mechanics*, 3rd edition, + Cambridge. diff --git a/source/know/concept/random-phase-approximation/dyson.png b/source/know/concept/random-phase-approximation/dyson.png Binary files differnew file mode 100644 index 0000000..fb465be --- /dev/null +++ b/source/know/concept/random-phase-approximation/dyson.png diff --git a/source/know/concept/random-phase-approximation/index.md b/source/know/concept/random-phase-approximation/index.md new file mode 100644 index 0000000..ab43a0e --- /dev/null +++ b/source/know/concept/random-phase-approximation/index.md @@ -0,0 +1,179 @@ +--- +title: "Random phase approximation" +date: 2021-12-01 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +Recall that the [self-energy](/know/concept/self-energy/) $\Sigma$ +is defined as a sum of [Feynman diagrams](/know/concept/feynman-diagram/), +which each have an order $n$ equal to the number of interaction lines. +We consider the self-energy in the context of [jellium](/know/concept/jellium/), +so the interaction lines $W$ represent Coulomb repulsion, +and we use [imaginary time](/know/concept/imaginary-time/). + +Let us non-dimensionalize the Feynman diagrams in the self-energy, +by measuring momenta in units of $\hbar k_F$, +and energies in $\epsilon_F = \hbar^2 k_F^2 / (2 m)$. +Each internal variable then gives a factor $k_F^5$, +where $k_F^3$ comes from the 3D momentum integral, +and $k_F^2$ from the energy $1 / \beta$: + +$$\begin{aligned} + \frac{1}{(2 \pi)^3} \int_{-\infty}^\infty \frac{1}{\hbar \beta} \sum_{n = -\infty}^\infty \cdots \:\dd{\vb{k}} + \:\:\sim\:\: + k_F^5 +\end{aligned}$$ + +Meanwhile, every line gives a factor $1 / k_F^2$. +The [Matsubara Green's function](/know/concept/matsubara-greens-function/) $G^0$ +for a system with continuous translational symmetry +is found from [equation-of-motion theory](/know/concept/equation-of-motion-theory/): + +$$\begin{aligned} + W(\vb{k}) = \frac{e^2}{\varepsilon_0 |\vb{k}|^2} + \:\:\sim\:\: + \frac{1}{k_F^2} + \qquad \qquad + G_s^0(\vb{k}, i \omega_n^F) + = \frac{1}{i \hbar \omega_n^F - \varepsilon_\vb{k}} + \:\:\sim\:\: + \frac{1}{k_F^2} +\end{aligned}$$ + +An $n$th-order diagram in $\Sigma$ contains $n$ interaction lines, +$2n\!-\!1$ fermion lines, and $n$ integrals, +so in total it evolves as $1 / k_F^{n-2}$. +In jellium, we know that the electron density is proportional to $k_F^3$, +so for high densities we can rest assured that higher-order terms in $\Sigma$ +converge to zero faster than lower-order terms. + +However, at a given order $n$, not all diagrams are equally important. +In a given diagram, due to momentum conservation, +some interaction lines carry the same momentum variable. +Because $W(\vb{k}) \propto 1 / |\vb{k}|^2$, +small $\vb{k}$ make a large contribution, +and the more interaction lines depend on the same $\vb{k}$, +the larger the contribution becomes. + +In other words, each diagram is dominated by contributions +from the momentum carried by the largest number of interactions. +At order $n$, there is one diagram +where all $n$ interactions carry the same momentum, +and this one dominates all others at this order. + +The **random phase approximation** consists of removing most diagrams +from the defintion of the full self-energy $\Sigma$, +leaving only the single most divergent one at each order $n$, +i.e. the ones where all $n$ interaction lines +carry the same momentum and energy: + +<a href="rpasigma.png"> +<img src="rpasigma.png" style="width:92%"> +</a> + +Where we have defined the **screened interaction** $W^\mathrm{RPA}$, +denoted by a double wavy line: + +<a href="screened.png"> +<img src="screened.png" style="width:95%"> +</a> + +Rearranging the above sequence of diagrams quickly leads to the following +[Dyson equation](/know/concept/dyson-equation/): + +<a href="dyson.png"> +<img src="dyson.png" style="width:55%"> +</a> + +In Fourier space, this equation's linear shape +means it is algebraic, so we can write it out: + +$$\begin{aligned} + \boxed{ + W^\mathrm{RPA} + = W + W \Pi_0 W^\mathrm{RPA} + } +\end{aligned}$$ + +Where we have defined the **pair-bubble** $\Pi_0$ as follows, +with an internal wavevector $\vb{q}$, fermionic frequency $i \omega_m^F$, and spin $s$. +Abbreviating $\tilde{\vb{k}} \equiv (\vb{k}, i \omega_n^B)$ +and $\tilde{\vb{q}} \equiv (\vb{q}, i \omega_n^F)$: + +<a href="pairbubble.png"> +<img src="pairbubble.png" style="width:45%"> +</a> + +We isolate the Dyson equation for $W^\mathrm{RPA}$, +which reveals its physical interpretation as a *screened* interaction: +the "raw" interaction $W \!=\! e^2 / (\varepsilon_0 |\vb{k}|^2)$ +is weakened by a term containing $\Pi_0$: + +$$\begin{aligned} + W^\mathrm{RPA}(\vb{k}, i \omega_n^B) + = \frac{W(\vb{k})}{1 - W(\vb{k}) \: \Pi_0(\vb{k}, i \omega_n^B)} + = \frac{e^2}{\varepsilon_0 |\vb{k}|^2 - e^2 \Pi_0(\vb{k}, i \omega_n^B)} +\end{aligned}$$ + +Let us evaluate the pair-bubble $\Pi_0$ more concretely. +The Feynman diagram translates to: + +$$\begin{aligned} + -\hbar \Pi_0(\vb{k}, i \omega_n^B) + &= - \sum_{s} \frac{1}{(2 \pi)^3} \int \frac{1}{\hbar \beta} \sum_{m = -\infty}^\infty + \hbar G_s(\vb{k} \!+\! \vb{q}, i \omega_n^B \!+\! i \omega_m^F) \: \hbar G_s(\vb{q}, i \omega_m^F) \dd{\vb{q}} + \\ + &= - \frac{2 \hbar}{(2 \pi)^3} \int \frac{1}{\beta} \sum_{m = -\infty}^\infty + \frac{1}{i \hbar \omega_n^B + i \hbar \omega_m^F - \varepsilon_{\vb{k}+\vb{q}}} \: \frac{1}{i \hbar \omega_m^F - \varepsilon_{\vb{q}}} \dd{\vb{q}} +\end{aligned}$$ + +Here we recognize a [Matsubara sum](/know/concept/matsubara-sum/), +and rewrite accordingly. +Note that the residues of $n_F$ are $1 / (\hbar \beta)$ +when it is a function of frequency, +and $1 / \beta$ when it is a function of energy, so: + +$$\begin{aligned} + \Pi_0(\vb{k}, i \omega_n^B) + &= \frac{2}{(2 \pi)^3} \int + \frac{n_F(\varepsilon_{\vb{k}+\vb{q}} - i \hbar \omega_n^B)}{(\varepsilon_{\vb{k}+\vb{q}} - i \hbar \omega_n^B) - \varepsilon_{\vb{q}}} + + \frac{n_F(\varepsilon_{\vb{q}})}{i \hbar \omega_n^B + (\varepsilon_{\vb{q}}) - \varepsilon_{\vb{k}+\vb{q}}} \dd{\vb{q}} + \\ + &= \frac{2}{(2 \pi)^3} \int \frac{n_F(\varepsilon_{\vb{q}}) - n_F(\varepsilon_{\vb{k}+\vb{q}})} + {i \hbar \omega_n^B + \varepsilon_{\vb{q}} - \varepsilon_{\vb{k}+\vb{q}}} \dd{\vb{q}} +\end{aligned}$$ + +Where we have used that $n_F(\varepsilon \!+\! i \hbar \omega_n^B) = n_F(\varepsilon)$. +Analogously to extracting the retarded Green's function $G^R(\omega)$ +from the Matsubara Green's function $G^0(i \omega_n^F)$, +we replace $i \omega_n^F \to \omega \!+\! i \eta$, +where $\eta \to 0^+$ is a positive infinitesimal, +yielding the retarded pair-bubble $\Pi_0^R$: + +$$\begin{aligned} + \boxed{ + \Pi_0^R(\vb{k}, \omega) + = \frac{2}{(2 \pi)^3} \int \frac{n_F(\varepsilon_{\vb{q}}) - n_F(\varepsilon_{\vb{k}+\vb{q}})} + {\hbar (\omega + i \eta) + \varepsilon_{\vb{q}} - \varepsilon_{\vb{k}+\vb{q}}} \dd{\vb{q}} + } +\end{aligned}$$ + +This is as far as we can go before making simplifying assumptions. +Therefore, we leave it at: + +$$\begin{aligned} + \boxed{ + W^\mathrm{RPA}(\vb{k}, \omega) + = \frac{e^2}{\varepsilon_0 |\vb{k}|^2 - e^2 \Pi_0(\vb{k}, \omega)} + } +\end{aligned}$$ + + + +## References +1. H. Bruus, K. Flensberg, + *Many-body quantum theory in condensed matter physics*, + 2016, Oxford. diff --git a/source/know/concept/random-phase-approximation/pairbubble.png b/source/know/concept/random-phase-approximation/pairbubble.png Binary files differnew file mode 100644 index 0000000..8b51c23 --- /dev/null +++ b/source/know/concept/random-phase-approximation/pairbubble.png diff --git a/source/know/concept/random-phase-approximation/rpasigma.png b/source/know/concept/random-phase-approximation/rpasigma.png Binary files differnew file mode 100644 index 0000000..fedc9f5 --- /dev/null +++ b/source/know/concept/random-phase-approximation/rpasigma.png diff --git a/source/know/concept/random-phase-approximation/screened.png b/source/know/concept/random-phase-approximation/screened.png Binary files differnew file mode 100644 index 0000000..bb5ccdd --- /dev/null +++ b/source/know/concept/random-phase-approximation/screened.png diff --git a/source/know/concept/random-variable/index.md b/source/know/concept/random-variable/index.md new file mode 100644 index 0000000..7243d15 --- /dev/null +++ b/source/know/concept/random-variable/index.md @@ -0,0 +1,202 @@ +--- +title: "Random variable" +date: 2021-10-22 +categories: +- Mathematics +- Statistics +- Measure theory +layout: "concept" +--- + +**Random variables** are the bread and butter +of probability theory and statistics, +and are simply variables whose value depends +on the outcome of a random experiment. +Here, we will describe the formal mathematical definition +of a random variable. + + +## Probability space + +A **probability space** or **probability triple** $(\Omega, \mathcal{F}, P)$ +is the formal mathematical model of a given **stochastic experiment**, +i.e. a process with a random outcome. + +The **sample space** $\Omega$ is the set +of all possible outcomes $\omega$ of the experimement. +Those $\omega$ are selected randomly according to certain criteria. +A subset $A \subset \Omega$ is called an **event**, +and can be regarded as a true statement about all $\omega$ in that $A$. + +The **event space** $\mathcal{F}$ is a set of events $A$ +that are interesting to us, +i.e. we have subjectively chosen $\mathcal{F}$ +based on the problem at hand. +Since events $A$ represent statements about outcomes $\omega$, +and we would like to use logic on those statemenets, +we demand that $\mathcal{F}$ is a [$\sigma$-algebra](/know/concept/sigma-algebra/). + +Finally, the **probability measure** or **probability function** $P$ +is a function that maps $A$ events to probabilities $P(A)$. +Formally, $P : \mathcal{F} \to \mathbb{R}$ is defined to satisfy: + +1. If $A \in \mathcal{F}$, then $P(A) \in [0, 1]$. +2. If $A, B \in \mathcal{F}$ do not overlap $A \cap B = \varnothing$, + then $P(A \cup B) = P(A) + P(B)$. +3. The total probability $P(\Omega) = 1$. + +The reason we only assign probability to events $A$ +rather than individual outcomes $\omega$ is that +if $\Omega$ is continuous, all $\omega$ have zero probability, +while intervals $A$ can have nonzero probability. + + +## Random variable + +Once we have a probability space $(\Omega, \mathcal{F}, P)$, +we can define a **random variable** $X$ +as a function that maps outcomes $\omega$ +to another set, usually the real numbers. + +To be a valid real-valued random variable, +a function $X : \Omega \to \mathbb{R}^n$ must satisfy the following condition, +in which case $X$ is said to be **measurable** +from $(\Omega, \mathcal{F})$ to $(\mathbb{R}^n, \mathcal{B}(\mathbb{R}^n))$: + +$$\begin{aligned} + \{ \omega \in \Omega : X(\omega) \in B \} \in \mathcal{F} + \quad \mathrm{for\:any\:} B \in \mathcal{B}(\mathbb{R}^n) +\end{aligned}$$ + +In other words, for a given Borel set +(see [$\sigma$-algebra](/know/concept/sigma-algebra/)) $B \in \mathcal{B}(\mathbb{R}^n)$, +the set of all outcomes $\omega \in \Omega$ that satisfy $X(\omega) \in B$ +must form a valid event; this set must be in $\mathcal{F}$. +The point is that we need to be able to assign probabilities +to statements of the form $X \in [a, b]$ for all $a < b$, +which is only possible if that statement corresponds to an event in $\mathcal{F}$, +since $P$'s domain is $\mathcal{F}$. + +Given such an $X$, and a set $B \subseteq \mathbb{R}$, +the **preimage** or **inverse image** $X^{-1}$ is defined as: + +$$\begin{aligned} + X^{-1}(B) + = \{ \omega \in \Omega : X(\omega) \in B \} +\end{aligned}$$ + +As suggested by the notation, +$X^{-1}$ can be regarded as the inverse of $X$: +it maps $B$ to the event for which $X \in B$. +With this, our earlier requirement that $X$ be measurable +can be written as: $X^{-1}(B) \in \mathcal{F}$ for any $B \in \mathcal{B}(\mathbb{R}^n)$. +This is also often stated as "$X$ is *$\mathcal{F}$-measurable"*. + +Related to $\mathcal{F}$ is the **information** +obtained by observing a random variable $X$. +Let $\sigma(X)$ be the information generated by observing $X$, +i.e. the events whose occurrence can be deduced from the value of $X$, +or, more formally: + +$$\begin{aligned} + \sigma(X) + = X^{-1}(\mathcal{B}(\mathbb{R}^n)) + = \{ A \in \mathcal{F} : A = X^{-1}(B) \mathrm{\:for\:some\:} B \in \mathcal{B}(\mathbb{R}^n) \} +\end{aligned}$$ + +In other words, if the realized value of $X$ is +found to be in a certain Borel set $B \in \mathcal{B}(\mathbb{R}^n)$, +then the preimage $X^{-1}(B)$ (i.e. the event yielding this $B$) +is known to have occurred. + +In general, given any $\sigma$-algebra $\mathcal{H}$, +a variable $Y$ is said to be *"$\mathcal{H}$-measurable"* +if $\sigma(Y) \subseteq \mathcal{H}$, +so that $\mathcal{H}$ contains at least +all information extractable from $Y$. + +Note that $\mathcal{H}$ can be generated by another random variable $X$, +i.e. $\mathcal{H} = \sigma(X)$. +In that case, the **Doob-Dynkin lemma** states +that $Y$ is only $\sigma(X)$-measurable +if $Y$ can always be computed from $X$, +i.e. there exists a function $f$ such that +$Y(\omega) = f(X(\omega))$ for all $\omega \in \Omega$. + +Now, we are ready to define some familiar concepts from probability theory. +The **cumulative distribution function** $F_X(x)$ is +the probability of the event where the realized value of $X$ +is smaller than some given $x \in \mathbb{R}$: + +$$\begin{aligned} + F_X(x) + = P(X \le x) + = P(\{ \omega \in \Omega : X(\omega) \le x \}) + = P(X^{-1}(]\!-\!\infty, x])) +\end{aligned}$$ + +If $F_X(x)$ is differentiable, +then the **probability density function** $f_X(x)$ is defined as: + +$$\begin{aligned} + f_X(x) + = \dv{F_X}{x} +\end{aligned}$$ + + +## Expectation value + +The **expectation value** $\mathbf{E}[X]$ of a random variable $X$ +can be defined in the familiar way, as the sum/integral +of every possible value of $X$ mutliplied by the corresponding probability (density). +For continuous and discrete sample spaces $\Omega$, respectively: + +$$\begin{aligned} + \mathbf{E}[X] + = \int_{-\infty}^\infty x \: f_X(x) \dd{x} + \qquad \mathrm{or} \qquad + \mathbf{E}[X] + = \sum_{i = 1}^N x_i \: P(X \!=\! x_i) +\end{aligned}$$ + +However, $f_X(x)$ is not guaranteed to exist, +and the distinction between continuous and discrete is cumbersome. +A more general definition of $\mathbf{E}[X]$ +is the following Lebesgue-Stieltjes integral, +since $F_X(x)$ always exists: + +$$\begin{aligned} + \mathbf{E}[X] + = \int_{-\infty}^\infty x \dd{F_X(x)} +\end{aligned}$$ + +This is valid for any sample space $\Omega$. +Or, equivalently, a Lebesgue integral can be used: + +$$\begin{aligned} + \mathbf{E}[X] + = \int_\Omega X(\omega) \dd{P(\omega)} +\end{aligned}$$ + +An expectation value defined in this way has many useful properties, +most notably linearity. + +We can also define the familiar **variance** $\mathbf{V}[X]$ +of a random variable $X$ as follows: + +$$\begin{aligned} + \mathbf{V}[X] + = \mathbf{E}\big[ (X - \mathbf{E}[X])^2 \big] + = \mathbf{E}[X^2] - \big(\mathbf{E}[X]\big)^2 +\end{aligned}$$ + +It is also possible to calculate expectation values and variances +adjusted to some given event information: +see [conditional expectation](/know/concept/conditional-expectation/). + + + +## References +1. U.H. Thygesen, + *Lecture notes on diffusions and stochastic differential equations*, + 2021, Polyteknisk Kompendie. diff --git a/source/know/concept/rayleigh-plateau-instability/index.md b/source/know/concept/rayleigh-plateau-instability/index.md new file mode 100644 index 0000000..38973ae --- /dev/null +++ b/source/know/concept/rayleigh-plateau-instability/index.md @@ -0,0 +1,282 @@ +--- +title: "Rayleigh-Plateau instability" +date: 2021-03-10 +categories: +- Physics +- Fluid mechanics +- Perturbation +- Surface tension +layout: "concept" +--- + +In fluid mechanics, the **Rayleigh-Plateau instability** causes +a column of liquid to break up due to surface tension. +It is the reason why a smooth stream of water (e.g. from a tap) +eventually breaks into droplets as it falls. + +Consider an infinitely long cylinder of liquid +with radius $R_0$ and surface tension $\alpha$. +In this case, the [Young-Laplace equation](/know/concept/young-laplace-law/) +states that its internal pressure +is a constant $p_i$ expressed as follows, +where $p_o$ is the exterior air pressure: + +$$\begin{aligned} + p_i + = p_o + \frac{\alpha}{R_0} +\end{aligned}$$ + +We assume that the liquid is at rest. +Alternatively, if it is moving in the $z$-direction, +we can also let our coordinate system travel at the same speed. +Anyway, for convenience, +we neglect any motion or acceleration of the liquid column. + +Next, we add a perturbation $p_\epsilon$, assumed to be small, +to the internal pressure, which we allow to vary with time and space. +We use cylindrical coordinates: + +$$\begin{aligned} + p(r, \phi, z, t) = p_i + p_\epsilon(r, \phi, z, t) +\end{aligned}$$ + +This internal pressure difference will cause the liquid to start to flow. +We express the flow velocity as a vector $\vec{u} = (u_r, u_\phi, u_z)$, +which obeys the following Euler equations: + +$$\begin{aligned} + \pdv{\vec{u}}{t} + (\vec{u} \cdot \nabla) \vec{u} + = - \frac{1}{\rho} \nabla p + \qquad \qquad + \nabla \cdot \vec{u} = 0 +\end{aligned}$$ + +The latter equation states that the fluid is incompressible. +We assume that $\vec{u}$ is so small that we can ignore +the quadratic term in the former equation, leaving: + +$$\begin{aligned} + \pdv{\vec{u}}{t} + = - \frac{1}{\rho} \nabla p_\epsilon +\end{aligned}$$ + +Taking the divergence and using incompressibility +yields the Laplace equation for $p_\epsilon$: + +$$\begin{aligned} + - \frac{1}{\rho} \nabla^2 p_\epsilon + = \pdv{}{t}(\nabla \cdot \vec{u}) + = 0 + \qquad \implies \qquad + \nabla^2 p_\epsilon = 0 +\end{aligned}$$ + +We write out the Laplacian in cylindrical coordinates +to get the following problem: + +$$\begin{aligned} + \nabla^2 p_\epsilon + = \pdvn{2}{p_\epsilon}{r} + \frac{1}{r} \pdv{p_\epsilon}{r} + \pdvn{2}{p_\epsilon}{z} + \frac{1}{r^2} \pdvn{2}{p_\epsilon}{\phi} + = 0 +\end{aligned}$$ + +Finally, we add a perturbation $R_\epsilon \ll R_0$ +to the radius of the surface of the liquid column: + +$$\begin{aligned} + R(z, t) + = R_0 + R_\epsilon(z, t) +\end{aligned}$$ + +Note that there is no dependence on the angle $\phi$; +the deformation is assumed to be symmetric. +Imagine the cross-section of the cylinder, +and convince yourself that all asymmetric deformations +will be removed by surface tension, which prefers a circular shape. +We thus assume that $R_\epsilon$, $p_\epsilon$ and $\vec{u}$ +do not depend on $\phi$. +The Laplace equation then reduces to: + +$$\begin{aligned} + \nabla^2 p_\epsilon + = \pdvn{2}{p_\epsilon}{r} + \frac{1}{r} \pdv{p_\epsilon}{r} + \pdvn{2}{p_\epsilon}{z} + = 0 +\end{aligned}$$ + +Before solving this, we need boundary conditions. +The radial fluid velocity $u_r$ (the $r$-component of $\vec{u}$) +at the column surface $r\!=\!R$ is the +[material derivative](/know/concept/material-derivative/) of $R_\epsilon$: + +$$\begin{aligned} + u_r(r\!=\!R) + = \frac{\mathrm{D} R_\epsilon}{\mathrm{D} t} + = \pdv{R_\epsilon}{t} + u_z(r\!=\!R) \pdv{R_\epsilon}{z} +\end{aligned}$$ + +We linearize this by assuming that the deformation $R_\epsilon$ +varies slowly with respect to $z$: + +$$\begin{aligned} + u_r(r\!=\!R) + \approx \pdv{R_\epsilon}{t} +\end{aligned}$$ + +Meanwhile, we can write the boundary condition of the pressure $p$ +in two ways, respectively from the Young-Laplace equation +and the definition of the perturbation $p_\epsilon$: + +$$\begin{aligned} + p(r\!=\!R) + = p_o + \alpha \Big( \frac{1}{R_1} + \frac{1}{R_2} \Big) + \qquad \quad + p(r\!=\!R) + = p_i + p_\epsilon(r\!=\!R) +\end{aligned}$$ + +Where $R_1$ and $R_2$ are the principal curvature radii of the column surface. +These two expressions must be equivalent, +so, by inserting the definition of $p_i = p_o + \alpha / R_0$: + +$$\begin{aligned} + p_o + \alpha \Big( \frac{1}{R_1} + \frac{1}{R_2} \Big) + = p_o + \frac{\alpha}{R_0} + p_\epsilon(r\!=\!R) +\end{aligned}$$ + +Isolating this equation for $p_\epsilon$ yields the desired boundary condition: + +$$\begin{aligned} + p_\epsilon(r\!=\!R) + = \alpha \Big( \frac{1}{R_1} + \frac{1}{R_2} \Big) - \frac{\alpha}{R_0} +\end{aligned}$$ + +The principal radius around the circumference is $R_0 + R_\epsilon$, +while the curvature along the length can be approximated +using the second $z$-derivative of $R_\epsilon$: + +$$\begin{aligned} + p_\epsilon(r\!=\!R) + \approx \alpha \Big( \frac{1}{R_0 + R_\epsilon} - \pdvn{2}{R_\epsilon}{z} \Big) - \frac{\alpha}{R_0} +\end{aligned}$$ + +This can be simplified a bit by using the assumption that $R_\epsilon$ is small: + +$$\begin{aligned} + p_\epsilon(r\!=\!R) + \approx - \alpha \Big( \frac{R_\epsilon}{R_0^2 + R_\epsilon} + \pdvn{2}{R_\epsilon}{z} \Big) + \approx - \alpha \Big( \frac{R_\epsilon}{R_0^2} + \pdvn{2}{R_\epsilon}{z} \Big) +\end{aligned}$$ + +At last, we have all the necessary boundary condition. +We now make the following ansatz, +where $k$ is the wavenumber +and $\sigma$ describes exponential growth or decay: + +$$\begin{aligned} + \vec{u}(r, z, t) + &= \vec{u}(r) \exp(\sigma t) \cos(k z) + \\ + p_\epsilon(r, z, t) + &= p_\epsilon(r) \exp(\sigma t) \cos(k z) + \\ + R_\epsilon(z, t) + &= R_\epsilon \exp(\sigma t) \cos(k z) +\end{aligned}$$ + +This is justified by the fact that we can Fourier-expand any perturbation; +this ansatz is simply the dominant term of the resulting series. + +Inserting this into the Laplace equation for $p_\epsilon$ yields +Bessel's modified equation of order zero: + +$$\begin{aligned} + \dvn{2}{p_\epsilon}{r} + \frac{1}{r} \dv{p_\epsilon}{r} - k^2 p_\epsilon + = 0 +\end{aligned}$$ + +This has well-known solutions: the modified Bessel functions $I_0$ and $K_0$. +However, because $K_0$ diverges at $r = 0$, we must set the constant $B = 0$: + +$$\begin{aligned} + p_\epsilon(r) + = A I_0(kr) + B K_0(kr) + = A I_0(kr) +\end{aligned}$$ + +Inserting the ansatz into the boundary condition for $p_\epsilon$ +gives us the following relation: + +$$\begin{aligned} + p_\epsilon(r\!=\!R) + = - \alpha R_\epsilon \Big( \frac{1}{R_0^2} + k^2 \Big) + = A I_0(k R) +\end{aligned}$$ + +Meanwhile, the linearized Euler equation governing $\vec{u}$ +states that $u_r$ is given by: + +$$\begin{aligned} + \sigma u_r + = - \frac{1}{\rho} \dv{p_\epsilon}{r} + = - \frac{A k}{\rho} I_0'(kr) +\end{aligned}$$ + +Now that we have an expression for $u_r$, +we can revisit its boundary condition: + +$$\begin{aligned} + u_r(r\!=\!R) + = - \frac{A k}{\rho \sigma} I_0'(k R) + = \sigma R_\epsilon +\end{aligned}$$ + +Isolating this for $R_\epsilon$ and inserting it +into the boundary condition for $p_\epsilon$ yields: + +$$\begin{aligned} + p_\epsilon(r\!=\!R) + = A I_0(kR) + = \alpha \Big( \frac{1}{R_0^2} + k^2 \Big) \Big( \frac{A k}{\rho \sigma^2} I_0'(k R) \Big) +\end{aligned}$$ + +Isolating this for the exponential growth/decay parameter $\sigma$ +gives us the desired result, +where we have also used the fact that $R \approx R_0$: + +$$\begin{aligned} + \sigma^2 + = \frac{\alpha k}{\rho R_0^2} (1 - k^2 R_0^2) \frac{I_0'(kR_0)}{I_0(kR_0)} +\end{aligned}$$ + +To get exponential growth (i.e. instability), we need $\sigma^2 > 0$. +Since $(1 - k^2 R_0^2)$ is the only factor that can be negative, +we need $k R_0 < 1$, leading us to the **critical wavelength** $\lambda_c$: + +$$\begin{aligned} + \boxed{ + \lambda_c + = \frac{2 \pi}{k} + = 2 \pi R_0 + } +\end{aligned}$$ + +If the perturbation wavelength $\lambda$ is larger than $\lambda_c$, +surface tension creates a higher pressure in the narrower sections +compared to the wider ones, thereby pumping the liquid into the bulges, +further increasing their size until they become droplets. + +Else, if $\lambda < \lambda_c$, the tighter curvatures +dominate the action of surface tension, +which will then try to smoothen the surface by shrinking the bulges +and widening the constrictions. +In other words, the liquid column is stable in this case. + + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. +2. T. Bohr, A. Andersen, + *The Rayleigh-Plateau instability of a liquid column*, 2020, + unpublished. diff --git a/source/know/concept/rayleigh-plesset-equation/index.md b/source/know/concept/rayleigh-plesset-equation/index.md new file mode 100644 index 0000000..9108d51 --- /dev/null +++ b/source/know/concept/rayleigh-plesset-equation/index.md @@ -0,0 +1,132 @@ +--- +title: "Rayleigh-Plesset equation" +date: 2021-04-06 +categories: +- Physics +- Fluid mechanics +- Fluid dynamics +layout: "concept" +--- + +In fluid dynamics, the **Rayleigh-Plesset equation** +describes how the radius of a spherical bubble evolves in time +inside an incompressible liquid. +Notably, it leads to [cavitation](/know/concept/cavitation/). + +Consider the main +[Navier-Stokes equation](/know/concept/navier-stokes-equations/) +for the velocity field $\va{v}$: + +$$\begin{aligned} + \frac{\mathrm{D} \va{v}}{\mathrm{D} t} + = \pdv{\va{v}}{t} + (\va{v} \cdot \nabla) \va{v} + = - \frac{\nabla p}{\rho} + \nu \nabla^2 \va{v} +\end{aligned}$$ + +We make the ansatz $\va{v} = v(r, t) \vu{e}_r$, +where $\vu{e}_r$ is the basis vector; +in other words, we demand that the only spatial variation of the flow is in $r$. +The above equation then becomes: + +$$\begin{aligned} + \pdv{v}{t} + v \pdv{v}{r} + = - \frac{1}{\rho} \pdv{p}{r} + + \nu \bigg( \frac{1}{r^2} \pdv{}{r}\Big( r^2 \pdv{v}{r} \Big) - \frac{2}{r^2} v \bigg) +\end{aligned}$$ + +Meanwhile, the incompressibility condition +in [spherical coordinates](/know/concept/spherical-coordinates/) yields: + +$$\begin{aligned} + \nabla \cdot \va{v} + = \frac{1}{r^2} \pdv{(r^2 v)}{r} + = 0 +\end{aligned}$$ + +This is only satisfied if $r^2 v$ is constant with respect to $r$, +leading us to a solution $v(r)$ given by: + +$$\begin{aligned} + v(r) + = \frac{C(t)}{r^2} +\end{aligned}$$ + +Where $C(t)$ is an unknown function that does not depend on $r$. +We then insert this result in the main Navier-Stokes equation, +and isolate it for $\ipdv{p}{r}$, yielding: + +$$\begin{aligned} + \pdv{p}{r} + = - \rho \bigg( \frac{1}{r^2} C' - \frac{2}{r^5} C^2 + - \nu \Big( \frac{2}{r^4} C - \frac{2}{r^4} C \Big) \bigg) + = - \rho \bigg( \frac{1}{r^2} C' - \frac{2}{r^5} C^2 \bigg) +\end{aligned}$$ + +Integrating this with respect to $r$ yields the following expression for $p$, +where $p_\infty(t)$ is the (possibly time-dependent) pressure at $r = \infty$: + +$$\begin{aligned} + p(r) + = p_\infty + \rho \bigg( \frac{1}{r} C' - \frac{1}{2 r^4} C^2 \bigg) +\end{aligned}$$ + +From the definition of [viscosity](/know/concept/viscosity/), +we know that the normal [stress](/know/concept/cauchy-stress-tensor/) +$\sigma_{rr}$ in the liquid is given by: + +$$\begin{aligned} + \sigma_{rr}(r) + = - p(r) + 2 \rho \nu \pdv{v(r)}{r} +\end{aligned}$$ + +We now consider a spherical bubble +with radius $R(t)$ and interior pressure $P(t)$ along its surface. +Since we know the liquid pressure $p(r)$, +we can find $P$ from $\sigma_{rr}(r)$. +Furthermore, to include the effects of surface tension, we simply add +the [Young-Laplace law](/know/concept/young-laplace-law/) to $P$: + +$$\begin{aligned} + P + = - \sigma_{rr}(R) + \alpha \frac{2}{R} + = p(R) - 2 \rho \nu \Big( \frac{-2}{R^3} C \Big) + \alpha \frac{2}{R} +\end{aligned}$$ + +We isolate this for $p(R)$, and equate it to +our expression for $p(r)$ +at the surface $r\!=\!R$: + +$$\begin{aligned} + P - \rho \nu \frac{4}{R^3} C - \alpha \frac{2}{R} + = p_\infty + \rho \bigg( \frac{1}{R} C' - \frac{1}{2 R^4} C^2 \bigg) +\end{aligned}$$ + +Isolating for $P$, +and inserting the fact that $R'(t) = v(t)$, +such that $C = r^2 v = R^2 R'$, +yields: + +$$\begin{aligned} + P + &= p_\infty + \rho \bigg( \frac{1}{R} \dv{(R^2 R')}{t} - \frac{1}{2 R^4} (R^2 R')^2 + + \nu \frac{4}{R^3} (R^2 R') \bigg) + \alpha \frac{2}{R} + \\ + &= p_\infty + \rho \bigg( 2 (R')^2 + R R'' - \frac{1}{2} (R')^2 + \nu \frac{4}{R} R' \bigg) + \alpha \frac{2}{R} +\end{aligned}$$ + +Rearranging this and defining $\Delta p \equiv P - p_\infty$ +leads to the Rayleigh-Plesset equation: + +$$\begin{aligned} + \boxed{ + \frac{\Delta p}{\rho} + = R \dvn{2}{R}{t} + \frac{3}{2} \bigg( \dv{R}{t} \bigg)^2 + \nu \frac{4}{R} \dv{R}{t} + \frac{\alpha}{\rho} \frac{2}{R} + } +\end{aligned}$$ + + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/reduced-mass/index.md b/source/know/concept/reduced-mass/index.md new file mode 100644 index 0000000..12c2ce5 --- /dev/null +++ b/source/know/concept/reduced-mass/index.md @@ -0,0 +1,134 @@ +--- +title: "Reduced mass" +date: 2021-07-05 +categories: +- Physics +layout: "concept" +--- + +Problems with two interacting objects can be simplified +by combining them into a pseudo-object with **reduced mass** $\mu$, +whose position equals the relative position of the objects. +For bodies 1 and 2 with respective masses $m_1$ and $m_2$: + +$$\begin{aligned} + \boxed{ + \mu \equiv \frac{m_1 m_2}{m_1 + m_2} + } +\end{aligned}$$ + +If $\va{x}_1$ and $\va{x}_2$ are the objects' respective positions, +then we define +the relative position $\va{x}_r$, +the relative velocity $\va{v}_r$, +and the relative acceleration $\va{a}_r$: + +$$\begin{aligned} + \va{x}_r + \equiv \va{x}_1 - \va{x}_2 + \qquad + \va{v}_r + \equiv \va{v}_1 - \va{v}_2 + = \dv{\va{x}_r}{t} + \qquad \quad + \va{a}_r + \equiv \va{a}_1 - \va{a}_2 + = \dvn{2}{\va{x}_r}{t} +\end{aligned}$$ + +We now choose the coordinate system's origin +to be the center of mass of both objects: + +$$\begin{aligned} + m_1 \va{x}_1 + m_2 \va{x}_2 = 0 +\end{aligned}$$ + +Rearranging and differentiating then yields the following useful equations: + +$$\begin{aligned} + \va{x}_2 = - \frac{m_1}{m_2} \va{x}_1 + \qquad \quad + \va{v}_2 = - \frac{m_1}{m_2} \va{v}_1 + \qquad \quad + \va{a}_2 = - \frac{m_1}{m_2} \va{a}_1 +\end{aligned}$$ + +Using these relations, we can rewrite the relative quantities we defined earlier: + +$$\begin{aligned} + \va{x}_r + = \Big( 1 + \frac{m_1}{m_2} \Big) \va{x}_1 + = \frac{m_1 + m_2}{m_2} \va{x}_1 + \qquad + \va{v}_r + = \frac{m_1 + m_2}{m_2} \va{v}_1 + \qquad + \va{a}_r + = \frac{m_1 + m_2}{m_2} \va{a}_1 +\end{aligned}$$ + +Meanwhile, Newton's third law states that +if object 1 experiences a force $\va{F}_1 = m_1 \va{a}_1$ caused by object 2, +then object 2 experiences an opposite and equal force $\va{F}_2 = - \va{F}_1$. +In fact, our earlier relation between $\va{a}_1$ and $\va{a}_1$ +boils down to Newton's third law: + +$$\begin{aligned} + \va{F}_2 = m_2 \va{a}_2 = - m_1 \va{a}_1 = - \va{F}_1 + \quad \implies \quad + \va{a}_2 = - \frac{m_1}{m_2} \va{a}_1 +\end{aligned}$$ + +With all that in mind, let us take a closer look at the relative acceleration $\va{a}_r$: + +$$\begin{aligned} + \va{a}_r + = \frac{m_1 + m_2}{m_2} \Big( \frac{m_1}{m_1} \Big) \va{a}_1 + = \frac{m_1 + m_2}{m_1 m_2} \big( m_1 \va{a}_1 \big) + = \frac{\va{F}_1}{\mu} + = - \frac{\va{F}_2}{\mu} +\end{aligned}$$ + +Where $\mu$ is the reduced mass, as defined above. +In other words, the relative acceleration $\va{a}_r$ +is just $\va{a}_1 = \va{F}_1 / m_1$ multiplied by $m_1 / \mu$. +This can be regarded as focusing on the dynamics of body 1, +while correcting for the effects of body 2. + +This also suggests the following way +to recover the original positions $\va{x}_1$ and $\va{x}_2$ +from $\va{x}_r$, which you can easily verify for yourself: + +$$\begin{aligned} + \va{x}_1 + = \frac{\mu}{m_1} \va{x}_r + = \frac{m_2}{m_1 + m_2} \va{x}_r + \qquad \quad + \va{x}_2 + = \frac{\mu}{m_2} \va{x}_r + = - \frac{m_1}{m_1 + m_2} \va{x}_r +\end{aligned}$$ + +With this, we can rewrite the total kinetic energy $T$ in an elegant way: + +$$\begin{aligned} + T + &= \frac{1}{2} m_1 \va{v}_1^2 + \frac{1}{2} m_2 \va{v}_2^2 + = \frac{1}{2} m_1 \Big( \frac{\mu}{m_1} \va{v}_r \Big)^2 + \frac{1}{2} m_2 \Big( \frac{\mu}{m_2} \va{v}_r \Big)^2 + \\ + &= \frac{1}{2} \frac{\mu^2}{m_1} \va{v}_r^2 + \frac{1}{2} \frac{\mu^2}{m_2} \va{v}_r^2 + = \frac{1}{2} \Big( \frac{m_2 \mu^2}{m_1 m_2} + \frac{m_1 \mu^2}{m_1 m_2} \Big) \va{v}_r^2 + \\ + &= \frac{1}{2} \frac{(m_1 + m_2) \mu^2}{m_1 m_2} \va{v}_r^2 + = \frac{1}{2} \frac{\mu^2}{\mu} \va{v}_r^2 + = \frac{1}{2} \mu \va{v}_r^2 +\end{aligned}$$ + +Then, assuming that the system's potential energy $V$ +only depends on the distance between the two objects, +i.e. $V = V(|\va{x}_1 - \va{x}_2|) = V(|\va{x}_r|)$, +we just showed that we can rewrite both $T$ and $V$ +to contain only $\mu$ and relative quantities. +This is relevant for both [Lagrangian mechanics](/know/concept/lagrangian-mechanics/) +and [Hamiltonian mechanics](/know/concept/hamiltonian-mechanics/), +where $L = T - V$ and $H = T + V$ respectively. diff --git a/source/know/concept/renyi-entropy/index.md b/source/know/concept/renyi-entropy/index.md new file mode 100644 index 0000000..fc4cc69 --- /dev/null +++ b/source/know/concept/renyi-entropy/index.md @@ -0,0 +1,108 @@ +--- +title: "Rényi entropy" +date: 2021-04-11 +categories: +- Cryptography +layout: "concept" +--- + +In information theory, the **Rényi entropy** is a measure +(or family of measures) of the "suprise" or "information" +contained in a random variable $X$. +It is defined as follows: + +$$\begin{aligned} + \boxed{ + H_\alpha(X) + = \frac{1}{1 - \alpha} \log\!\bigg( \sum_{i = 1}^N p_i^\alpha \bigg) + } +\end{aligned}$$ + +Where $\alpha \ge 0$ is a free parameter. +The logarithm is usually base-2, but variations exist. + +The case $\alpha = 0$ is known as the **Hartley entropy** or **max-entropy**, +and quantifies the "surprise" of an event from $X$, +if $X$ is uniformly distributed: + +$$\begin{aligned} + \boxed{ + H_0(X) + = \log N + } +\end{aligned}$$ + +Where $N$ is the cardinality of $X$; the number of different possible events. +The most famous case, however, is $\alpha = 1$. +Since $H_\alpha$ is problematic for $\alpha \to 1$, we must take the limit: + +$$\begin{aligned} + H_1(X) + = \lim_{\alpha \to 1} H_\alpha(X) + = \lim_{\alpha \to 1} \frac{\log\!\left( \sum_i p_i^\alpha \right)}{1 - \alpha} +\end{aligned}$$ + +We then apply L'Hôpital's rule to evaluate this limit, +and use the fact that all $p_i$ sum to $1$: + +$$\begin{aligned} + H_1(X) + = \lim_{\alpha \to 1} \frac{\displaystyle \dv{}{\alpha}\log\!\left( \sum_i p_i^\alpha \right)}{\displaystyle \dv{}{\alpha}(1 - \alpha)} + = \lim_{\alpha \to 1} \frac{\sum_i p_i^\alpha \log p_i}{- \sum_i p_i^\alpha} + = - \sum_{i = 1}^N p_i \log p_i +\end{aligned}$$ + +This quantity is the **Shannon entropy**, +which is the most general measure of "surprise": + +$$\begin{aligned} + \boxed{ + H_1(X) + = \lim_{\alpha \to 1} H_\alpha(X) + = - \sum_{i = 1}^N p_i \log p_i + } +\end{aligned}$$ + +Next, for $\alpha = 2$, we get the **collision entropy**, which describes +the surprise of two independent and identically distributed variables +$X$ and $Y$ yielding the same event: + +$$\begin{aligned} + \boxed{ + H_2(X) + = - \log\!\bigg( \sum_{i = 1}^N p_i^2 \bigg) + = - \log P(X = Y) + } +\end{aligned}$$ + +Finally, in the limit $\alpha \to \infty$, +the largest probability dominates the sum, +leading to the definition of the **min-entropy** $H_\infty$, +describing the surprise of the most likely event: + +$$\begin{aligned} + \boxed{ + H_\infty(X) + = \lim_{\alpha \to \infty} H_\alpha(x) + = - \log\!\big( \max_{i} p_i \big) + } +\end{aligned}$$ + +It is straightforward to convince yourself that these entropies +are ordered in the following way: + +$$\begin{aligned} + H_0 \ge H_1 \ge H_2 \ge H_\infty +\end{aligned}$$ + +In other words, from left to right, +they go from permissive to conservative, roughly speaking. + + +## References +1. P.A. Bromiley, N.A. Thacker, E. Bouhova-Thacker, + [Shannon entropy, Rényi entropy, and information](https://www.researchgate.net/publication/253537416_Shannon_Entropy_Renyi_Entropy_and_Information), + 2010, University of Manchester. +2. J.B. Brask, + *Quantum information: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/repetition-code/bit-flip-detect.png b/source/know/concept/repetition-code/bit-flip-detect.png Binary files differnew file mode 100644 index 0000000..4928dc1 --- /dev/null +++ b/source/know/concept/repetition-code/bit-flip-detect.png diff --git a/source/know/concept/repetition-code/bit-flip-encode.png b/source/know/concept/repetition-code/bit-flip-encode.png Binary files differnew file mode 100644 index 0000000..e1afe96 --- /dev/null +++ b/source/know/concept/repetition-code/bit-flip-encode.png diff --git a/source/know/concept/repetition-code/index.md b/source/know/concept/repetition-code/index.md new file mode 100644 index 0000000..0e992c4 --- /dev/null +++ b/source/know/concept/repetition-code/index.md @@ -0,0 +1,343 @@ +--- +title: "Repetition code" +date: 2021-05-07 +categories: +- Quantum information +layout: "concept" +--- + +A **repetition code** is a simple approach to error correction: +to protect a bit $x$, make two copies: + +$$\begin{aligned} + 0 \to 000 + \qquad \quad + 1 \to 111 +\end{aligned}$$ + +If a single-bit error occurs, e.g. $000 \to 100$, +a majority vote resets the minority bit. +Clearly, this does not protect against multi-bit errors, +but that is usually not necessary. + +In quantum computing, where error correction is much more important, +repetition codes can also be used, +albeit with some complications, +as discussed below. + + +## Bit flip code + +Suppose that we want to detect errors in +the following arbitrary qubit state $\Ket{\psi}$: + +$$\begin{aligned} + \Ket{\psi} + = \alpha \Ket{0} + \beta \Ket{1} +\end{aligned}$$ + +For now, let us limit ourselves to detecting **bit flips**, +where $\alpha$ and $\beta$ get switched: + +$$\begin{aligned} + \alpha \Ket{0} + \beta \Ket{1} + \quad \to \boxed{\mathrm{Error}} \to \quad + \beta \Ket{0} \!+\! \alpha \Ket{1} +\end{aligned}$$ + +One way to defend against this is +the quantum version of a classical repetition code: + +$$\begin{aligned} + \Ket{\psi} + \quad \to \boxed{\mathrm{Encoder}} \to \quad + \ket{\overline{\psi}} + = \alpha \Ket{000} + \beta \Ket{111} +\end{aligned}$$ + +In other words, a *logical* $\Ket{0}$ (written $\ket{\overline{0}}$) +is represented by 3 *physical* qubits, and vice versa: + +$$\begin{aligned} + \boxed{ + \Ket{0} + \to + \ket{\overline{0}} + = \Ket{000} + \qquad \quad + \Ket{1} + \to + \ket{\overline{1}} + = \Ket{111} + } +\end{aligned}$$ + +Such a transformation is easy to achieve with the following sequence +of [quantum gates](/know/concept/quantum-gate/): + +<a href="bit-flip-encode.png"> +<img src="bit-flip-encode.png" style="width:32%"> +</a> + +So, a little while after encoding the state $\Ket{\psi}$ like that, +a bit flip occurs on the 2nd qubit: + +$$\begin{aligned} + \ket{\overline{\psi}} + \quad \to \boxed{\mathrm{Error}} \to \quad + \alpha \Ket{010} + \beta \Ket{101} +\end{aligned}$$ + +But now there is a problem: how do we detect this error? +We could measure the state, but that would make it collapse, +which is probably not what we want. + +The trick is to use operators called **stabilizers**, +in this case for example $ZZI = Z_1 \otimes Z_2 \otimes I_3$, +where $I$ is identity and $Z$ is the Pauli-$Z$ gate. +The 3-qubit basis states are its eigenvectors: + +$$\begin{alignedat}{2} + ZZI \Ket{000} + &= + \Ket{000} + \qquad + ZZI \Ket{001} + &&= + \Ket{001} + \\ + ZZI \Ket{010} + &= - \Ket{010} + \qquad + ZZI \Ket{011} + &&= - \Ket{011} + \\ + ZZI \Ket{100} + &= - \Ket{100} + \qquad + ZZI \Ket{101} + &&= - \Ket{101} + \\ + ZZI \Ket{110} + &= + \Ket{110} + \qquad + ZZI \Ket{111} + &&= + \Ket{111} +\end{alignedat}$$ + +We could measure $ZZI$ for $\ket{\overline{\psi}}$, +and if the eigenvalue is $-1$, +we know that a bit flip has occurred, +whereas if the eigenvalue is $+1$, +there is *maybe* no error ($\Ket{001}$ and $\Ket{110}$ are false negatives). + +These false negatives are fixed by including another stabilizer $IZZ$, +with these eigenvectors: + +$$\begin{alignedat}{2} + IZZ \Ket{000} + &= + \Ket{000} + \qquad + IZZ \Ket{001} + &&= - \Ket{001} + \\ + IZZ \Ket{010} + &= - \Ket{010} + \qquad + IZZ \Ket{011} + &&= + \Ket{011} + \\ + IZZ \Ket{100} + &= + \Ket{100} + \qquad + IZZ \Ket{101} + &&= - \Ket{101} + \\ + IZZ \Ket{110} + &= - \Ket{110} + \qquad + IZZ \Ket{111} + &&= + \Ket{111} +\end{alignedat}$$ + +In which case $\Ket{100}$ and $\Ket{011}$ are false negatives. +In other words, $IZZ$ cannot detect if the 1st qubit was flipped, +while $ZZI$ cannot protect the 3rd qubit. +But by using both, we know exactly which qubit was flipped +thanks to the eigenvalues: + +<table style="width:30%;margin:auto;text-align:center;"> + <tr> + <th>Error</th> + <th>$ZZI$</th> + <th>$IZZ$</th> + </tr> + <tr> + <td>$I$</td> + <td>$+1$</td> + <td>$+1$</td> + </tr> + <tr> + <td>$X_1$</td> + <td>$-1$</td> + <td>$+1$</td> + </tr> + <tr> + <td>$X_2$</td> + <td>$-1$</td> + <td>$-1$</td> + </tr> + <tr> + <td>$X_1$</td> + <td>$+1$</td> + <td>$-1$</td> + </tr> +</table> + +Where e.g. $X_3$ denotes that the 3rd qubit was flipped. +The measurement outcomes on the last three rows are called **error syndromes**, +and are obtained by a **syndrome measurement**. + +Fortunately, we can measure $ZZI$ and $IZZ$ +without affecting $\ket{\overline{\psi}}$ itself, +by applying $\mathrm{CNOT}$s to some ancillary qubits +and then measuring those: + +<a href="bit-flip-detect.png"> +<img src="bit-flip-detect.png" style="width:62%"> +</a> + +The two measurements, respectively representing $ZZI$ and $IZZ$, +yield $\Ket{1}$ if a bit flip definitely occurred, +and $\Ket{0}$ otherwise. +There is no entanglement, +so the input is untouched. + + +## Phase flip code + +The above system protects us against all single-qubit bit flips. +Unfortunately, that is not enough: +qubits can also experience a **phase flip**: + +$$\begin{aligned} + \alpha \Ket{0} + \beta \Ket{1} + \quad \to \boxed{\mathrm{Error}} \to \quad + \alpha \Ket{0} - \beta \Ket{1} +\end{aligned}$$ + +How to detect that? +If we want to protect against phase flips *instead of* bit flips, +we can simply do the same as before, +but along the $X$-axis intead of the $Z$-axis: + +$$\begin{aligned} + \boxed{ + \Ket{0} + \to + \ket{\overline{0}} + = \Ket{+\!+\!+} + \qquad \quad + \Ket{1} + \to + \ket{\overline{1}} + = \Ket{-\!-\!-} + } +\end{aligned}$$ + +Such that an arbitrary state $\Ket{\psi}$ is encoded as follows, +by the circuit shown below: + +$$\begin{aligned} + \Ket{\psi} + \quad \to \boxed{\mathrm{Encoder}} \to \quad + \ket{\overline{\psi}} + = \alpha \Ket{+\!+\!+} + \beta \Ket{-\!-\!-} +\end{aligned}$$ + +<a href="phase-flip-encode.png"> +<img src="phase-flip-encode.png" style="width:40%"> +</a> + +A phase flip along the $Z$-axis +corresponds to a bit flip along the $X$-axis $\Ket{+} \to \Ket{-}$. +In this case, the stabilizers are $XXI$ and $IXX$, +and the error detection circuit is as follows: + +<a href="phase-flip-detect.png"> +<img src="phase-flip-detect.png" style="width:70%"> +</a> + +This system protects us against all single-qubit phase flips, +but not against bit flips. + + +## Shor code + +What kind of repetition code would we need +if we want to detect both bit flips *and* phase flips? +The most straightforward option is the **Shor code**. +Starting from a phase flip encoding: + +$$\begin{aligned} + \Ket{0} \to + \ket{\overline{0}} + &= \Ket{+\!+\!+} + = \bigg( \frac{\Ket{0} + \Ket{1}}{\sqrt{2}} \bigg)^{\otimes 3} + \\ + \Ket{1} \to + \ket{\overline{1}} + &= \Ket{-\!-\!-} + = \bigg( \frac{\Ket{0} - \Ket{1}}{\sqrt{2}} \bigg)^{\otimes 3} +\end{aligned}$$ + +We add protection against bit flips +by using a repetition code for each physical qubit: + +$$\begin{aligned} + \boxed{ + \ket{\overline{0}} + = \bigg( \frac{\Ket{000} + \Ket{111}}{\sqrt{2}} \bigg)^{\otimes 3} + \qquad \quad + \ket{\overline{1}} + = \bigg( \frac{\Ket{000} - \Ket{111}}{\sqrt{2}} \bigg)^{\otimes 3} + } +\end{aligned}$$ + +This encoding is achieved by the following quantum circuit, +which simply consists of the phase flip encoder, +followed by 3 copies of the bit flip encoder: + +<a href="shor-code-encode.png"> +<img src="shor-code-encode.png" style="width:55%"> +</a> + +We thus use 9 physical qubits to store 1 logical qubit. +Fortunately, more efficient schemes exist. + +The bit flip stabilizers $ZZI$ and $IZZ$ +are applied on a per-block basis, like so: + +$$\begin{aligned} + ZZI \: III \: III \qquad\quad III \: ZZI \: III \qquad\quad III \: III \: ZZI + \\ + IZZ \: III \: III \qquad\quad III \: IZZ \: III \qquad\quad III \: III \: IZZ +\end{aligned}$$ + +Whereas the phase flip stabilizers $XXI$ and $IXX$ +are applied to entire blocks at once: + +$$\begin{aligned} + XXX \: XXX \: III + \qquad \quad + III \: XXX \: XXX +\end{aligned}$$ + + + +## References +1. J.S. Neergaard-Nielsen, + *Quantum information: lectures notes*, + 2021, unpublished. +2. S. Aaronson, + *Introduction to quantum information science: lecture notes*, + 2018, unpublished. + diff --git a/source/know/concept/repetition-code/phase-flip-detect.png b/source/know/concept/repetition-code/phase-flip-detect.png Binary files differnew file mode 100644 index 0000000..f43e706 --- /dev/null +++ b/source/know/concept/repetition-code/phase-flip-detect.png diff --git a/source/know/concept/repetition-code/phase-flip-encode.png b/source/know/concept/repetition-code/phase-flip-encode.png Binary files differnew file mode 100644 index 0000000..0a4f04c --- /dev/null +++ b/source/know/concept/repetition-code/phase-flip-encode.png diff --git a/source/know/concept/repetition-code/shor-code-encode.png b/source/know/concept/repetition-code/shor-code-encode.png Binary files differnew file mode 100644 index 0000000..d112f9b --- /dev/null +++ b/source/know/concept/repetition-code/shor-code-encode.png diff --git a/source/know/concept/residue-theorem/index.md b/source/know/concept/residue-theorem/index.md new file mode 100644 index 0000000..1880ade --- /dev/null +++ b/source/know/concept/residue-theorem/index.md @@ -0,0 +1,71 @@ +--- +title: "Residue theorem" +date: 2021-11-13 +categories: +- Mathematics +- Complex analysis +layout: "concept" +--- + +A function $f(z)$ is **meromorphic** if it is +[holomorphic](/know/concept/holomorphic-function/) +except in a finite number of **simple poles**, +which are points $z_p$ where $f(z_p)$ diverges, +but where the product $(z - z_p) f(z)$ is non-zero +and still holomorphic close to $z_p$. +In other words, $f(z)$ can be approximated close to $z_p$: + +$$\begin{aligned} + f(z) + \approx \frac{R_p}{z - z_p} +\end{aligned}$$ + +Where the **residue** $R_p$ of a simple pole $z_p$ is defined as follows, and +represents the rate at which $f(z)$ diverges close to $z_p$: + +$$\begin{aligned} + \boxed{ + R_p = \lim_{z \to z_p} (z - z_p) f(z) + } +\end{aligned}$$ + +**Cauchy's residue theorem** for meromorphic functions +is a generalization of Cauchy's integral theorem for holomorphic functions, +and states that the integral on a contour $C$ +purely depends on the simple poles $z_p$ enclosed by $C$: + +$$\begin{aligned} + \boxed{ + \oint_C f(z) \dd{z} = i 2 \pi \sum_{z_p} R_p + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-res-theorem"/> +<label for="proof-res-theorem">Proof</label> +<div class="hidden"> +<label for="proof-res-theorem">Proof.</label> +From the definition of a meromorphic function, +we know that we can decompose $f(z)$ like so, +where $h(z)$ is holomorphic and $z_p$ are all its poles: + +$$\begin{aligned} + f(z) = h(z) + \sum_{z_p} \frac{R_p}{z - z_p} +\end{aligned}$$ + +We integrate this over a contour $C$ which contains all poles, and apply +both Cauchy's integral theorem and Cauchy's integral formula to get: + +$$\begin{aligned} + \oint_C f(z) \dd{z} + &= \oint_C h(z) \dd{z} + \sum_{p} R_p \oint_C \frac{1}{z - z_p} \dd{z} + = \sum_{p} R_p \: 2 \pi i +\end{aligned}$$ +</div> +</div> + +This theorem might not seem very useful, +but in fact, by cleverly choosing the contour $C$, +it lets us evaluate many integrals along the real axis, +most notably [Fourier transforms](/know/concept/fourier-transform/). +It can also be used to derive the [Kramers-Kronig relations](/know/concept/kramers-kronig-relations). diff --git a/source/know/concept/reynolds-number/index.md b/source/know/concept/reynolds-number/index.md new file mode 100644 index 0000000..8a8d9aa --- /dev/null +++ b/source/know/concept/reynolds-number/index.md @@ -0,0 +1,158 @@ +--- +title: "Reynolds number" +date: 2021-05-04 +categories: +- Physics +- Fluid mechanics +- Fluid dynamics +layout: "concept" +--- + +The [Navier-Stokes equations](/know/concept/navier-stokes-equations/) +are infamously tricky to solve, +so we would like a way to qualitatively predict +the behaviour of a fluid without needing the flow $\va{v}$. +Consider the main equation: + +$$\begin{aligned} + \pdv{\va{v}}{t} + (\va{v} \cdot \nabla) \va{v} + = - \frac{\nabla p}{\rho} + \nu \nabla^2 \va{v} +\end{aligned}$$ + +In this case, the gravity term $\va{g}$ +has been absorbed into the pressure term: +$p \to p\!+\!\rho \Phi$, +where $\Phi$ is the gravitational scalar potential, +i.e. $\va{g} = - \nabla \Phi$. + +Let us introduce the dimensionless variables $\va{v}'$, $\va{r}'$, $t'$ and $p'$, +where $U$ and $L$ are respectively a characteristic velocity and length +of the system at hand: + +$$\begin{aligned} + \va{v} = U \va{v}' + \qquad + \va{r} = L \va{r}' + \qquad + t = \frac{L}{U} t' + \qquad + p = \rho U^2 p' +\end{aligned}$$ + +In this non-dimenionsalization, the differential operators are scaled as follows: + +$$\begin{aligned} + \pdv{}{t} + = \frac{U}{L} \pdv{}{t'} + \qquad \quad + \nabla + = \frac{1}{L} \nabla' +\end{aligned}$$ + +Putting everything into the main Navier-Stokes equation then yields: + +$$\begin{aligned} + \frac{U^2}{L} \pdv{\va{v}}{t'} + \frac{U^2}{L} (\va{v}' \cdot \nabla') \va{v}' + = - \frac{U^2}{L} \nabla' p' + \frac{U \nu}{L^2} \nabla'^2 \va{v}' +\end{aligned}$$ + +After dividing out $U^2/L$, +we arrive at the form of the original equation again: + +$$\begin{aligned} + \pdv{\va{v}}{t'} + (\va{v}' \cdot \nabla') \va{v}' + = - \nabla' p' + \frac{\nu}{U L} \nabla'^2 \va{v}' +\end{aligned}$$ + +The constant factor of the last term +leads to the definition of the **Reynolds number** $\mathrm{Re}$: + +$$\begin{aligned} + \boxed{ + \mathrm{Re} + \equiv \frac{U L}{\nu} + } +\end{aligned}$$ + +If we choose $U$ and $L$ appropriately for a given system, +the Reynolds number allows us to predict the general trends. +It can be regarded as the inverse of an "effective viscosity": +when $\mathrm{Re}$ is large, viscosity only has a minor role, +but when $\mathrm{Re}$ is small, it dominates the dynamics. + +Another way is thus to see the Reynolds number +as the characteristic ratio between the advective term +(see [material derivative](/know/concept/material-derivative/)) +to the [viscosity](/know/concept/viscosity/) term, +since $\va{v} \sim U$: + +$$\begin{aligned} + \mathrm{Re} + \approx \frac{\big| (\va{v} \cdot \nabla) \va{v} \big|}{\big| \nu \nabla^2 \va{v} \big|} + \approx \frac{U^2 / L}{\nu U / L^2} + = \frac{U L}{\nu} +\end{aligned}$$ + +In other words, $\mathrm{Re}$ +describes the relative strength of intertial and viscous forces. +Returning to the dimensionless Navier-Stokes equation: + +$$\begin{aligned} + \pdv{\va{v}}{t'} + (\va{v}' \cdot \nabla') \va{v}' + = - \nabla' p' + \frac{1}{\mathrm{Re}} \nabla'^2 \va{v}' +\end{aligned}$$ + +For large $\mathrm{Re} \gg 1$, +we can neglect the latter term, +such that redimensionalizing yields: + +$$\begin{aligned} + \pdv{\va{v}}{t} + (\va{v} \cdot \nabla) \va{v} + = - \frac{\nabla p}{\rho} +\end{aligned}$$ + +Which is simply the main [Euler equation](/know/concept/euler-equations/) +for an ideal fluid, i.e. a fluid without viscosity. + + + +## Stokes flow + +A notable case is so-called **Stokes flow** or **creeping flow**, +meaning flow at $\mathrm{Re} \ll 1$. +In this limit, the Navier-Stokes equations can be linearized: +since $\mathrm{Re}$ is the advective-to-viscous ratio, +$\mathrm{Re} \ll 1$ implies that we can ignore the advective term, leaving: + +$$\begin{aligned} + \boxed{ + \pdv{\va{v}}{t} + = - \frac{\nabla p}{\rho} + \nu \nabla^2 \va{v} + } +\end{aligned}$$ + +This equation is called the **unsteady Stokes equation**. +Usually, however, such flows are assumed to be steady +(i.e. time-invariant), leading to the **steady Stokes equation**, +with $\eta = \rho \nu$: + +$$\begin{aligned} + \boxed{ + \nabla p + = \eta \nabla^2 \va{v} + } +\end{aligned}$$ + +This equation is much easier to solve than the full Navier-Stokes equation +thanks to being linear, +and has some interesting properties, such as time-reversibility. + + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. +2. R. Fitzpatrick, + [Dimensionless numbers in incompressible flow](https://farside.ph.utexas.edu/teaching/336L/Fluid/node17.html), + University of Texas. diff --git a/source/know/concept/ritz-method/index.md b/source/know/concept/ritz-method/index.md new file mode 100644 index 0000000..6ea41a4 --- /dev/null +++ b/source/know/concept/ritz-method/index.md @@ -0,0 +1,369 @@ +--- +title: "Ritz method" +date: 2022-09-18 +categories: +- Physics +- Mathematics +- Perturbation +- Quantum mechanics +- Numerical methods +layout: "concept" +--- + +In various branches of physics, +the **Ritz method** is a technique to approximately find the lowest solutions to an eigenvalue problem. +Some call it the **Rayleigh-Ritz method**, the **Ritz-Galerkin method**, +or simply the **variational method**. + + + +## Background + +In the context of [variational calculus](/know/concept/calculus-of-variations/), +consider the following functional to be optimized: + +$$\begin{aligned} + R[u] + = \frac{1}{S} \int_a^b p(x) \big|u_x(x)\big|^2 - q(x) \big|u(x)\big|^2 \dd{x} +\end{aligned}$$ + +Where $u(x) \in \mathbb{C}$ is the unknown function, +and $p(x), q(x) \in \mathbb{R}$ are given. +In addition, $S$ is the norm of $u$, which we demand be constant +with respect to a weight function $w(x) \in \mathbb{R}$: + +$$\begin{aligned} + S + = \int_a^b w(x) \big|u(x)\big|^2 \dd{x} +\end{aligned}$$ + +To handle this normalization requirement, +we introduce a [Lagrange multiplier](/know/concept/lagrange-multiplier/) $\lambda$, +and define the Lagrangian $\Lambda$ for the full constrained optimization problem as: + +$$\begin{aligned} + \Lambda + \equiv \frac{1}{S} \bigg( \big( p |u_x|^2 - q |u|^2 \big) - \lambda \big( w |u|^2 \big) \bigg) +\end{aligned}$$ + +The resulting Euler-Lagrange equation is then calculated in the standard way, yielding: + +$$\begin{aligned} + 0 + &= \pdv{\Lambda}{u^*} - \dv{}{x}\Big( \pdv{\Lambda}{u_x^*} \Big) + \\ + &= - \frac{1}{S} \bigg( q u + \lambda w u + \dv{}{x}\big( p u_x \big) \bigg) +\end{aligned}$$ + +Which is clearly satisfied if and only if the following equation is fulfilled: + +$$\begin{aligned} + \dv{}{x}\big( p u_x \big) + q u + = - \lambda w u +\end{aligned}$$ + +This has the familiar form of a [Sturm-Liouville problem](/know/concept/sturm-liouville-theory/) (SLP), +with $\lambda$ representing an eigenvalue. +SLPs have useful properties, but before we can take advantage of those, +we need to handle an important detail: the boundary conditions (BCs) on $u$. +The above equation is only a valid SLP for certain BCs, +as seen in the derivation of Sturm-Liouville theory. + +Let us return to the definition of $R[u]$, +and integrate it by parts: + +$$\begin{aligned} + R[u] + &= \frac{1}{S} \int_a^b p u_x u_x^* - q u u^* \dd{x} + \\ + &= \frac{1}{S} \Big[ p u_x u^* \Big]_a^b - \frac{1}{S} \int_a^b \dv{}{x}\Big(p u_x\Big) u^* + q u u^* \dd{x} +\end{aligned}$$ + +The boundary term vanishes for a subset of the BCs that make a valid SLP, +including Dirichlet BCs $u(a) = u(b) = 0$, Neumann BCs $u_x(a) = u_x(b) = 0$, and periodic BCs. +Therefore, we assume that this term does indeed vanish, +such that we can use Sturm-Liouville theory later: + +$$\begin{aligned} + R[u] + &= - \frac{1}{S} \int_a^b \bigg( \dv{}{x}\Big(p u_x\Big) + q u \bigg) u^* \dd{x} + \equiv - \frac{1}{S} \int_a^b u^* \hat{H} u \dd{x} +\end{aligned}$$ + +Where $\hat{H}$ is the self-adjoint Sturm-Liouville operator. +Because the constrained Euler-Lagrange equation is now an SLP, +we know that it has an infinite number of real discrete eigenvalues $\lambda_n$ with a lower bound, +corresponding to mutually orthogonal eigenfunctions $u_n(x)$. + +To understand the significance of this result, +suppose we have solved the SLP, +and now insert one of the eigenfunctions $u_n$ into $R$: + +$$\begin{aligned} + R[u_n] + &= - \frac{1}{S_n} \int_a^b u_n^* \hat{H} u_n \dd{x} + = \frac{1}{S_n} \int_a^b u_n^* \lambda_n w u_n \dd{x} + \\ + &= \frac{1}{S_n} \lambda_n \int_a^b w |u_n|^2 \dd{x} + = \frac{S_n}{S_n} \lambda_n +\end{aligned}$$ + +Where $S_n$ is the normalization of $u_n$. +In other words, when given $u_n$, +the functional $R$ yields the corresponding eigenvalue $\lambda_n$: + +$$\begin{aligned} + \boxed{ + R[u_n] + = \lambda_n + } +\end{aligned}$$ + +This powerful result was not at all clear from $R$'s initial definition. + + + +## Justification + +But what if we do not know the eigenfunctions? Is $R$ still useful? +Yes, as we shall see. Suppose we make an educated guess $u(x)$ +for the ground state (i.e. lowest-eigenvalue) solution $u_0(x)$: + +$$\begin{aligned} + u(x) + = u_0(x) + \sum_{n = 1}^\infty c_n u_n(x) +\end{aligned}$$ + +Here, we are using the fact that the eigenfunctions of an SLP form a complete set, +so our (known) guess $u$ can be expanded in the true (unknown) eigenfunctions $u_n$. +We are assuming that $u$ is already quite close to its target $u_0$, +such that the (unknown) expansion coefficients $c_n$ are small; +specifically $|c_n|^2 \ll 1$. +Let us start from what we know: + +$$\begin{aligned} + \boxed{ + R[u] + = - \frac{\displaystyle\int u^* \hat{H} u \dd{x}}{\displaystyle\int u^* w u \dd{x}} + } +\end{aligned}$$ + +This quantity is known as the **Rayleigh quotient**. +Inserting our ansatz $u$, +and using that the true $u_n$ have corresponding eigenvalues $\lambda_n$: + +$$\begin{aligned} + R[u] + &= - \frac{\displaystyle\int \Big( u_0^* + \sum_n c_n^* u_n^* \Big) \: \hat{H} \Big\{ u_0 + \sum_n c_n u_n \Big\} \dd{x}} + {\displaystyle\int w \Big( u_0 + \sum_n c_n u_n \Big) \Big( u_0^* + \sum_n c_n^* u_n^* \Big) \dd{x}} + \\ + &= - \frac{\displaystyle\int \Big( u_0^* + \sum_n c_n^* u_n^* \Big) \Big( \!-\! \lambda_0 w u_0 - \sum_n c_n \lambda_n w u_n \Big) \dd{x}} + {\displaystyle\int w \Big( u_0^* + \sum_n c_n^* u_n^* \Big) \Big( u_0 + \sum_n c_n u_n \Big) \dd{x}} +\end{aligned}$$ + +For convenience, we switch to [Dirac notation](/know/concept/dirac-notation/) +before evaluating further. + +$$\begin{aligned} + R + &= \frac{\displaystyle \Big( \Bra{u_0} + \sum_n c_n^* \Bra{u_n} \Big) \cdot \Big( \lambda_0 \Ket{w u_0} + \sum_n c_n \lambda_n \Ket{w u_n} \Big)} + {\displaystyle \Big( \Bra{u_0} + \sum_n c_n^* \Bra{u_n} \Big) \cdot \Big( \Ket{w u_0} + \sum_n c_n \Ket{w u_n} \Big)} + \\ + &= \frac{\displaystyle \lambda_0 \Inprod{u_0}{w u_0} + \lambda_0 \sum_{n = 1}^\infty c_n^* \Inprod{u_n}{w u_0} + + \sum_{n = 1}^\infty c_n \lambda_n \Inprod{u_0}{w u_n} + \sum_{m n} c_n c_m^* \lambda_n \Inprod{u_m}{w u_n}} + {\displaystyle \Inprod{u_0}{w u_0} + \sum_{n = 1}^\infty c_n^* \Inprod{u_n}{w u_0} + + \sum_{n = 1}^\infty c_n \Inprod{u_0}{w u_n} + \sum_{m n} c_n c_m^* \Inprod{u_m}{w u_n}} +\end{aligned}$$ + +Using orthogonality $\Inprod{u_m}{w u_n} = S_n \delta_{mn}$, +and the fact that $n \neq 0$ by definition, we find: + +$$\begin{aligned} + R + &= \frac{\displaystyle \lambda_0 S_0 + \lambda_0 \sum_n c_n^* S_n \delta_{n0} + + \sum_n c_n \lambda_n S_n \delta_{n0} + \sum_{m n} c_n c_m^* \lambda_n S_n \delta_{mn}} + {\displaystyle S_0 + \sum_n c_n^* S_n \delta_{n0} + \sum_n c_n S_n \delta_{n0} + \sum_{m n} c_n c_m^* S_n \delta_{mn}} + \\ + &= \frac{\displaystyle \lambda_0 S_0 + 0 + 0 + \sum_{n} c_n c_n^* \lambda_n S_n} + {\displaystyle S_0 + 0 + 0 + \sum_{n} c_n c_n^* S_n} + = \frac{\displaystyle \lambda_0 S_0 + \sum_{n} |c_n|^2 \lambda_n S_n} + {\displaystyle S_0 + \sum_{n} |c_n|^2 S_n} +\end{aligned}$$ + +It is always possible to choose our normalizations such that $S_n = S$ for all $u_n$, leaving: + +$$\begin{aligned} + R + &= \frac{\displaystyle \lambda_0 S + \sum_{n} |c_n|^2 \lambda_n S} + {\displaystyle S + \sum_{n} |c_n|^2 S} + = \frac{\displaystyle \lambda_0 + \sum_{n} |c_n|^2 \lambda_n} + {\displaystyle 1 + \sum_{n} |c_n|^2} +\end{aligned}$$ + +And finally, after rearranging the numerator, we arrive at the following relation: + +$$\begin{aligned} + R + &= \frac{\displaystyle \lambda_0 + \sum_{n} |c_n|^2 \lambda_0 + \sum_{n} |c_n|^2 (\lambda_n - \lambda_0)} + {\displaystyle 1 + \sum_{n} |c_n|^2} + = \lambda_0 + \frac{\displaystyle \sum_{n} |c_n|^2 (\lambda_n - \lambda_0)} + {\displaystyle 1 + \sum_{n} |c_n|^2} +\end{aligned}$$ + +Thus, if we improve our guess $u$, +then $R[u]$ approaches the true eigenvalue $\lambda_0$. +For numerically finding $u_0$ and $\lambda_0$, this gives us a clear goal: minimize $R$, because: + +$$\begin{aligned} + \boxed{ + R[u] + = \lambda_0 + \frac{\displaystyle \sum_{n = 1}^\infty |c_n|^2 (\lambda_n - \lambda_0)} + {\displaystyle 1 + \sum_{n = 1}^\infty |c_n|^2} + \ge \lambda_0 + } +\end{aligned}$$ + +In the context of quantum mechanics, this is not surprising, +since any superposition of multiple states +is guaranteed to have a higher energy than the ground state. + +Note that the convergence to $\lambda_0$ goes as $|c_n|^2$, +while $u$ converges to $u_0$ as $|c_n|$ by definition, +so even a fairly bad guess $u$ will give a decent estimate for $\lambda_0$. + + + +## The method + +In the following, we stick to Dirac notation, +since the results hold for both continuous functions $u(x)$ and discrete vectors $\vb{u}$, +as long as the operator $\hat{H}$ is self-adjoint. +Suppose we express our guess $\Ket{u}$ as a linear combination +of *known* basis vectors $\Ket{f_n}$ with weights $a_n \in \mathbb{C}$: + +$$\begin{aligned} + \Ket{u} + = \sum_{n = 0}^\infty c_n \Ket{u_n} + = \sum_{n = 0}^\infty a_n \Ket{f_n} + \approx \sum_{n = 0}^{N - 1} a_n \Ket{f_n} +\end{aligned}$$ + +For numerical tractability, we truncate the sum at $N$ terms, +and for generality, we allow $\Ket{f_n}$ to be non-orthogonal, +as described by an *overlap matrix* with elements $S_{mn}$: + +$$\begin{aligned} + \Inprod{f_m}{w f_n} = S_{m n} +\end{aligned}$$ + +From the discussion above, +we know that the ground-state eigenvalue $\lambda_0$ is estimated by: + +$$\begin{aligned} + \lambda_0 + \approx \lambda + = R[u] + = \frac{\inprod{u}{\hat{H} u}}{\Inprod{u}{w u}} + = \frac{\displaystyle \sum_{m n} a_m^* a_n \inprod{f_m}{\hat{H} f_n}}{\displaystyle \sum_{m n} a_m^* a_n \Inprod{f_m}{w f_n}} + \equiv \frac{\displaystyle \sum_{m n} a_m^* a_n H_{m n}}{\displaystyle \sum_{m n} a_m^* a_n S_{mn}} +\end{aligned}$$ + +And we also know that our goal is to minimize $R[u]$, +so we vary $a_k^*$ to find its extremum: + +$$\begin{aligned} + 0 + = \pdv{R}{a_k^*} + &= \frac{\displaystyle \Big( \sum_{n} a_n H_{k n} \Big) \Big( \sum_{m n} a_n a_m^* S_{mn} \Big) + - \Big( \sum_{n} a_n S_{k n} \Big) \Big( \sum_{m n} a_n a_m^* H_{mn} \Big)} + {\Big( \displaystyle \sum_{m n} a_n a_m^* S_{mn} \Big)^2} + \\ + &= \frac{\displaystyle \Big( \sum_{n} a_n H_{k n} \Big) - R[u] \Big( \sum_{n} a_n S_{k n}\Big)}{\Inprod{u}{w u}} + = \frac{\displaystyle \sum_{n} a_n \big(H_{k n} - \lambda S_{k n}\big)}{\Inprod{u}{w u}} +\end{aligned}$$ + +Clearly, this is only satisfied if the following holds for all $k = 0, 1, ..., N\!-\!1$: + +$$\begin{aligned} + 0 + = \sum_{n = 0}^{N - 1} a_n \big(H_{k n} - \lambda S_{k n}\big) +\end{aligned}$$ + +For illustrative purposes, +we can write this as a matrix equation +with $M_{k n} \equiv H_{k n} - \lambda S_{k n}$: + +$$\begin{aligned} + \begin{bmatrix} + M_{0,0} & M_{0,1} & \cdots & M_{0,N-1} \\ + M_{1,0} & \ddots & & \vdots \\ + \vdots & & \ddots & \vdots \\ + M_{N-1,0} & \cdots & \cdots & M_{N-1,N-1} + \end{bmatrix} + \cdot + \begin{bmatrix} + a_0 \\ a_1 \\ \vdots \\ a_{N-1} + \end{bmatrix} + = + \begin{bmatrix} + 0 \\ 0 \\ \vdots \\ 0 + \end{bmatrix} +\end{aligned}$$ + +Note that this looks like an eigenvalue problem for $\lambda$. +Indeed, demanding that $\overline{M}$ cannot simply be inverted +(i.e. the solution is non-trivial) +yields a characteristic polynomial for $\lambda$: + +$$\begin{aligned} + 0 + = \det\!\Big[ \overline{M} \Big] + = \det\!\Big[ \overline{H} - \lambda \overline{S} \Big] +\end{aligned}$$ + +This gives a set of $\lambda$, +which are the exact eigenvalues of $\overline{H}$, +and the estimated eigenvalues of $\hat{H}$ +(recall that $\overline{H}$ is $\hat{H}$ expressed in a truncated basis). +The eigenvector $\big[ a_0, a_1, ..., a_{N-1} \big]$ of the lowest $\lambda$ +gives the optimal weights to approximate $\Ket{u_0}$ in the basis $\{\Ket{f_n}\}$. +Likewise, the higher $\lambda$'s eigenvectors approximate +excited (i.e. non-ground) eigenstates of $\hat{H}$, +although in practice the results are less accurate the higher we go. + +The overall accuracy is determined by how good our truncated basis is, +i.e. how large a subspace it spans +of the [Hilbert space](/know/concept/hilbert-space/) in which the true $\Ket{u_0}$ resides. +Clearly, adding more basis vectors will improve the results, +at the cost of computation. +For example, if $\hat{H}$ represents a helium atom, +a good choice for $\{\Ket{f_n}\}$ would be hydrogen orbitals, +since those are qualitatively similar. + +You may find this result unsurprising; +it makes some intuitive sense that approximating $\hat{H}$ +in a limited basis would yield a matrix $\overline{H}$ giving rough eigenvalues. +The point of this discussion is to rigorously show +the validity of this approach. + +If we only care about the ground state, +then we already know $\lambda$ from $R[u]$, +so all we need to do is solve the above matrix equation for $a_n$. +Keep in mind that $\overline{M}$ is singular, +and $a_n$ are only defined up to a constant factor. + +Nowadays, there exist many other methods to calculate eigenvalues +of complicated operators $\hat{H}$, +but an attractive feature of the Ritz method is that it is single-step, +whereas its competitors tend to be iterative. +That said, the Ritz method cannot recover from a poorly chosen basis. + + + +## References +1. G.B. Arfken, H.J. Weber, + *Mathematical methods for physicists*, 6th edition, 2005, + Elsevier. +2. O. Bang, + *Applied mathematics for physicists: lecture notes*, 2019, + unpublished. diff --git a/source/know/concept/rotating-wave-approximation/index.md b/source/know/concept/rotating-wave-approximation/index.md new file mode 100644 index 0000000..efb9739 --- /dev/null +++ b/source/know/concept/rotating-wave-approximation/index.md @@ -0,0 +1,120 @@ +--- +title: "Rotating wave approximation" +date: 2022-02-01 +categories: +- Physics +- Quantum mechanics +- Two-level system +- Optics +layout: "concept" +--- + +Consider the following periodic perturbation $\hat{H}_1$ to a quantum system, +which represents e.g. an [electromagnetic wave](/know/concept/electromagnetic-wave-equation/) +in the [electric dipole approximation](/know/concept/electric-dipole-approximation/): + +$$\begin{aligned} + \hat{H}_1(t) + = \hat{V} \cos(\omega t) + = \frac{\hat{V}}{2} \Big( e^{i \omega t} + e^{-i \omega t} \Big) +\end{aligned}$$ + +Where $\hat{V}$ is some operator, and we assume that $\omega$ +is fairly close to a resonance frequency $\omega_0$ +of the system that is getting perturbed by $\hat{H}_1$. + +As an example, consider a two-level system +consisting of states $\Ket{g}$ and $\Ket{e}$, +with a resonance frequency $\omega_0 = (E_e \!-\! E_g) / \hbar$. +From the derivation of +[time-dependent perturbation theory](/know/concept/time-dependent-perturbation-theory/), +we know that the state $\Ket{\Psi} = c_g \Ket{g} + c_e \Ket{e}$ evolves as: + +$$\begin{aligned} + i \hbar \dv{c_g}{t} + &= \matrixel{g}{\hat{H}_1(t)}{g} \: c_g(t) + \matrixel{g}{\hat{H}_1(t)}{e} \: c_e(t) \: e^{- i \omega_0 t} + \\ + i \hbar \dv{c_e}{t} + &= \matrixel{e}{\hat{H}_1(t)}{g} \: c_g(t) \: e^{i \omega_0 t} + \matrixel{e}{\hat{H}_1(t)}{e} \: c_e(t) +\end{aligned}$$ + +Typically, $\hat{V}$ has odd spatial parity, in which case +[Laporte's selection rule](/know/concept/selection-rules/) +reduces this to: + +$$\begin{aligned} + \dv{c_g}{t} + &= \frac{1}{i \hbar} \matrixel{g}{\hat{H}_1}{e} \: c_e \: e^{- i \omega_0 t} + \\ + \dv{c_e}{t} + &= \frac{1}{i \hbar} \matrixel{e}{\hat{H}_1}{g} \: c_g \: e^{i \omega_0 t} +\end{aligned}$$ + +We now insert the general $\hat{H}_1$ defined above, +and define $V_{eg} \equiv \matrixel{e}{\hat{V}}{g}$ to get: + +$$\begin{aligned} + \dv{c_g}{t} + &= \frac{V_{eg}^*}{i 2 \hbar} + \Big( e^{i (\omega - \omega_0) t} + e^{- i (\omega + \omega_0) t} \Big) \: c_e + \\ + \dv{c_e}{t} + &= \frac{V_{eg}}{i 2 \hbar} + \Big( e^{i (\omega + \omega_0) t} + e^{- i (\omega - \omega_0) t} \Big) \: c_g +\end{aligned}$$ + +At last, here we make the **rotating wave approximation**: +since $\omega$ is assumed to be close to $\omega_0$, +we argue that $\omega \!+\! \omega_0$ is so much larger than $\omega \!-\! \omega_0$ +that those oscillations turn out negligible +if the system is observed over a reasonable time interval. + +Specifically, since both exponentials have the same weight, +the fast ($\omega \!+\! \omega_0$) oscillations +have a tiny amplitude compared to the slow ($\omega \!-\! \omega_0$) ones. +Furthermore, since they average out to zero over most realistic time intervals, +the fast terms can be dropped, leaving: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + e^{i (\omega - \omega_0) t} + e^{- i (\omega + \omega_0) t} + &\approx e^{i (\omega - \omega_0) t} + \\ + e^{i (\omega + \omega_0) t} + e^{- i (\omega - \omega_0) t} + &\approx e^{- i (\omega - \omega_0) t} + \end{aligned} + } +\end{aligned}$$ + +Such that our example set of equations can be approximated as shown below, +and its analysis can continue; +see [Rabi oscillation](/know/concept/rabi-oscillation/) for more: + +$$\begin{aligned} + \dv{c_g}{t} + &= \frac{V_{eg}^*}{i 2 \hbar} c_e \: e^{i (\omega - \omega_0) t} + \\ + \dv{c_e}{t} + &= \frac{V_{eg}}{i 2 \hbar} c_g \: e^{- i (\omega - \omega_0) t} +\end{aligned}$$ + +This approximation's name is a bit confusing: +the idea is that going from the Schrödinger to +the [interaction picture](/know/concept/interaction-picture/) +has the effect of removing the exponentials of $\omega_0$ from the above equations, +i.e. multiplying them by $e^{i \omega_0 t}$ and $e^{- i \omega_0 t}$ +respectively, which can be regarded as a rotation. + +Relative to this rotation, when we split the wave $\cos(\omega t)$ +into two exponentials, one co-rotates, and the other counter-rotates. +We keep only the co-rotating waves, hence the name. + +The rotating wave approximation is usually used in the context +of the two-level quantum system for light-matter interactions, +as in the above example. +However, it is not specific to that case, +and it more generally refers to any approximation +where fast-oscillating terms are neglected. + + diff --git a/source/know/concept/runge-kutta-method/index.md b/source/know/concept/runge-kutta-method/index.md new file mode 100644 index 0000000..1e8e4a2 --- /dev/null +++ b/source/know/concept/runge-kutta-method/index.md @@ -0,0 +1,261 @@ +--- +title: "Runge-Kutta method" +date: 2022-03-10 +categories: +- Mathematics +- Numerical methods +layout: "concept" +--- + +A **Runge-Kutta method** (RKM) is a popular approach +to numerically solving systems of ordinary differential equations. +Let $\vb{x}(t)$ be the vector we want to find, +governed by $\vb{f}(t, \vb{x})$: + +$$\begin{aligned} + \vb{x}'(t) + = \vb{f}\big(t, \vb{x}(t)\big) +\end{aligned}$$ + +Like in all numerical methods, the $t$-axis is split into discrete steps. +If a step has size $h$, then as long as $h$ is small enough, +we can make the following approximation: + +$$\begin{aligned} + \vb{x}'(t) + a h \vb{x}''(t) + &\approx \vb{x}'(t \!+\! a h) + \\ + &\approx \vb{f}\big(t \!+\! a h,\, \vb{x}(t \!+\! a h)\big) + \\ + &\approx \vb{f}\big(t \!+\! a h,\, \vb{x}(t) \!+\! a h \vb{x}'(t) \big) +\end{aligned}$$ + +For sufficiently small $h$, +higher-order derivates can also be included, +albeit still at $t \!+\! a h$: + +$$\begin{aligned} + \vb{x}'(t) + a h \vb{x}''(t) + b h^2 \vb{x}'''(t) + &\approx \vb{f}\big(t \!+\! a h,\, \vb{x}(t) \!+\! a h \vb{x}'(t) \!+\! b h^2 \vb{x}''(t) \big) +\end{aligned}$$ + +Although these approximations might seem innocent, +they actually make it quite complicated to determine the error order of a given RKM. + +Now, consider a Taylor expansion around the current $t$, +truncated at a chosen order $n$: + +$$\begin{aligned} + \vb{x}(t \!+\! h) + &= \vb{x}(t) + h \vb{x}'(t) + \frac{h^2}{2} \vb{x}''(t) + \frac{h^3}{6} \vb{x}'''(t) + \:...\, + \frac{h^n}{n!} \vb{x}^{(n)}(t) + \\ + &= \vb{x}(t) + h \bigg[ \vb{x}'(t) + \frac{h}{2} \vb{x}''(t) + \frac{h^2}{6} \vb{x}'''(t) + \:...\, + \frac{h^{n-1}}{n!} \vb{x}^{(n)}(t) \bigg] +\end{aligned}$$ + +We are free to split the terms as follows, +choosing real factors $\omega_{mj}$ subject to $\sum_{j} \omega_{mj} = 1$: + +$$\begin{aligned} + \vb{x}(t \!+\! h) + &= \vb{x} + h \bigg[ \sum_{j = 1}^{N_1} \omega_{1j} \, \vb{x}' + + \frac{h}{2} \sum_{j = 1}^{N_2} \omega_{2j} \, \vb{x}'' + + \:...\, + \frac{h^{n-1}}{n!} \sum_{j = 1}^{N_n} \omega_{nj} \, \vb{x}^{(n)} \bigg] +\end{aligned}$$ + +Where the integers $N_1,...,N_n$ are also free to choose, +but for reasons that will become clear later, +the most general choice for an RKM is $N_1 = n$, $N_n = 1$, and: + +$$\begin{aligned} + N_{n-1} + = N_n \!+\! 2 + ,\quad + \cdots + ,\quad + N_{n-m} + = N_{n-m+1} \!+\! m \!+\! 1 + ,\quad + \cdots + ,\quad + N_{2} + = N_3 \!+\! n \!-\! 1 +\end{aligned}$$ + +In other words, $N_{n-m}$ is the $m$th triangular number. +This is not so important, +since this is not a practical way to describe RKMs, +but it is helpful to understand how they work. + + +## Example derivation + +For example, let us truncate at $n = 3$, +such that $N_1 = 3$, $N_2 = 3$ and $N_3 = 1$. +The following derivation is very general, +except it requires all $\alpha_j \neq 0$. +Renaming $\omega_{mj}$, we start from: + +$$\begin{aligned} + \vb{x}(t \!+\! h) + &= \vb{x} + h \bigg[ (\alpha_1 + \alpha_2 + \alpha_3) \, \vb{x}' + + \frac{h}{2} (\beta_2 + \beta_{31} + \beta_{32}) \, \vb{x}'' + + \frac{h^2}{6} \gamma_3 \, \vb{x}''' \bigg] + \\ + &= \vb{x} + h \bigg[ \alpha_1 \vb{x}' + + \Big( \alpha_2 \vb{x}' + \frac{h}{2} \beta_2 \vb{x}'' \Big) + + \Big( \alpha_3 \vb{x}' + \frac{h}{2} (\beta_{31} + \beta_{32}) \vb{x}'' + \frac{h^2}{6} \gamma_3 \vb{x}''' \Big) \bigg] +\end{aligned}$$ + +As discussed earlier, the parenthesized expressions +can be approximately rewritten with $\vb{f}$: + +$$\begin{aligned} + \vb{x}(t \!+\! h) + = \vb{x} + h &\bigg[ \alpha_1 \vb{f}(t, \vb{x}) + + \alpha_2 \vb{f}\Big( t \!+\! \frac{h \beta_2}{2 \alpha_2}, \; + \vb{x} \!+\! \frac{h \beta_2}{2 \alpha_2} \vb{x}' \Big) + \\ + & + \alpha_3 \vb{f}\Big( t \!+\! \frac{h (\beta_{31} \!\!+\!\! \beta_{32})}{2 \alpha_3}, \; + \vb{x} \!+\! \frac{h \beta_{31}}{2 \alpha_3} \vb{x}' \!+\! \frac{h \beta_{32}}{2 \alpha_3} \vb{x}' + \!+\! \frac{h^2 \gamma_3}{6 \alpha_3} \vb{x}'' \Big) \bigg] + \\ + = \vb{x} + h &\bigg[ \alpha_1 \vb{k}_1 + + \alpha_2 \vb{f}\Big( t \!+\! \frac{h \beta_2}{2 \alpha_2}, \; + \vb{x} \!+\! \frac{h \beta_2}{2 \alpha_2} \vb{k}_1 \!\Big) + \\ + & + \alpha_3 \vb{f}\Big( t \!+\! \frac{h (\beta_{31} \!\!+\!\! \beta_{32})}{2 \alpha_3}, \; + \vb{x} \!+\! \frac{h \beta_{31}}{2 \alpha_3} \vb{k}_1 \!+\! \frac{h \beta_{32}}{2 \alpha_3} + \vb{f}\Big( t \!+\! \frac{h \gamma_3}{3 \beta_{32}}, \; + \vb{x} \!+\! \frac{h \gamma_3}{3 \beta_{32}} \vb{k}_1 \!\Big) \!\Big) \bigg] +\end{aligned}$$ + +Here, we can see an opportunity to save some computational time +by reusing an evaluation of $\vb{f}$. +Technically, this is optional, but it would be madness not to, +so we choose: + +$$\begin{aligned} + \frac{\beta_2}{2 \alpha_2} + = \frac{\gamma_3}{3 \beta_{32}} +\end{aligned}$$ + +Such that the next step of $\vb{x}$'s numerical solution is as follows, +recalling that $\sum_{j} \alpha_j = 1$: + +$$\begin{aligned} + \boxed{ + \vb{x}(t \!+\! h) + = \vb{x}(t) + h \Big( \alpha_1 \vb{k}_1 + \alpha_2 \vb{k}_2 + \alpha_3 \vb{k}_3 \Big) + } +\end{aligned}$$ + +Where $\vb{k}_1$, $\vb{k}_2$ and $\vb{k}_3$ are different estimates +of the average slope $\vb{x}'$ between $t$ and $t \!+\! h$, +whose weighted average is used to make the $t$-step. +They are given by: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \vb{k}_1 + &\equiv \vb{f}(t, \vb{x}) + \\ + \vb{k}_2 + &\equiv \vb{f}\bigg( t + \frac{h \beta_2}{2 \alpha_2}, \; + \vb{x} + \frac{h \beta_2}{2 \alpha_2} \vb{k}_1 \bigg) + \\ + \vb{k}_3 + &\equiv \vb{f}\bigg( t + \frac{h (\beta_{31} \!\!+\!\! \beta_{32})}{2 \alpha_3}, \; + \vb{x} + \frac{h \beta_{31}}{2 \alpha_3} \vb{k}_1 + \frac{h \beta_{32}}{2 \alpha_3} \vb{k}_2 \bigg) + \end{aligned} + } +\end{aligned}$$ + +Despite the contraints on $\alpha_j$ and $\beta_j$, +there is an enormous freedom of choice here, +all leading to valid RKMs, although not necessarily good ones. + + +## General form + +A more practical description goes as follows: +in an $s$-stage RKM, a weighted average is taken +of up to $s$ slope estimates $\vb{k}_j$ with weights $b_j$. +Let $\sum_{j} b_j = 1$, then: + +$$\begin{aligned} + \boxed{ + \vb{x}(t \!+\! h) + = \vb{x}(t) + h \sum_{j = 1}^{s} b_j \vb{k}_j + } +\end{aligned}$$ + +Where the estimates $\vb{k}_1, ..., \vb{k}_s$ +depend on each other, and are calculated one by one as: + +$$\begin{aligned} + \boxed{ + \vb{k}_m + = \vb{f}\bigg( t + h c_m,\; \vb{x} + h \sum_{j = 1}^{m - 1} a_{mj} \vb{k}_j \bigg) + } +\end{aligned}$$ + +With $c_1 = 1$ and $\sum_{j = 1} a_{mj} = c_m$. +Writing this out for the first few $m$, the pattern is clear: + +$$\begin{aligned} + \vb{k}_1 + &= \vb{f}(t, \vb{x}) + \\ + \vb{k}_2 + &= \vb{f}\big( t + h c_2,\; \vb{x} + h a_{21} \vb{k}_1 \big) + \\ + \vb{k}_3 + &= \vb{f}\big( t + h c_3,\; \vb{x} + h (a_{31} \vb{k}_1 + a_{32} \vb{k}_2) \big) + \\ + \vb{k}_4 + &= \:... +\end{aligned}$$ + +The coefficients of a given RKM are usually +compactly represented in a **Butcher tableau**: + +$$\begin{aligned} + \begin{array}{c|ccc} + 0 \\ + c_2 & a_{21} \\ + c_3 & a_{31} & a_{32} \\ + \vdots & \vdots & \vdots & \ddots \\ + c_s & a_{s1} & a_{s2} & \cdots & a_{s,s-1} \\ + \hline + & b_1 & b_2 & \cdots & b_{s-1} & b_s + \end{array} +\end{aligned}$$ + +Each RKM has an **order** $p$, +such that the global truncation error is $\mathcal{O}(h^p)$, +i.e. the accumulated difference between the numerical +and the exact solutions is proportional to $h^p$. + +The surprise is that $p$ need not be equal to the Taylor expansion order $n$, +nor the stage count $s$. +Typically, $s = n$ for computational efficiency, but $s \ge n$ is possible in theory. + +The order $p$ of a given RKM is determined by +a complicated set of equations on the coefficients, +and the lowest possible $s$ for a desired $p$ +is in fact only partially known. +For $p \le 4$ the bound is $s \ge p$, +whereas for $p \ge 5$ the only proven bound is $s \ge p \!+\! 1$, +but for $p \ge 7$ no such efficient methods have been found so far. + +If you need an RKM with a certain order, look it up. +There exist many efficient methods for $p \le 4$ where $s = p$, +and although less popular, higher $p$ are also available. + + + +## References +1. J.C. Butcher, + *Numerical methods for ordinary differential equations*, 3rd edition, + Wiley. diff --git a/source/know/concept/rutherford-scattering/index.md b/source/know/concept/rutherford-scattering/index.md new file mode 100644 index 0000000..aec42be --- /dev/null +++ b/source/know/concept/rutherford-scattering/index.md @@ -0,0 +1,242 @@ +--- +title: "Rutherford scattering" +date: 2021-10-02 +categories: +- Physics +- Plasma physics +layout: "concept" +--- + +**Rutherford scattering** or **Coulomb scattering** +is an [elastic pseudo-collision](/know/concept/elastic-collision/) +of two electrically charged particles. +It is not a true collision, and is caused by Coulomb repulsion. + +The general idea is illustrated below. +Consider two particles 1 and 2, with the same charge sign. +Let 2 be initially at rest, and 1 approach it with velocity $\vb{v}_1$. +Coulomb repulsion causes 1 to deflect by an angle $\theta$, +and pushes 2 away in the process: + +<a href="two-body.png"> +<img src="two-body.png" style="width:50%"> +</a> + +Here, $b$ is called the **impact parameter**. +Intuitively, we expect $\theta$ to be larger for smaller $b$. + +By combining Coulomb's law with Newton's laws, +these particles' equations of motion are found to be as follows, +where $r = |\vb{r}_1 - \vb{r}_2|$ is the distance between 1 and 2: + +$$\begin{aligned} + m_1 \dv{\vb{v}_1}{t} + = \vb{F}_1 + = \frac{q_1 q_2}{4 \pi \varepsilon_0} \frac{\vb{r}_1 - \vb{r}_2}{r^3} + \qquad \quad + m_2 \dv{\vb{v}_2}{t} + = \vb{F}_2 + = - \vb{F}_1 +\end{aligned}$$ + +Using the [reduced mass](/know/concept/reduced-mass/) +$\mu \equiv m_1 m_2 / (m_1 \!+\! m_2)$, +we turn this into a one-body problem: + +$$\begin{aligned} + \mu \dv{\vb{v}}{t} + = \frac{q_1 q_2}{4 \pi \varepsilon_0} \frac{\vb{r}}{r^3} +\end{aligned}$$ + +Where $\vb{v} \equiv \vb{v}_1 \!-\! \vb{v}_2$ is the relative velocity, +and $\vb{r} \equiv \vb{r}_1 \!-\! \vb{r}_2$ is the relative position. +The latter is as follows in +[cylindrical polar coordinates](/know/concept/cylindrical-polar-coordinates/) +$(r, \varphi, z)$: + +$$\begin{aligned} + \vb{r} + = r \cos{\varphi} \:\vu{e}_x + r \sin{\varphi} \:\vu{e}_y + z \:\vu{e}_z + = r \:\vu{e}_r + z \:\vu{e}_z +\end{aligned}$$ + +These new coordinates are sketched below, +where the origin represents $\vb{r}_1 = \vb{r}_2$. +Crucially, note the symmetry: +if the "collision" occurs at $t = 0$, +then by comparing $t > 0$ and $t < 0$ +we can see that $v_x$ is unchanged for any given $\pm t$, +while $v_y$ simply changes sign: + +<a href="one-body.png"> +<img src="one-body.png" style="width:60%"> +</a> + +From our expression for $\vb{r}$, +we can find $\vb{v}$ by differentiating with respect to time: + +$$\begin{aligned} + \vb{v} + &= \big( r' \cos{\varphi} - r \varphi' \sin{\varphi} \big) \:\vu{e}_x + + \big( r' \sin{\varphi} + r \varphi' \cos{\varphi} \big) \:\vu{e}_y + z' \:\vu{e}_z + \\ + &= r' \: \big( \cos{\varphi} \:\vu{e}_x + \sin{\varphi} \:\vu{e}_y \big) + + r \varphi' \: \big( \!-\! \sin{\varphi} \:\vu{e}_x + \cos{\varphi} \:\vu{e}_y \big) + z' \:\vu{e}_z + \\ + &= r' \:\vu{e}_r + r \varphi' \:\vu{e}_\varphi + z' \:\vu{e}_z +\end{aligned}$$ + +Where we have recognized the basis vectors $\vu{e}_r$ and $\vu{e}_\varphi$. +If we choose the coordinate system such that all dynamics are in the $(x,y)$-plane, +i.e. $z(t) = 0$, we have: + +$$\begin{aligned} + \vb{r} + = r \: \vu{e}_r + \qquad \qquad + \vb{v} + = r' \:\vu{e}_r + r \varphi' \:\vu{e}_\varphi +\end{aligned}$$ + +Consequently, the angular momentum $\vb{L}$ is as follows, +pointing purely in the $z$-direction: + +$$\begin{aligned} + \vb{L}(t) + = \mu \vb{r} \cross \vb{v} + = \mu \big( r \vu{e}_r \cross r \varphi' \vu{e}_\varphi \big) + = \mu r^2 \varphi' \:\vu{e}_z +\end{aligned}$$ + +Now, from the figure above, +we can argue geometrically that at infinity $t = \pm \infty$, +the ratio $b/r$ is related to the angle $\chi$ between $\vb{v}$ and $\vb{r}$ like so: + +$$\begin{aligned} + \frac{b}{r(\pm \infty)} + = \sin{\chi(\pm \infty)} + \qquad \quad + \chi(t) + \equiv \measuredangle(\vb{r}, \vb{v}) +\end{aligned}$$ + +With this, we can rewrite +the magnitude of the angular momentum $\vb{L}$ as follows, +where the total velocity $|\vb{v}|$ is a constant, +thanks to conservation of energy: + +$$\begin{aligned} + \big| \vb{L}(\pm \infty) \big| + = \mu \big| \vb{r} \cross \vb{v} \big| + = \mu r |\vb{v}| \sin{\chi} + = \mu b |\vb{v}| +\end{aligned}$$ + +However, conveniently, +angular momentum is also conserved, i.e. $\vb{L}$ is constant in time: + +$$\begin{aligned} + \vb{L}'(t) + &= \mu \big( \vb{r} \cross \vb{v}' + \vb{v} \cross \vb{v} \big) + = \vb{r} \cross (\mu \vb{v}') + = \vb{r} \cross \Big( \frac{q_1 q_2}{4 \pi \varepsilon_0} \frac{\vb{r}}{r^3} \Big) + = 0 +\end{aligned}$$ + +Where we have replaced $\mu \vb{v}'$ with the equation of motion. +Thanks to this, we can equate the two preceding expressions for $\vb{L}$, +leading to the relation below. +Note the appearance of a new minus, +because the sketch shows that $\varphi' < 0$, +i.e. $\varphi$ decreases with increasing $t$: + +$$\begin{aligned} + - \mu r^2 \dv{\varphi}{t} + = \mu b |\vb{v}| + \quad \implies \quad + \dd{t} + = - \frac{r^2}{b |\vb{v}|} \dd{\varphi} +\end{aligned}$$ + +Now, at last, we turn to the main equation of motion. +Its $y$-component is given by: + +$$\begin{aligned} + \mu \dv{v_y}{t} + = \frac{q_1 q_2}{4 \pi \varepsilon_0} \frac{y}{r^3} + \quad \implies \quad + \mu \dd{v_y} + = \frac{q_1 q_2}{4 \pi \varepsilon_0} \frac{y}{r^3} \dd{t} +\end{aligned}$$ + +We replace $\dd{t}$ with our earlier relation, +and recognize geometrically that $y/r = \sin{\varphi}$: + +$$\begin{aligned} + \mu \dd{v_y} + = - \frac{q_1 q_2}{4 \pi \varepsilon_0 b |\vb{v}|} \frac{y}{r} \dd{\varphi} + = - \frac{q_1 q_2}{4 \pi \varepsilon_0 b |\vb{v}|} \sin{\varphi} \dd{\varphi} + = \frac{q_1 q_2}{4 \pi \varepsilon_0 b |\vb{v}|} \dd{(\cos{\varphi})} +\end{aligned}$$ + +Integrating this from the initial state $i$ at $t = -\infty$ +to the final state $f$ at $t = \infty$ yields: + +$$\begin{aligned} + \Delta v_y + \equiv \int_{i}^{f} \dd{v_y} + = \frac{q_1 q_2}{4 \pi \varepsilon_0 b |\vb{v}| \mu} \big( \cos{\varphi_f} - \cos{\varphi_i} \big) +\end{aligned}$$ + +From symmetry, we see that $\varphi_i = \pi \!-\! \varphi_f$, +and that $\Delta v_y = v_{y,f} \!-\! v_{y,i} = 2 v_{y,f}$, such that: + +$$\begin{aligned} + 2 v_{y,f} + = \frac{q_1 q_2}{4 \pi \varepsilon_0 b |\vb{v}| \mu} \big( \cos{\varphi_f} - \cos(\pi \!-\! \varphi_f) \big) + = \frac{q_1 q_2}{4 \pi \varepsilon_0 b |\vb{v}| \mu} \big( 2 \cos{\varphi_f} \big) +\end{aligned}$$ + +Furthermore, geometrically, at $t = \infty$ +we notice that $v_{y,f} = |\vb{v}| \sin{\varphi_f}$, +leading to: + +$$\begin{aligned} + 2 |\vb{v}| \sin{\varphi_f} + = \frac{q_1 q_2}{2 \pi \varepsilon_0 b |\vb{v}| \mu} \cos{\varphi_f} +\end{aligned}$$ + +Rearranging this yields the following equation +for the final polar angle $\varphi_f \equiv \varphi(\infty)$: + +$$\begin{aligned} + \tan{\varphi_f} + = \frac{\sin{\varphi_f}}{\cos{\varphi_f}} + = \frac{q_1 q_2}{4 \pi \varepsilon_0 b |\vb{v}|^2 \mu} +\end{aligned}$$ + +However, we want $\theta$, not $\varphi_f$. +One last use of symmetry and geometry +tells us that $\theta = 2 \varphi_f$, +and we thus arrive at the celebrated **Rutherford scattering formula**: + +$$\begin{aligned} + \boxed{ + \tan\!\Big( \frac{\theta}{2} \Big) + = \frac{q_1 q_2}{4 \pi \varepsilon_0 b |\vb{v}|^2 \mu} + } +\end{aligned}$$ + +In fact, this formula is also valid if $q_1$ and $q_2$ have opposite signs; +in that case particle 2 is simply located on the other side +of particle 1's trajectory. + + + +## References +1. P.M. Bellan, + *Fundamentals of plasma physics*, + 1st edition, Cambridge. +2. M. Salewski, A.H. Nielsen, + *Plasma physics: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/rutherford-scattering/one-body.png b/source/know/concept/rutherford-scattering/one-body.png Binary files differnew file mode 100644 index 0000000..f70f2df --- /dev/null +++ b/source/know/concept/rutherford-scattering/one-body.png diff --git a/source/know/concept/rutherford-scattering/two-body.png b/source/know/concept/rutherford-scattering/two-body.png Binary files differnew file mode 100644 index 0000000..9b62f78 --- /dev/null +++ b/source/know/concept/rutherford-scattering/two-body.png diff --git a/source/know/concept/salt-equation/index.md b/source/know/concept/salt-equation/index.md new file mode 100644 index 0000000..c938429 --- /dev/null +++ b/source/know/concept/salt-equation/index.md @@ -0,0 +1,281 @@ +--- +title: "SALT equation" +date: 2022-02-07 +categories: +- Physics +- Optics +- Laser theory +layout: "concept" +--- + +The **steady-state *ab initio* laser theory** (SALT) is +a theoretical description of lasers, whose mode-centric approach +makes it especially appropriate for microscopically small lasers. + +Consider the [Maxwell-Bloch equations](/know/concept/maxwell-bloch-equations/), +governing the complex polarization +vector $\vb{P}^{+}$ and the scalar population inversion $D$ of a set of +active atoms (or quantum dots) embedded in a passive linear background +material with refractive index $c / v$. +The system is affected by a driving [electric field](/know/concept/electric-field/) +$\vb{E}^{+}(t) = \vb{E}_0^{+} e^{-i \omega t}$, +such that the set of equations is: + +$$\begin{aligned} + - \mu_0 \pdvn{2}{\vb{P}^{+}}{t} + &= \nabla \cross \nabla \cross \vb{E}^{+} + \frac{1}{v^2} \pdvn{2}{\vb{E}^{+}}{t} + \\ + \pdv{\vb{P}^{+}}{t} + &= - \Big( \gamma_\perp + i \omega_0 \Big) \vb{P}^{+} + - \frac{i}{\hbar} \Big( \vb{p}_0^{-} \cdot \vb{E}^{+} \Big) \vb{p}_0^{+} D + \\ + \pdv{D}{t} + &= \gamma_\parallel (D_0 - D) + \frac{i 2}{\hbar} \Big( \vb{P}^{-} \cdot \vb{E}^{+} - \vb{P}^{+} \cdot \vb{E}^{-} \Big) +\end{aligned}$$ + +Where $\hbar \omega_0$ is the band gap of the active atoms, +and $\gamma_\perp$ and $\gamma_\parallel$ are relaxation rates +of the atoms' polarization and population inversion, respectively. +$D_0$ is the equilibrium inversion, i.e. the value of $D$ if there is no lasing. +Note that $D_0$ also represents the pump, +and both $D_0$ and $v$ depend on position $\vb{x}$. +Finally, the transition dipole matrix elements $\vb{p}_0^{-}$ and $\vb{p}_0^{+}$ are given by: + +$$\begin{aligned} + \vb{p}_0^{-} + \equiv q \matrixel{e}{\vu{x}}{g} + \qquad \qquad + \vb{p}_0^{+} + \equiv q \matrixel{g}{\vu{x}}{e} + = (\vb{p}_0^{-})^* +\end{aligned}$$ + +With $q < 0$ the electron charge, $\vu{x}$ the quantum position operator, +and $\Ket{g}$ and $\Ket{e}$ respectively +the ground state and first excitation of the active atoms. + +We start by assuming that the cavity has $N$ quasinormal modes $\Psi_n$, +each with a corresponding polarization $\vb{p}_n$ of the active matter. +Note that this ansatz already suggests +that the interactions between the modes are limited: + +$$\begin{aligned} + \vb{E}^{+}(\vb{x}, t) + = \sum_{n = 1}^N \Psi_n(\vb{x}) \: e^{- i \omega_n t} + \qquad \qquad + \vb{P}^{+}(\vb{x}, t) + = \sum_{n = 1}^N \vb{p}_n(\vb{x}) \: e^{- i \omega_n t} +\end{aligned}$$ + +Using the modes' linear independence to treat each term of the summation individually, +the first two Maxwell-Bloch equations turn into, respectively: + +$$\begin{aligned} + \mu_0 \omega_n^2 \vb{p}_n + &= \nabla \cross \nabla \cross \Psi_n - \frac{1}{v^2} \omega_n^2 \Psi_n + \\ + i \omega_n \vb{p}_n + &= \big( i \omega_0 + \gamma_\perp \big) \vb{p}_n + + \frac{i}{\hbar} \big(\vb{p}_0^{+} \vb{p}_0^{-}\big) \cdot \Psi_n \: D +\end{aligned}$$ + +With being $\vb{p}_0^{+} \vb{p}_0^{-}$ a dyadic product. +Isolating the latter equation for $\vb{p}_n$ gives us: + +$$\begin{aligned} + \vb{p}_n + &= \frac{\big(\vb{p}_0^{+} \vb{p}_0^{-}\big) \cdot \Psi_n \: D}{\hbar \big((\omega_n - \omega_0) + i \gamma_\perp\big)} + = \frac{\gamma(\omega_n) D}{\hbar \gamma_\perp} \big(\vb{p}_0^{+} \vb{p}_0^{-}\big) \cdot \Psi_n +\end{aligned}$$ + +Where we have defined the Lorentzian gain curve $\gamma(\omega_n)$ as follows, +which represents the laser's preferred frequencies for amplification: + +$$\begin{aligned} + \gamma(\omega_n) + \equiv \frac{\gamma_\perp}{(\omega_n - \omega_0) + i \gamma_\perp} +\end{aligned}$$ + +Inserting this expression for $\vb{p}_n$ +into the first Maxwell-Bloch equation yields +the prototypical form of the SALT equation, +where we still need to replace $D$ with known quantities: + +$$\begin{aligned} + 0 + &= \bigg( \nabla \cross \nabla \cross - \, \omega_n^2 \frac{1}{v^2} + - \omega_n^2 \frac{\mu_0 \gamma(\omega_n) D}{\hbar \gamma_\perp} (\vb{p}_0^{+} \vb{p}_0^{-}) \cdot \bigg) \Psi_n +\end{aligned}$$ + +To rewrite $D$, we turn to its (Maxwell-Bloch) equation of motion, +making the crucial **stationary inversion approximation** $\ipdv{D}{t} = 0$: + +$$\begin{aligned} + D + &= D_0 + \frac{i 2}{\hbar \gamma_\parallel} \Big( \vb{P}^{-} \cdot \vb{E}^{+} - \vb{P}^{+} \cdot \vb{E}^{-} \Big) +\end{aligned}$$ + +This is the most aggressive approximation we will make: +it removes all definite phase relations between modes, +and effectively eliminates time as a variable. +We insert our ansatz for $\vb{E}^{+}$ and $\vb{P}^{+}$, +and point out that only excited lasing modes contribute to $D$: + +$$\begin{aligned} + D + &= D_0 + \frac{i 2}{\hbar \gamma_\parallel} \sum_{\nu, \mu}^\mathrm{active} + \bigg( \vb{p}_\nu^* \cdot \Psi_\mu e^{i (\omega_\nu - \omega_\mu) t} + - \vb{p}_\nu \cdot \Psi_\mu^* e^{i (\omega_\mu - \omega_\nu) t} \bigg) +\end{aligned}$$ + +Here, we make the [rotating wave approximation](/know/concept/rotating-wave-approximation/) +to neglect all terms where $\nu \neq \mu$ +on the basis that they oscillate too quickly, +leaving only $\nu = \mu$: + +$$\begin{aligned} + D + &= D_0 + \frac{i 2}{\hbar \gamma_\parallel} \sum_{\nu}^\mathrm{act.} + \bigg( \vb{p}_\nu^* \cdot \Psi_\nu - \vb{p}_\nu \cdot \Psi_\nu^* \bigg) +\end{aligned}$$ + +Inserting our earlier equation for $\vb{p}_n$ +and using the fact that $\vb{p}_0^{+} = (\vb{p}_0^{-})^*$ leads us to: + +$$\begin{aligned} + D + &= D_0 + \frac{i 2 D}{\hbar^2 \gamma_\parallel \gamma_\perp} \sum_{\nu}^\mathrm{act.} + \bigg( \gamma^*(\omega_\nu) \big(\vb{p}_0^{+} \vb{p}_0^{-}\big)^* \!\cdot\! \Psi_\nu^* \cdot \Psi_\nu + - \gamma(\omega_\nu) \big(\vb{p}_0^{+} \vb{p}_0^{-}\big) \!\cdot\! \Psi_\nu \cdot \Psi_\nu^* \bigg) + \\ + &= D_0 + \frac{i 2 D}{\hbar^2 \gamma_\parallel \gamma_\perp} \sum_{\nu}^\mathrm{act.} + \bigg( \gamma^*(\omega_\nu) \big(\vb{p}_0^{+} \cdot \Psi_\nu^*\big) \vb{p}_0^{-} \cdot \Psi_\nu + - \gamma(\omega_\nu) \big(\vb{p}_0^{-} \cdot \Psi_\nu\big) \vb{p}_0^{+} \cdot \Psi_\nu^* \bigg) + \\ + &= D_0 + \frac{i 2 D}{\hbar^2 \gamma_\parallel \gamma_\perp} \sum_{\nu}^\mathrm{act.} + \Big( \gamma^*(\omega_\nu) - \gamma(\omega_\nu) \Big) \big|\vb{p}_0^{-} \cdot \Psi_\nu\big|^2 +\end{aligned}$$ + +By putting the terms on a common denominator, it is easily shown that: + +$$\begin{aligned} + \gamma^*(\omega_\nu) - \gamma(\omega_\nu) + &= \frac{\gamma_\perp ((\omega_\nu - \omega_0) + i \gamma_\perp)}{(\omega_\nu - \omega_0)^2 + \gamma_\perp^2} + - \frac{\gamma_\perp ((\omega_\nu - \omega_0) - i \gamma_\perp)}{(\omega_\nu - \omega_0)^2 + \gamma_\perp^2} + \\ + &= \frac{\gamma_\perp (i \gamma_\perp + i \gamma_\perp)}{(\omega_\nu - \omega_0)^2 + \gamma_\perp^2} + = i 2 \big|\gamma(\omega_\nu)\big|^2 +\end{aligned}$$ + +Inserting this into our equation for $D$ gives the following expression: + +$$\begin{aligned} + D + &= D_0 - \frac{4 D}{\hbar^2 \gamma_\parallel \gamma_\perp} \sum_{\nu}^\mathrm{act.} + \Big|\gamma(\omega_\nu) \vb{p}_0^{-} \cdot \Psi_\nu\Big|^2 +\end{aligned}$$ + +We then properly isolate this for $D$ to get its final form, namely: + +$$\begin{aligned} + D + &= D_0 \bigg( 1 + \frac{4}{\hbar^2 \gamma_\parallel \gamma_\perp} \sum_{\nu}^\mathrm{act.} + \Big|\gamma(\omega_\nu) \vb{p}_0^{-} \cdot \Psi_\nu\Big|^2 \bigg)^{-1} +\end{aligned}$$ + +Substituting this into the prototypical SALT equation from earlier +yields the most general form of the **SALT equation**, +upon which the theory is built: + +$$\begin{aligned} + \boxed{ + 0 + = \bigg( \nabla \cross \nabla \cross + -\,\omega_n^2 \bigg[ \frac{1}{v^2(\vb{x})} + \frac{\mu_0 \gamma(\omega_n)}{\hbar \gamma_\perp} + \frac{D_0(\vb{x})}{1 + h(\vb{x})} (\vb{p}_0^{+} \vb{p}_0^{-}) \cdot \bigg] \bigg) \Psi_n(\vb{x}) + } +\end{aligned}$$ + +Where we have defined **spatial hole burning** function $h(\vb{x})$ like so, +representing the depletion of the supply of charge +carriers as they are consumed by the active lasing modes: + +$$\begin{aligned} + \boxed{ + h(\vb{x}) + \equiv \frac{4}{\hbar^2 \gamma_\parallel \gamma_\perp} \sum_{\nu}^\mathrm{act.} + \Big|\gamma(\omega_\nu) \vb{p}_0^{-} \cdot \Psi_\nu(\vb{x})\Big|^2 + } +\end{aligned}$$ + +Many authors assume that $\vb{p}_0^- \parallel \Psi_n$, +so that only its amplitude $|g|^2 \equiv \vb{p}_0^{+} \cdot \vb{p}_0^{-}$ matters. +In that case, they often non-dimensionalize $D$ and $\Psi_n$ +by dividing out the units $d_c$ and $e_c$: + +$$\begin{aligned} + \tilde{\Psi}_n + \equiv \frac{\Psi_n}{e_c} + \qquad + e_c + \equiv \frac{\hbar \sqrt{\gamma_\parallel \gamma_\perp}}{2 |g|} + \qquad \qquad + \tilde{D} + \equiv \frac{D}{d_c} + \qquad + d_c + \equiv \frac{\varepsilon_0 \hbar \gamma_\perp}{|g|^2} +\end{aligned}$$ + +And then the SALT equation and hole burning function $h$ are reduced to the following, +where the vacuum wavenumber $k_n = \omega_n / c$: + +$$\begin{aligned} + 0 + = \bigg( \nabla \cross \nabla \cross -\,k_n^2 \bigg[ \varepsilon_r + + \gamma(c k_n) \frac{\tilde{D}_0}{1 + h} \bigg] \bigg) \tilde{\Psi}_n + \qquad + h(\vb{x}) + = \sum_{\nu}^\mathrm{act.} \Big|\gamma(c k_\nu) \tilde{\Psi}_\nu(\vb{x})\Big|^2 +\end{aligned}$$ + + +In addition, some papers only consider 1D or 2D *transverse magnetic* (TM) modes, +in which case the fields are scalars. Using the vector identity + +$$\begin{aligned} + \nabla \cross \nabla \cross \Psi + = \nabla (\nabla \cdot \Psi) - \nabla^2 \Psi +\end{aligned}$$ + +Where $\nabla \cdot \Psi = 0$ thanks to [Gauss' law](/know/concept/maxwells-equations/), +so we get an even further simplified SALT equation: + +$$\begin{aligned} + 0 + = \bigg( \nabla^2 +\,k_n^2 \bigg[ \varepsilon_r + + \gamma(c k_n) \frac{\tilde{D}_0}{1 + h} \bigg] \bigg) \tilde{\Psi}_n +\end{aligned}$$ + +The challenge is to solve this equation for a given $\varepsilon_r(\vb{x})$ and $D_0(\vb{x})$, +with the boundary condition that $\Psi_n$ is a plane wave at infinity, +i.e. that there is light leaving the cavity. + +If $k_n$ has a negative imaginary part, then that mode is behaving as an LED. +Gradually increasing the pump $D_0$ in a chosen region +causes the $k_n$'s imaginary parts become less negative, +until one of them hits the real axis, at which point that mode starts lasing. +After that, $D_0$ can be increased even further until some other $k_n$ become real. + +Below threshold (i.e. before any mode is lasing), the problem is linear in $\Psi_n$, +but above threshold it is nonlinear, and the amplitude of $\Psi_n$ is adjusted +such that the corresponding $k_n$ never leaves the real axis. +When any mode is lasing, hole burning makes it harder for other modes to activate, +since it effectively reduces the pump $D_0$. + + +## References +1. L. Ge, Y.D. Chong, A.D. Stone, + [Steady-state *ab initio* laser theory: generalizations and analytic results](http://dx.doi.org/10.1103/PhysRevA.82.063824), + 2010, American Physical Society. + diff --git a/source/know/concept/schwartz-distribution/index.md b/source/know/concept/schwartz-distribution/index.md new file mode 100644 index 0000000..b9056f0 --- /dev/null +++ b/source/know/concept/schwartz-distribution/index.md @@ -0,0 +1,120 @@ +--- +title: "Schwartz distribution" +date: 2021-02-25 +categories: +- Mathematics +layout: "concept" +--- + +A **Schwartz distribution**, also known as a **generalized function**, +is a generalization of a function, +allowing us to work with otherwise pathological definitions. + +Notable examples of distributions are +the [Dirac delta function](/know/concept/dirac-delta-function/) +and the [Heaviside step function](/know/concept/heaviside-step-function/), +whose unusual properties are justified by this generalization. + +We define the **Schwartz space** $\mathcal{S}$ of functions, +whose members are often called **test functions**. +Every such $\phi(x) \in \mathcal{S}$ must satisfy +the following constraint for any $p, q \in \mathbb{N}$: + +$$\begin{aligned} + \mathrm{max} \big| x^p \phi^{(q)}(x) \big| < \infty +\end{aligned}$$ + +In other words, a test function and its derivatives +decay faster than any polynomial. +Furthermore, all test functions must be infinitely differentiable. +These are quite strict requirements. + +The **space of distributions** $\mathcal{S}'$ (note the prime) +is then said to consist of *functionals* $f[\phi]$ +which map a test function $\phi$ from $\mathcal{S}$, +to a number from $\mathbb{C}$; +this is often written as $\Inprod{f}{\phi}$. +This notation looks like the inner product of +a [Hilbert space](/know/concept/hilbert-space/), +for good reason: any well-behaved function $f(x)$ can be embedded +into $\mathcal{S}'$ by defining the corresponding functional $f[\phi]$ as follows: + +$$\begin{aligned} + f[\phi] + = \Inprod{f}{\phi} + = \int_{-\infty}^\infty f(x) \: \phi(x) \dd{x} +\end{aligned}$$ + +Not all functionals qualify for $\mathcal{S}'$: +they also need to be linear in $\phi$, and **continuous**, +which in this context means: if a series $\phi_n$ +converges to $\phi$, then $\Inprod{f}{\phi_n}$ +converges to $\Inprod{f}{\phi}$ for all $f$. + +The power of this generalization is that $f(x)$ does not need to be well-behaved: +for example, the Dirac delta function can also be used, +whose definition is nonsensical *outside* of an integral, +but perfectly reasonable *inside* one. +By treating it as a distribution, +we gain the ability to sanely define e.g. its derivatives. + +Using the example of embedding a well-behaved function $f(x)$ into $\mathcal{S}$, +we can work out what the derivative of a distribution is: + +$$\begin{aligned} + \Inprod{f'}{\phi} + = \int_{-\infty}^\infty f'(x) \: \phi(x) \dd{x} + = \Big[ f(x) \: \phi(x) \Big]_{-\infty}^\infty - \int_{-\infty}^\infty f(x) \: \phi'(x) \dd{x} +\end{aligned}$$ + +The test function removes the boundary term, yielding the result +$- \Inprod{f}{\phi'}$. Although this was an example for a specific $f(x)$, +we use it to define the derivative of any distribution: + +$$\begin{aligned} + \boxed{ + \Inprod{f'}{\phi} = - \Inprod{f}{\phi'} + } +\end{aligned}$$ + +Using the same trick, we can find the +[Fourier transform](/know/concept/fourier-transform/) (FT) +of a generalized function. +We define the FT as follows, +but be prepared for some switching of the names $k$ and $x$: + +$$\begin{aligned} + \tilde{\phi}(x) + = \int_{-\infty}^\infty \phi(k) \exp(- i k x) \dd{k} +\end{aligned}$$ + +The FT of a Schwartz distribution $f$ then turns out to be as follows: + +$$\begin{aligned} + \inprod{\tilde{f}}{\phi} + &= \int_{-\infty}^\infty \tilde{f}(k) \: \phi(k) \dd{k} + = \iint_{-\infty}^\infty f(x) \exp(- i k x) \: \phi(k) \dd{x} \dd{k} + \\ + &= \int_{-\infty}^\infty f(x) \: \tilde{\phi}(x) \dd{x} + = \inprod{f}{\tilde{\phi}} +\end{aligned}$$ + +Note that the ordinary FT $\tilde{f}(k) = \hat{\mathcal{F}}\{f(x)\}$ is +already a 1:1 mapping of test functions $\phi \leftrightarrow \tilde{\phi}$. +As it turns out, +in this generalization it is also a 1:1 mapping of distributions in $\mathcal{S}'$, +defined as: + +$$\begin{aligned} + \boxed{ + \inprod{\tilde{f}}{\phi} + = \inprod{f}{\tilde{\phi}} + } +\end{aligned}$$ + + + +## References +1. K.W. Jacobsen, + *Note on generalized functions (distributions)*, 2020, + unpublished. diff --git a/source/know/concept/screw-pinch/index.md b/source/know/concept/screw-pinch/index.md new file mode 100644 index 0000000..a279b98 --- /dev/null +++ b/source/know/concept/screw-pinch/index.md @@ -0,0 +1,203 @@ +--- +title: "Screw pinch" +date: 2022-03-06 +categories: +- Physics +- Plasma physics +layout: "concept" +--- + +A **pinch** is a type of plasma confinement, +which relies on [magnetic fields](/know/concept/magnetic-field/) +to squeeze the plasma into the desired area. +Examples include tokamaks and stellarators, +although the term *pinch* is typically introduced for simpler 1D confinement. + +Suppose that we want to pinch a plasma into a cylindrical shape. +The general way of doing this is called a **screw pinch**. +For simplicity, let the cylinder be infinitely long, +so that it is natural to work in +[cylindrical polar coordinates](/know/concept/cylindrical-polar-coordinates/) +$(r, \theta, z)$. + +Using the framework of ideal [magnetohydrodynamics](/know/concept/magnetohydrodynamics/) (MHD), +let us start by assuming that the fluid is stationary, +and that the confining field $\vb{B}$ is fixed. +From the (ideal) generalized Ohm's law, it then follows +that the [electric field](/know/concept/electric-field/) $\vb{E} = 0$: + +$$\begin{aligned} + \vb{u} + = 0 + \qquad \qquad + \pdv{\vb{u}}{t} + = 0 + \qquad \qquad + \pdv{\vb{B}}{t} + = 0 + \qquad \qquad + \vb{E} + = 0 +\end{aligned}$$ + +To get the plasma's equilibrium state for a given $\vb{B}$, +we first solve [Ampère's law](/know/concept/maxwells-equations/) +for the current density $\vb{J}$, +and then the MHD momentum equation for the pressure $p$. +Symmetries should be used whenever possible to reduce these equations: + +$$\begin{aligned} + \nabla \cross \vb{B} + = \mu_0 \vb{J} + \qquad \qquad + \vb{J} \cross \vb{B} + = \nabla p +\end{aligned}$$ + +Note that the latter implies that $\nabla p$ is always orthogonal to $\vb{J}$ and $\vb{B}$, +meaning that the current density and magnetic field must follow +surfaces of constant pressure. + + +## ϴ-pinch + +In a so-called **ϴ-pinch**, the confining field $\vb{B}$ +is parallel to the $z$-axis, and its magntiude $B_z$ may only depend on $r$. +Concretely, we have: + +$$\begin{aligned} + \vb{B} + = B_z(r) \: \vu{e}_z +\end{aligned}$$ + +Where $\vu{e}_z$ is the basis vector of the $z$-axis. +This $\vb{B}$ confines the plasma thanks to +the [Lorentz force](/know/concept/lorentz-force/), +which makes charged particles gyrate around magnetic field lines. + +Using Ampère's law, we find that the resulting current density $\vb{J}$, +expressed in $(r, \theta, z)$: + +$$\begin{aligned} + \vb{J} + = \frac{1}{\mu_0} \nabla \cross \vb{B} + = \frac{1}{\mu_0} + \begin{bmatrix} + \displaystyle \frac{1}{r} \pdv{B_z}{\theta} - \pdv{B_\theta}{z} \\ + \displaystyle \pdv{B_r}{z} - \pdv{B_z}{r} \\ + \displaystyle \frac{1}{r} \Big( \pdv{(r B_\theta)}{r} - \pdv{B_r}{\theta} \Big) + \end{bmatrix} + = -\frac{1}{\mu_0} \pdv{B_z}{r} \: \vu{e}_\theta +\end{aligned}$$ + +Where we have used that only $B_z$ is nonzero, +and that it only depends on $r$. +This yields a circular current parallel to $\vu{e}_\theta$, +hence the name *ϴ-pinch*. + +Next, we use the MHD momentum equation to find the pressure gradient $\nabla p$. +The cross product is easy to evaluate, +since $\vb{B}$ is parallel to $\vu{e}_z$, +and $\vb{J}$ is parallel to $\vu{e}_\theta$: + +$$\begin{aligned} + \nabla p + &= \vb{J} \cross \vb{B} + = J_\theta \vu{e}_\theta \cross B_z \vu{e}_z + = J_\theta B_z \vu{e}_r + = - \frac{1}{\mu_0} \pdv{B_z}{r} B_z \: \vu{e}_r +\end{aligned}$$ + +Consequently, $\nabla p$ is parallel to $\vu{e}_r$, +and only depends on $r$ through $B_z$. +Along the $r$-direction, the above equation can be rewritten +into the following equilibrium condition: + +$$\begin{aligned} + \boxed{ + \pdv{}{r}\bigg( p + \frac{B_z^2}{2 \mu_0} \bigg) + = 0 + } +\end{aligned}$$ + +In other words, the parenthesized expression does not depend on $r$. + + +## Z-pinch + +Meanwhile, in a so-called **Z-pinch**, +we create an $r$-dependent current $\vb{J}$ parallel to the $z$-axis: + +$$\begin{aligned} + \vb{J} + = J_z(r) \: \vu{e}_z +\end{aligned}$$ + +We can then deduce $\vb{B}$ from Ampère's law, +using that only $J_z$ is nonzero, +and that $\ipdv{B_r}{\theta} = 0$ due to circular symmetry: + +$$\begin{aligned} + \vb{J} + = \frac{1}{\mu_0} \nabla \cross \vb{B} + = \frac{1}{\mu_0} + \begin{bmatrix} + \displaystyle \frac{1}{r} \pdv{B_z}{\theta} - \pdv{B_\theta}{z} \\ + \displaystyle \pdv{B_r}{z} - \pdv{B_z}{r} \\ + \displaystyle \frac{1}{r} \Big( \pdv{(r B_\theta)}{r} - \pdv{B_r}{\theta} \Big) + \end{bmatrix} + = \frac{1}{\mu_0 r} \pdv{(r B_\theta)}{r} \: \vu{e}_z +\end{aligned}$$ + +Therefore, $\vb{J}$ induces a circular $\vb{B} = B_\theta(r) \: \vu{e}_\theta$, +which confines the plasma for the same reason as in the ϴ-pinch: +the Lorentz force makes particles gyrate around magnetic field lines. + +Next, the resulting pressure gradient $\nabla p$ is found from the MHD momentum equation: + +$$\begin{aligned} + \nabla p + &= \vb{J} \cross \vb{B} + = J_z \vb{e}_z \cross B_\theta \vb{e}_\theta + = - J_z B_\theta \vu{e}_r + = - \frac{1}{\mu_0 r} \pdv{(r B_\theta)}{r} B_\theta \: \vu{e}_r +\end{aligned}$$ + +Once again, $\nabla p$ is parallel to $\vu{e}_r$ and only depends on $r$. +After rearranging, we thus arrive at the following equilibrium condition in the $r$-direction: + +$$\begin{aligned} + \boxed{ + \pdv{}{r}\bigg( p + \frac{B_\theta^2}{2 \mu_0} \bigg) + \frac{B_\theta^2}{\mu_0 r} + = 0 + } +\end{aligned}$$ + + +## Screw pinch + +Thanks to the linearity of electromagnetism, +a ϴ-pinch and Z-pinch can be combined to create a **screw pinch**, +where $\vb{J}$ and $\vb{B}$ both have nonzero $\theta$ and $z$-components. +By performing the above procedure again, +the following equilibrium condition is obtained: + +$$\begin{aligned} + \boxed{ + \pdv{}{r}\bigg( p + \frac{B_z^2}{2 \mu_0} + \frac{B_\theta^2}{2 \mu_0} \bigg) + \frac{B_\theta^2}{\mu_0 r} + = 0 + } +\end{aligned}$$ + +Which simply combines the terms of the preceding equations. +Indirectly, this result is relevant for certain types of nuclear fusion reactor, +e.g. the tokamak, which basically consists of a screw pinch bent into a torus. +The resulting equilibrium is given by +the [Grad-Shafranov equation](/know/concept/grad-shafranov-equation/). + + + +## References +1. M. Salewski, A.H. Nielsen, + *Plasma physics: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/second-quantization/index.md b/source/know/concept/second-quantization/index.md new file mode 100644 index 0000000..0df70e0 --- /dev/null +++ b/source/know/concept/second-quantization/index.md @@ -0,0 +1,326 @@ +--- +title: "Second quantization" +date: 2021-02-26 +categories: +- Quantum mechanics +- Physics +layout: "concept" +--- + +The **second quantization** is a technique to deal with quantum systems +containing a large and/or variable number of identical particles. +Its exact formulation depends on +whether it is fermions or bosons that are being considered +(see [Pauli exclusion principle](/know/concept/pauli-exclusion-principle/)). + +Regardless of whether the system is fermionic or bosonic, +the idea is to change basis to a set of certain many-particle wave functions, +known as the **Fock states**, which are specific members of a **Fock space**, +a special kind of [Hilbert space](/know/concept/hilbert-space/), +with a well-defined number of particles. + +For a set of $N$ single-particle energy eigenstates +$\psi_n(x)$ and $N$ identical particles $x_n$, the Fock states are +all the wave functions which contain $n$ particles, for $n$ going from $0$ to $N$. + +So for $n = 0$, there is one basis vector with $0$ particles, +for $n = 1$, there are $N$ basis vectors with $1$ particle each, +for $n = 2$, there are $N (N \!-\! 1)$ basis vectors with $2$ particles, +etc. + +In this basis, we define the **particle creation operators** +and **particle annihilation operators**, +which respectively add/remove a particle to/from a given state. +In other words, these operators relate the Fock basis vectors +to one another, and are very useful. + +The point is to express the system's state in such a way that the +fermionic/bosonic constraints are automatically satisfied, and the +formulae look the same regardless of the number of particles. + + +## Fermions + +Fermions need to obey the Pauli exclusion principle, so each state can only +contain one particle. In this case, the Fock states are given by: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + n &= 0: + \qquad \Ket{0, 0, 0, ...} + \\ + n &= 1: + \qquad \Ket{1, 0, 0, ...} \quad \Ket{0, 1, 0, ...} \quad \Ket{0, 0, 1, ...} \quad \cdots + \\ + n &= 2: + \qquad \Ket{1, 1, 0, ...} \quad \Ket{1, 0, 1, ...} \quad \Ket{0, 1, 1, ...} \quad \cdots + \end{aligned} + } +\end{aligned}$$ + +The notation $\Ket{N_\alpha, N_\beta, ...}$ is shorthand for +the appropriate [Slater determinants](/know/concept/slater-determinant/). +As an example, take $\Ket{0, 1, 0, 1, 1}$, +which contains three particles $a$, $b$ and $c$ +in states 2, 4 and 5: + +$$\begin{aligned} + \Ket{0, 1, 0, 1, 1} + = \Psi(x_a, x_b, x_c) + = \frac{1}{\sqrt{3!}} \det\! + \begin{bmatrix} + \psi_2(x_a) & \psi_4(x_a) & \psi_5(x_a) \\ + \psi_2(x_b) & \psi_4(x_b) & \psi_5(x_b) \\ + \psi_2(x_c) & \psi_4(x_c) & \psi_5(x_c) + \end{bmatrix} +\end{aligned}$$ + +The creation operator $\hat{c}_\alpha^\dagger$ and annihilation +operator $\hat{c}_\alpha$ are defined to live up to their name: +they create or destroy a particle in the state $\psi_\alpha$: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \hat{c}_\alpha^\dagger \Ket{... (N_\alpha\!=\!0) ...} + &= J_\alpha \Ket{... (N_\alpha\!=\!1) ...} + \\ + \hat{c}_\alpha \Ket{... (N_\alpha\!=\!1) ...} + &= J_\alpha \Ket{... (N_\alpha\!=\!0) ...} + \end{aligned} + } +\end{aligned}$$ + +The factor $J_\alpha$ is sometimes known as the **Jordan-Wigner string**, +and is necessary here to enforce the fermionic antisymmetry, +when creating or destroying a particle in the $\alpha$th state: + +$$\begin{aligned} + J_\alpha = (-1)^{\sum_{j < \alpha} N_j} +\end{aligned}$$ + +So, for example, when creating a particle in state 4 +of $\Ket{0, 1, 1, 0, 1}$, we get the following: + +$$\begin{aligned} + \hat{c}_4^\dagger \Ket{0, 1, 1, 0, 1} + = (-1)^{0 + 1 + 1} \Ket{0, 1, 1, 1, 1} +\end{aligned}$$ + +The point of the Jordan-Wigner string +is that the order matters when applying the creation and annihilation operators: + +$$\begin{aligned} + \hat{c}_1^\dagger \hat{c}_2 \Ket{0, 1} + &= \hat{c}_1^\dagger \Ket{0, 0} + = \Ket{1, 0} + \\ + \hat{c}_2 \hat{c}_1^\dagger \Ket{0, 1} + &= \hat{c}_2 \Ket{1, 1} + = - \Ket{1, 0} +\end{aligned}$$ + +In other words, $\hat{c}_1^\dagger \hat{c}_2 = - \hat{c}_2 \hat{c}_1^\dagger$, +meaning that the anticommutator $\{\hat{c}_2, \hat{c}_1^\dagger\} = 0$. +You can verify for youself that +the general anticommutators of these operators are given by: + +$$\begin{aligned} + \boxed{ + \{\hat{c}_\alpha, \hat{c}_\beta\} = \{\hat{c}_\alpha^\dagger, \hat{c}_\beta^\dagger\} = 0 + \qquad \quad + \{\hat{c}_\alpha, \hat{c}_\beta^\dagger\} = \delta_{\alpha\beta} + } +\end{aligned}$$ + +Each single-particle state can only contain 0 or 1 fermions, +so these operators **quench** states that would violate this rule. +Note that these are *scalar* zeros: + +$$\begin{aligned} + \boxed{ + \hat{c}_\alpha^\dagger \Ket{... (N_\alpha\!=\!1) ...} = 0 + \qquad \quad + \hat{c}_\alpha \Ket{... (N_\alpha\!=\!0) ...} = 0 + } +\end{aligned}$$ + +Finally, as has already been suggested by the notation, they are each other's adjoint: + +$$\begin{aligned} + \matrixel{... (N_\alpha\!=\!1) ...}{\hat{c}_\alpha^\dagger}{... (N_\alpha\!=\!0) ...} + = \matrixel{...(N_\alpha\!=\!0) ...}{\hat{c}_\alpha}{... (N_\alpha\!=\!1) ...} +\end{aligned}$$ + +Let us now use these operators to define the **number operator** $\hat{N}_\alpha$ as follows: + +$$\begin{aligned} + \boxed{ + \hat{N}_\alpha = \hat{c}_\alpha^\dagger \hat{c}_\alpha + } +\end{aligned}$$ + +Its eigenvalue is the number of particles residing in state $\psi_\alpha$ +(look at the hats): + +$$\begin{aligned} + \hat{N}_\alpha \Ket{... N_\alpha ...} + = N_\alpha \Ket{... N_\alpha ...} +\end{aligned}$$ + + +## Bosons + +Bosons do not need to obey the Pauli exclusion principle, so multiple can occupy a single state. +The Fock states are therefore as follows: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + n &= 0: + \qquad \Ket{0, 0, 0, ...} + \\ + n &= 1: + \qquad \Ket{1, 0, 0, ...} \quad \Ket{0, 1, 0, ...} \quad \Ket{0, 0, 1, ...} \quad \cdots + \\ + n &= 2: + \qquad \Ket{1, 1, 0, ...} \quad \Ket{1, 0, 1, ...} \quad \Ket{0, 1, 1, ...} \quad \cdots + \\ + &\qquad\:\:\: + \qquad \Ket{2, 0, 0, ...} \quad \Ket{0, 2, 0, ...} \quad \Ket{0, 0, 2, ...} \quad \cdots + \end{aligned} + } +\end{aligned}$$ + +They must be symmetric under the exchange of two bosons. +To achieve this, the Fock states are represented by Slater *permanents* +rather than determinants. + +The boson creation and annihilation operators $\hat{c}_\alpha^\dagger$ and +$\hat{c}_\alpha$ are straightforward: + +$$\begin{gathered} + \boxed{ + \begin{aligned} + \hat{c}_\alpha^\dagger \Ket{... N_\alpha ...} + &= \sqrt{N_\alpha + 1} \: \Ket{... (N_\alpha \!+\! 1) ...} + \\ + \hat{c}_\alpha \Ket{... N_\alpha ...} + &= \sqrt{N_\alpha} \: \Ket{... (N_\alpha \!-\! 1) ...} + \end{aligned} +}\end{gathered}$$ + +Applying the annihilation operator $\hat{c}_\alpha$ when there are zero +particles in $\alpha$ will quench the state: + +$$\begin{aligned} + \boxed{ + \hat{c}_\alpha \Ket{... (N_\alpha\!=\!0) ...} = 0 + } +\end{aligned}$$ + +There is no Jordan-Wigner string, and therefore no sign change when commuting. +Consequently, these operators therefore satisfy the following: + +$$\begin{aligned} + \boxed{ + [\hat{c}_\alpha, \hat{c}_\beta] = [\hat{c}_\alpha^\dagger, \hat{c}_\beta^\dagger] = 0 + \qquad + [\hat{c}_\alpha, \hat{c}_\beta^\dagger] = \delta_{\alpha\beta} + } +\end{aligned}$$ + +The constant factors applied by $\hat{c}_\alpha^\dagger$ and $\hat{c}_\alpha$ +ensure that $\hat{N}_\alpha$ keeps the same nice form: + +$$\begin{aligned} + \boxed{ + \hat{N}_\alpha = \hat{c}_\alpha^\dagger \hat{c}_\alpha + } +\end{aligned}$$ + + +## Operators + +Traditionally, an operator $\hat{V}$ simultaneously acting on $N$ indentical particles +is the sum of the individual single-particle operators $\hat{V}_1$ acting on the $n$th particle: + +$$\begin{aligned} + \hat{V} + = \sum_{n = 1}^N \hat{V}_1 +\end{aligned}$$ + +This can be rewritten using the second quantization operators as follows: + +$$\begin{aligned} + \boxed{ + \hat{V} + = \sum_{\alpha, \beta} \matrixel{\alpha}{\hat{V}_1}{\beta} \hat{c}_\alpha^\dagger \hat{c}_\beta + } +\end{aligned}$$ + +Where the matrix element $\matrixel{\alpha}{\hat{V}_1}{\beta}$ is to be +evaluated in the normal way: + +$$\begin{aligned} + \matrixel{\alpha}{\hat{V}_1}{\beta} + = \int \psi_\alpha^*(\vec{r}) \: \hat{V}_1(\vec{r}) \: \psi_\beta(\vec{r}) \dd{\vec{r}} +\end{aligned}$$ + +Similarly, given some two-particle operator $\hat{V}$ in first-quantized form: + +$$\begin{aligned} + \hat{V} + = \sum_{n \neq m} v(\vec{r}_n, \vec{r}_m) +\end{aligned}$$ + +We can rewrite this in second-quantized form as follows. +Note the ordering of the subscripts: + +$$\begin{aligned} + \boxed{ + \hat{V} + = \sum_{\alpha, \beta, \gamma, \delta} + v_{\alpha \beta \gamma \delta} \hat{c}_\alpha^\dagger \hat{c}_\beta^\dagger \hat{c}_\delta \hat{c}_\gamma + } +\end{aligned}$$ + +Where the constant $v_{\alpha \beta \gamma \delta}$ is defined from the +single-particle wave functions: + +$$\begin{aligned} + v_{\alpha \beta \gamma \delta} + = \iint \psi_\alpha^*(\vec{r}_1) \: \psi_\beta^*(\vec{r}_2) + \: v(\vec{r}_1, \vec{r}_2) \: \psi_\gamma(\vec{r}_1) + \: \psi_\delta(\vec{r}_2) \dd{\vec{r}_1} \dd{\vec{r}_2} +\end{aligned}$$ + +Finally, in the second quantization, changing basis is done in the usual way: + +$$\begin{aligned} + \hat{c}_b^\dagger \Ket{0} + = \Ket{b} + = \sum_{\alpha} \Ket{\alpha} \Inprod{\alpha}{b} + = \sum_{\alpha} \Inprod{\alpha}{b} \hat{c}_\alpha^\dagger \Ket{0} +\end{aligned}$$ + +Where $\alpha$ and $b$ need not be in the same basis. +With this, we can define the **field operators**, +which create or destroy a particle at a given position $\vec{r}$: + +$$\begin{aligned} + \boxed{ + \hat{\Psi}^\dagger(\vec{r}) + = \sum_{\alpha} \Inprod{\alpha}{\vec{r}} \hat{c}_\alpha^\dagger + \qquad \quad + \hat{\Psi}(\vec{r}) + = \sum_{\alpha} \Inprod{\vec{r}}{\alpha} \hat{c}_\alpha + } +\end{aligned}$$ + + +## References +1. L.E. Ballentine, + *Quantum mechanics: a modern development*, 2nd edition, + World Scientific. diff --git a/source/know/concept/selection-rules/index.md b/source/know/concept/selection-rules/index.md new file mode 100644 index 0000000..2ce5748 --- /dev/null +++ b/source/know/concept/selection-rules/index.md @@ -0,0 +1,698 @@ +--- +title: "Selection rules" +date: 2021-06-02 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +In quantum mechanics, it is often necessary to evaluate +matrix elements of the following form, +where $\ell$ and $m$ respectively represent +the total angular momentum and its $z$-component: + +$$\begin{aligned} + \matrixel{f}{\hat{O}}{i} + = \matrixel{\ell_f m_f}{\hat{O}}{\ell_i m_i} +\end{aligned}$$ + +Where $\hat{O}$ is an operator, $\Ket{i}$ is an initial state, and +$\Ket{f}$ is a final state (usually at least; $\Ket{i}$ and $\Ket{f}$ +can be any states). **Selection rules** are requirements on the relations +between $\ell_i$, $\ell_f$, $m_i$ and $m_f$, which, if not met, +guarantee that the above matrix element is zero. + + +## Parity rules + +Let $\hat{O}$ denote any operator which is odd under spatial inversion +(parity): + +$$\begin{aligned} + \hat{\Pi}^\dagger \hat{O} \hat{\Pi} = - \hat{O} +\end{aligned}$$ + +Where $\hat{\Pi}$ is the parity operator. +We wrap this property of $\hat{O}$ +in the states $\Ket{\ell_f m_f}$ and $\Ket{\ell_i m_i}$: + +$$\begin{aligned} + \matrixel{\ell_f m_f}{\hat{O}}{\ell_i m_i} + &= - \matrixel{\ell_f m_f}{\hat{\Pi}^\dagger \hat{O} \hat{\Pi}}{\ell_i m_i} + \\ + &= - \matrixel{\ell_f m_f}{(-1)^{\ell_f} \hat{O} (-1)^{\ell_i}}{\ell_i m_i} + \\ + &= (-1)^{\ell_f + \ell_i + 1} \matrixel{\ell_f m_f}{\hat{O}}{\ell_i m_i} +\end{aligned}$$ + +Which clearly can only be true if the exponent is even, +so $\Delta \ell \equiv \ell_f - \ell_i$ must be odd. +This leads to the following selection rule, +often referred to as **Laporte's rule**: + +$$\begin{aligned} + \boxed{ + \Delta \ell \:\:\text{is odd} + } +\end{aligned}$$ + +If this is not the case, +then the only possible way that the above equation can be satisfied +is if the matrix element vanishes $\matrixel{\ell_f m_f}{\hat{O}}{\ell_i m_i} = 0$. +We can derive an analogous rule for +any operator $\hat{E}$ which is even under parity: + +$$\begin{aligned} + \hat{\Pi}^\dagger \hat{E} \hat{\Pi} = \hat{E} + \quad \implies \quad + \boxed{ + \Delta \ell \:\:\text{is even} + } +\end{aligned}$$ + + +## Dipole rules + +Arguably the most common operator found in such matrix elements +is a position vector operator, like $\vu{r}$ or $\hat{x}$, +and the associated selection rules are known as **dipole rules**. + +For the $z$-component of angular momentum $m$ we have the following: + +$$\begin{aligned} + \boxed{ + \Delta m = 0 \:\:\mathrm{or}\: \pm 1 + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-dipole-m"/> +<label for="proof-dipole-m">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-dipole-m">Proof.</label> +We know that the angular momentum $z$-component operator $\hat{L}_z$ satisfies: + +$$\begin{aligned} + \comm{\hat{L}_z}{\hat{x}} = i \hbar \hat{y} + \qquad + \comm{\hat{L}_z}{\hat{y}} = - i \hbar \hat{x} + \qquad + \comm{\hat{L}_z}{\hat{z}} = 0 +\end{aligned}$$ + +We take the first relation, +and wrap it in $\Bra{\ell_f m_f}$ and $\Ket{\ell_i m_i}$, giving: + +$$\begin{aligned} + i \hbar \matrixel{\ell_f m_f}{\hat{y}}{\ell_i m_i} + &= \matrixel{\ell_f m_f}{\hat{L}_z \hat{x}}{\ell_i m_i} - \matrixel{\ell_f m_f}{\hat{x} \hat{L}_z}{\ell_i m_i} + \\ + &= \hbar m_f \matrixel{\ell_f m_f}{\hat{x}}{\ell_i m_i} - \hbar m_i \matrixel{\ell_f m_f}{\hat{x}}{\ell_i m_i} + \\ + &= \hbar (m_f - m_i) \matrixel{\ell_f m_f}{\hat{x}}{\ell_i m_i} +\end{aligned}$$ + +Next, we do the same thing with the second relation, for $[\hat{L}_z, \hat{y}]$, giving: + +$$\begin{aligned} + - i \hbar \matrixel{\ell_f m_f}{\hat{x}}{\ell_i m_i} + &= \matrixel{\ell_f m_f}{\hat{L}_z \hat{y}}{\ell_i m_i} - \matrixel{\ell_f m_f}{\hat{y} \hat{L}_z}{\ell_i m_i} + \\ + &= \hbar m_f \matrixel{\ell_f m_f}{\hat{y}}{\ell_i m_i} - \hbar m_i \matrixel{\ell_f m_f}{\hat{y}}{\ell_i m_i} + \\ + &= \hbar (m_f - m_i) \matrixel{\ell_f m_f}{\hat{y}}{\ell_i m_i} +\end{aligned}$$ + +Respectively isolating the two above results for $\hat{x}$ and $\hat{y}$, +we arrive at these equations: + +$$\begin{aligned} + \matrixel{\ell_f m_f}{\hat{x}}{\ell_i m_i} + &= i (m_f - m_i) \matrixel{\ell_f m_f}{\hat{y}}{\ell_i m_i} + \\ + \matrixel{\ell_f m_f}{\hat{y}}{\ell_i m_i} + &= - i (m_f - m_i) \matrixel{\ell_f m_f}{\hat{x}}{\ell_i m_i} +\end{aligned}$$ + +By inserting the first into the second, +we find (part of) the selection rule: + +$$\begin{aligned} + \matrixel{\ell_f m_f}{\hat{y}}{\ell_i m_i} + &= (m_f - m_i)^2 \matrixel{\ell_f m_f}{\hat{y}}{\ell_i m_i} +\end{aligned}$$ + +This can only be true if $\Delta m = \pm 1$, +unless the inner products of $\hat{x}$ and $\hat{y}$ are zero, +in which case we cannot say anything about $\Delta m$ yet. +Assuming the latter, we take the inner product of +the commutator $\comm{\hat{L}_z}{\hat{z}} = 0$, and find: + +$$\begin{aligned} + 0 + &= \matrixel{\ell_f m_f}{\hat{L}_z \hat{z}}{\ell_i m_i} - \matrixel{\ell_f m_f}{\hat{z} \hat{L}_z}{\ell_i m_i} + \\ + &= \hbar m_f \matrixel{\ell_f m_f}{\hat{z}}{\ell_i m_i} - \hbar m_i \matrixel{\ell_f m_f}{\hat{z}}{\ell_i m_i} + \\ + &= \hbar (m_f - m_i) \matrixel{\ell_f m_f}{\hat{z}}{\ell_i m_i} +\end{aligned}$$ + +If $\matrixel{f}{\hat{z}}{i} \neq 0$, we require $\Delta m = 0$. +The previous requirement was $\Delta m = \pm 1$, +implying that $\matrixel{f}{\hat{x}}{i} = \matrixel{f}{\hat{y}}{i} = 0$ +whenever $\matrixel{f}{\hat{z}}{i} \neq 0$. +Only if $\matrixel{f}{\hat{z}}{i} = 0$ +does the previous rule $\Delta m = \pm 1$ hold, +in which case the inner products of $\hat{x}$ and $\hat{y}$ are nonzero. +</div> +</div> + +Meanwhile, for the total angular momentum $\ell$ we have the following: + +$$\begin{aligned} + \boxed{ + \Delta \ell = \pm 1 + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-dipole-l"/> +<label for="proof-dipole-l">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-dipole-l">Proof.</label> +We start from the following relation +(which is already quite a chore to prove): + +$$\begin{aligned} + \Comm{\hat{L}^2}{\comm{\hat{L}^2}{\vu{r}}} + = 2 \hbar^2 (\vu{r} \hat{L}^2 + \hat{L}^2 \vu{r}) +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-dipole-l-comm"/> +<label for="proof-dipole-l-comm">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-dipole-l-comm">Proof.</label> +To begin with, we want to find the commutator of $\hat{L}^2$ and $\hat{x}$: + +$$\begin{aligned} + \comm{\hat{L}^2}{\hat{x}} + &= \comm{\hat{L}_x^2}{\hat{x}} + \comm{\hat{L}_y^2}{\hat{x}} + \comm{\hat{L}_z^2}{\hat{x}} + = \comm{\hat{L}_y^2}{\hat{x}} + \comm{\hat{L}_z^2}{\hat{x}} + \\ + &= \hat{L}_y \comm{\hat{L}_y}{\hat{x}} + \comm{\hat{L}_y}{\hat{x}} \hat{L}_y + + \hat{L}_z \comm{\hat{L}_z}{\hat{x}} + \comm{\hat{L}_z}{\hat{x}} \hat{L}_z +\end{aligned}$$ + +Evaluating these commutators gives us: + +$$\begin{aligned} + \comm{\hat{L}_y}{\hat{x}} + &= \comm{\hat{z} \hat{p}_x}{\hat{x}} - \comm{\hat{x} \hat{p}_z}{\hat{x}} + = \hat{z} \comm{\hat{p}_x}{\hat{x}} + \comm{\hat{z}}{\hat{x}} \hat{p}_x + - \hat{x} \comm{\hat{p}_z}{\hat{x}} - \comm{\hat{x}}{\hat{x}} \hat{p}_z + = - i \hbar \hat{z} + \\ + \comm{\hat{L}_z}{\hat{x}} + &= \comm{\hat{x} \hat{p}_y}{\hat{x}} - \comm{\hat{y} \hat{p}_x}{\hat{x}} + = \hat{x} \comm{\hat{p}_y}{\hat{x}} + \comm{\hat{x}}{\hat{x}} \hat{p}_y + - \hat{y} \comm{\hat{p}_x}{\hat{x}} - \comm{\hat{y}}{\hat{x}} \hat{p}_x + = i \hbar \hat{y} +\end{aligned}$$ + +Which we then insert back into the original equation, yielding: + +$$\begin{aligned} + \comm{\hat{L}^2}{\hat{x}} + &= i \hbar (- \hat{L}_y \hat{z} - \hat{z} \hat{L}_y + \hat{L}_z \hat{y} + \hat{y} \hat{L}_z) +\end{aligned}$$ + +This can be simplified by introducing some more commutators: + +$$\begin{aligned} + \comm{\hat{L}^2}{\hat{x}} + &= i \hbar \big( \!-\! ( \comm{\hat{L}_y}{\hat{z}} + \hat{z} \hat{L}_y ) - \hat{z} \hat{L}_y + + ( \comm{\hat{L}_z}{\hat{y}} + \hat{y} \hat{L}_z ) + \hat{y} \hat{L}_z \big) +\end{aligned}$$ + +Evaluating these commutators gives us: + +$$\begin{aligned} + \comm{\hat{L}_y}{\hat{z}} + &= \comm{\hat{z} \hat{p}_x}{\hat{z}} - \comm{\hat{x} \hat{p}_z}{\hat{z}} + = \hat{z} \comm{\hat{p}_x}{\hat{z}} + \comm{\hat{z}}{\hat{z}} \hat{p}_x + - \hat{x} \comm{\hat{p}_z}{\hat{z}} - \comm{\hat{x}}{\hat{z}} \hat{p}_z + = i \hbar \hat{x} + \\ + \comm{\hat{L}_z}{\hat{y}} + &= \comm{\hat{x} \hat{p}_y}{\hat{y}} - \comm{\hat{y} \hat{p}_x}{\hat{y}} + = \hat{x} \comm{\hat{p}_y}{\hat{y}} + \comm{\hat{x}}{\hat{y}} \hat{p}_y + - \hat{y} \comm{\hat{p}_x}{\hat{y}} - \comm{\hat{y}}{\hat{y}} \hat{p}_x + = - i \hbar \hat{x} +\end{aligned}$$ + +Substituting these then leads us to the first milestone of this proof: + +$$\begin{aligned} + \comm{\hat{L}^2}{\hat{x}} + &= i \hbar \big( \!-\! i \hbar \hat{x} - \hat{z} \hat{L}_y - \hat{z} \hat{L}_y + - i \hbar \hat{x} + \hat{y} \hat{L}_z + \hat{y} \hat{L}_z \big) + \\ + &= 2 i \hbar (\hat{y} \hat{L}_z - \hat{z} \hat{L}_y - i \hbar \hat{x}) +\end{aligned}$$ + +Repeating this process for $\comm{\hat{L}^2}{\hat{y}}$ and $\comm{\hat{L}^2}{\hat{z}}$, +we find analogous expressions: + +$$\begin{aligned} + \comm{\hat{L}^2}{\hat{y}} + &= 2 i \hbar (\hat{z} \hat{L}_x - \hat{x} \hat{L}_z - i \hbar \hat{y}) + \\ + \comm{\hat{L}^2}{\hat{z}} + &= 2 i \hbar (\hat{x} \hat{L}_y - \hat{y} \hat{L}_x - i \hbar \hat{z}) +\end{aligned}$$ + +Next, we take the commutator with $\hat{L}^2$ of the commutator we just found: + +$$\begin{aligned} + \comm{\hat{L}^2}{\comm{\hat{L}^2}{\hat{x}}} + &= 2 i \hbar \big(\comm{\hat{L}^2}{\hat{y} \hat{L}_z} - \comm{\hat{L}^2}{\hat{z} \hat{L}_y} - i \hbar \comm{\hat{L}^2}{\hat{x}}\big) + \\ + &= 2 i \hbar \big( \hat{y} \comm{\hat{L}^2}{\hat{L}_z} + \comm{\hat{L}^2}{\hat{y}} \hat{L}_z + - \hat{z} \comm{\hat{L}^2}{\hat{L}_y} - \comm{\hat{L}^2}{\hat{z}} \hat{L}_y + - i \hbar \comm{\hat{L}^2}{\hat{x}} \big) +\end{aligned}$$ + +Where we used that $\comm{\hat{L}^2}{\hat{L}_y} = \comm{\hat{L}^2}{\hat{L}_z} = 0$. +The other commutators look familiar: + +$$\begin{aligned} + \comm{\hat{L}^2}{\comm{\hat{L}^2}{\hat{x}}} + &= 2 i \hbar \big( \comm{\hat{L}^2}{\hat{y}} \hat{L}_z + - \comm{\hat{L}^2}{\hat{z}} \hat{L}_y + - i \hbar \comm{\hat{L}^2}{\hat{x}} \big) +\end{aligned}$$ + +By inserting the expressions we found earlier for these commutators, we get: + +$$\begin{aligned} + \comm{\hat{L}^2}{\comm{\hat{L}^2}{\hat{x}}} + &= - 4 \hbar^2 \big( \hat{z} \hat{L}_x \hat{L}_z - \hat{x} \hat{L}_z^2 - i \hbar \hat{y} \hat{L}_z + + \hat{y} \hat{L}_x \hat{L}_y - \hat{x} \hat{L}_y^2 + i \hbar \hat{z} \hat{L}_y \big) \\ + &\qquad\qquad + 2 \hbar^2 \big( \hat{L}^2 \hat{x} - \hat{x} \hat{L}^2 \big) +\end{aligned}$$ + +Substituting the well-known commutators +$i \hbar \hat{L}_y = \comm{\hat{L}_z}{\hat{L}_x}$ and +$i \hbar \hat{L}_z = \comm{\hat{L}_x}{\hat{L}_y}$: + +$$\begin{aligned} + \comm{\hat{L}^2}{\comm{\hat{L}^2}{\hat{x}}} + &= - 4 \hbar^2 \big( \hat{z} \hat{L}_x \hat{L}_z + \hat{y} \hat{L}_x \hat{L}_y + - \hat{x} \hat{L}_y^2 - \hat{x} \hat{L}_z^2 + + \hat{z} \comm{\hat{L}_z}{\hat{L}_x} - \hat{y} \comm{\hat{L}_x}{\hat{L}_y} \big) \\ + &\qquad\qquad + 2 \hbar^2 \big( \hat{L}^2 \hat{x} - \hat{x} \hat{L}^2 \big) + \\ + &= - 4 \hbar^2 \big( \hat{z} \hat{L}_z \hat{L}_x + \hat{y} \hat{L}_y \hat{L}_x + - \hat{x} \hat{L}_y^2 - \hat{x} \hat{L}_z^2 \big) + + 2 \hbar^2 \big( \hat{L}^2 \hat{x} - \hat{x} \hat{L}^2 \big) +\end{aligned}$$ + +By definition, $\hat{L}_x^2 + \hat{L}_y^2 + \hat{L}_z^2 = \hat{L}^2$, +which we use to arrive at: + +$$\begin{aligned} + \comm{\hat{L}^2}{\comm{\hat{L}^2}{\hat{x}}} + &= - 4 \hbar^2 \big( \hat{z} \hat{L}_z \hat{L}_x + \hat{y} \hat{L}_y \hat{L}_x + \hat{x} \hat{L}_x^2 - \hat{x} \hat{L}^2 \big) + + 2 \hbar^2 \big( \hat{L}^2 \hat{x} - \hat{x} \hat{L}^2 \big) + \\ + &= - 4 \hbar^2 \big( \hat{z} \hat{L}_z \hat{L}_x + \hat{y} \hat{L}_y \hat{L}_x + \hat{x} \hat{L}_x^2 \big) + + 2 \hbar^2 \big( \hat{L}^2 \hat{x} + \hat{x} \hat{L}^2 \big) +\end{aligned}$$ + +The second term is what we want to prove, +so the first term must vanish: + +$$\begin{aligned} + \hat{z} \hat{L}_z \hat{L}_x + \hat{y} \hat{L}_y \hat{L}_x + \hat{x} \hat{L}_x^2 + = (\vu{r} \cdot \vu{L}) \hat{L}_x + = (\vu{r} \cdot (\vu{r} \cross \vu{p})) \hat{L}_x + = (\vu{p} \cdot (\vu{r} \cross \vu{r})) \hat{L}_x + = 0 +\end{aligned}$$ + +Where $\vu{L} = \vu{r} \cross \vu{p}$ by definition, +and the cross product of a vector with itself is zero. + +This process can be repeated for +$\comm{\hat{L}^2}{\comm{\hat{L}^2}{\hat{y}}}$ and +$\comm{\hat{L}^2}{\comm{\hat{L}^2}{\hat{z}}}$, +leading us to: + +$$\begin{aligned} + \comm{\hat{L}^2}{\comm{\hat{L}^2}{\hat{x}}} + &= 2 \hbar^2 (\hat{x} \hat{L}^2 + \hat{L}^2 \hat{x}) + \\ + \comm{\hat{L}^2}{\comm{\hat{L}^2}{\hat{y}}} + &= 2 \hbar^2 (\hat{y} \hat{L}^2 + \hat{L}^2 \hat{y}) + \\ + \comm{\hat{L}^2}{\comm{\hat{L}^2}{\hat{z}}} + &= 2 \hbar^2 (\hat{z} \hat{L}^2 + \hat{L}^2 \hat{z}) +\end{aligned}$$ + +At last, this brings us to the desired equation for $\comm{\hat{L}^2}{\comm{\hat{L}^2}{\vu{r}}}$, +with $\vu{r} = (\hat{x}, \hat{y}, \hat{z})$. +</div> +</div> + +We then multiply this relation by $\Bra{f} = \Bra{\ell_f m_f}$ on the left +and $\Ket{i} = \Ket{\ell_i m_i}$ on the right, +so the right-hand side becomes: + +$$\begin{aligned} + 2 \hbar^2 \matrixel{f}{\vu{r} \hat{L}^2 \!\!+\! \hat{L}^2 \!\vu{r}}{i} + &= 2 \hbar^2 \big( \matrixel{f}{\vu{r} \hat{L}^2}{i} + \matrixel{f}{\hat{L}^2 \vu{r}}{i} \big) + \\ + &= 2 \hbar^2 \big( \hbar^2 \ell_i (\ell_i \!+\! 1) \matrixel{f}{\vu{r}}{i} + + \hbar^2 \ell_f (\ell_f \!+\! 1) \matrixel{f}{\vu{r}}{i} \big) + \\ + &= 2 \hbar^4 \big(\ell_f (\ell_f \!+\! 1) + \ell_i (\ell_i \!+\! 1)\big) \matrixel{f}{\vu{r}}{i} +\end{aligned}$$ + +And, likewise, the left-hand side becomes: + +$$\begin{aligned} + \matrixel{f}{\comm{\hat{L}^2}{\comm{\hat{L}^2}{\vu{r}}}}{i} + &= \matrixel{f}{\hat{L}^2 \comm{\hat{L}^2}{\vu{r}}}{i} + - \matrixel{f}{\comm{\hat{L}^2}{\vu{r}} \hat{L}^2}{i} + \\ + &= \hbar^2 \ell_f (\ell_f \!+\! 1) \matrixel{f}{\comm{\hat{L}^2}{\vu{r}}}{i} + - \hbar^2 \ell_i (\ell_i \!+\! 1) \matrixel{f}{\comm{\hat{L}^2}{\vu{r}}}{i} + \\ + &= \hbar^2 \big( \ell_f (\ell_f \!+\! 1) - \ell_i (\ell_i \!+\! 1) \big) \matrixel{f}{\comm{\hat{L}^2}{\vu{r}}}{i} + \\ + &= \hbar^2 \big( \ell_f (\ell_f \!+\! 1) - \ell_i (\ell_i \!+\! 1) \big) + \big( \matrixel{f}{\hat{L}^2 \vu{r}}{i} - \matrixel{f}{\vu{r} \hat{L}^2}{i} \big) + \\ + &= \hbar^4 \big( \ell_f (\ell_f \!+\! 1) - \ell_i (\ell_i \!+\! 1) \big)^2 \matrixel{f}{\vu{r}}{i} +\end{aligned}$$ + +Obviously, both sides are equal to each other, +leading to the following equation: + +$$\begin{aligned} + 2 \ell_f (\ell_f \!+\! 1) + 2 \ell_i (\ell_i \!+\! 1) + &= \big( \ell_f (\ell_f \!+\! 1) - \ell_i (\ell_i \!+\! 1) \big)^2 +\end{aligned}$$ + +To proceed, we rewrite the right-hand side like so: + +$$\begin{aligned} + \big( \ell_f (\ell_f \!+\! 1) - \ell_i (\ell_i \!+\! 1) \big)^2 + &= \big( \ell_f^2 - \ell_i^2 + \ell_f - \ell_i \big)^2 + \\ + &= \big( (\ell_f + \ell_i) (\ell_f - \ell_i) + (\ell_f - \ell_i) \big)^2 + \\ + &= (\ell_f + \ell_i)^2 (\ell_f - \ell_i)^2 + 2 (\ell_f + \ell_i) (\ell_f - \ell_i)^2 + (\ell_f - \ell_i)^2 + \\ + &= \big( (\ell_f + \ell_i)^2 + 2 (\ell_f + \ell_i) + 1 \big) (\ell_f - \ell_i)^2 + \\ + &= (\ell_f + \ell_i + 1)^2 (\ell_f - \ell_i)^2 +\end{aligned}$$ + +And then we do the same to the left-hand side, yielding: + +$$\begin{aligned} + 2 (\ell_f^2 + \ell_i^2 + \ell_f + \ell_i) + &= 2 \ell_f^2 + 2 \ell_i^2 + 2 \ell_f \ell_i - 2 \ell_f \ell_i + 2 \ell_f + 2 \ell_i + 1 - 1 + \\ + &= (\ell_f + \ell_i + 1)^2 + \ell_f^2 + \ell_i^2 - 2 \ell_f \ell_i - 1 + \\ + &= (\ell_f + \ell_i + 1)^2 + (\ell_f - \ell_i)^2 - 1 +\end{aligned}$$ + +The equation above has thus been simplified to the following form: + +$$\begin{aligned} + (\ell_f + \ell_i + 1)^2 + (\ell_f - \ell_i)^2 - 1 + &= (\ell_f + \ell_i + 1)^2 (\ell_f - \ell_i)^2 +\end{aligned}$$ + +Rearranging yields a product equal to zero, +so one or both of the factors must vanish: + +$$\begin{aligned} + 0 + &= (\ell_f + \ell_i + 1)^2 (\ell_f - \ell_i)^2 - (\ell_f + \ell_i + 1)^2 - (\ell_f - \ell_i)^2 + 1 + \\ + &= \big( (\ell_f + \ell_i + 1)^2 - 1 \big) \big( (\ell_f - \ell_i)^2 - 1 \big) +\end{aligned}$$ + +The first factor is zero if $\ell_f = \ell_i = 0$, +in which case the matrix element $\matrixel{f}{\vu{r}}{i} = 0$ anyway. +The other, non-trivial option is therefore: + +$$\begin{aligned} + (\ell_f - \ell_i)^2 + = 1 +\end{aligned}$$ +</div> +</div> + + +## Rotational rules + +Given a general (pseudo)scalar operator $\hat{s}$, +which, by nature, must satisfy the +following relations with the angular momentum operators: + +$$\begin{aligned} + \comm{\hat{L}^2}{\hat{s}} = 0 + \qquad + \comm{\hat{L}_z}{\hat{s}} = 0 + \qquad + \comm{\hat{L}_{\pm}}{\hat{s}} = 0 +\end{aligned}$$ + +Where $\hat{L}_\pm \equiv \hat{L}_x \pm i \hat{L}_y$. +The inner product of any such $\hat{s}$ must obey these selection rules: + +$$\begin{aligned} + \boxed{ + \Delta \ell = 0 + } + \qquad \quad + \boxed{ + \Delta m = 0 + } +\end{aligned}$$ + +It is common to write this in the following more complete way, where +$\matrixel{\ell_f}{|\hat{s}|}{\ell_i}$ is the **reduced matrix element**, +which is identical to $\matrixel{\ell_f m_f}{\hat{s}}{\ell_i m_i}$, but +with a different notation to say that it does not depend on $m_f$ or $m_i$: + +$$\begin{aligned} + \boxed{ + \matrixel{\ell_f m_f}{\hat{s}}{\ell_i m_i} + = \delta_{\ell_f \ell_i} \delta_{m_f m_i} \matrixel{\ell_f}{|\hat{s}|}{\ell_i} + } +\end{aligned}$$ + +<div class="accordion"> +<input type="checkbox" id="proof-rot-scalar"/> +<label for="proof-rot-scalar">Proof</label> +<div class="hidden" markdown="1"> +<label for="proof-rot-scalar">Proof.</label> +Firstly, we look at the commutator of $\hat{s}$ with the $z$-component $\hat{L}_z$: +$$\begin{aligned} + 0 + = \matrixel{\ell_f m_f}{\comm{\hat{L}_z}{\hat{s}}}{\ell_i m_i} + &= \matrixel{\ell_f m_f}{\hat{L}_z \hat{s}}{\ell_i m_i} - \matrixel{\ell_f m_f}{\hat{s} \hat{L}_z}{\ell_i m_i} + \\ + &= \hbar (m_f - m_i) \matrixel{\ell_f m_f}{\hat{s}}{\ell_i m_i} +\end{aligned}$$ + +Which can only be true if $m_f \!-\! m_i = 0$, unless, +of course, $\matrixel{\ell_f m_f}{\hat{s}}{\ell_i m_i} = 0$ by itself. + +Secondly, we look at the commutator of $\hat{s}$ with the total angular momentum $\hat{L}^2$: + +$$\begin{aligned} + 0 + = \matrixel{\ell_f m_f}{\comm{\hat{L}^2}{\hat{s}}}{\ell_i m_i} + &= \matrixel{\ell_f m_f}{\hat{L}^2 \hat{s}}{\ell_i m_i} - \matrixel{\ell_f m_f}{\hat{s} \hat{L}^2}{\ell_i m_i} + \\ + &= \hbar^2 \big( \ell_f (\ell_f \!+\! 1) - \ell_i (\ell_i \!+\! 1) \big) \matrixel{\ell_f m_f}{\hat{s}}{\ell_i m_i} +\end{aligned}$$ + +Assuming $\matrixel{\ell_f m_f}{\hat{s}}{\ell_i m_i} \neq 0$, +this can only be satisfied if the following holds: + +$$\begin{aligned} + 0 + = \ell_f^2 + \ell_f - \ell_i^2 - \ell_i + = (\ell_f + \ell_i) (\ell_f - \ell_i) + (\ell_f - \ell_i) +\end{aligned}$$ + +If $\ell_f = \ell_i = 0$ this equation is trivially satisfied. +Otherwise, the only option is $\ell_f \!-\! \ell_i = 0$, +which is another part of the selection rule. + +Thirdly, we look at the commutator of $\hat{s}$ with the ladder operators $\hat{L}_\pm$: + +$$\begin{aligned} + 0 + = \matrixel{\ell_f m_f}{\comm{\hat{L}_\pm}{\hat{s}}}{\ell_i m_i} + &= \matrixel{\ell_f m_f}{\hat{L}_\pm \hat{s}}{\ell_i m_i} - \matrixel{\ell_f m_f}{\hat{s} \hat{L}_\pm}{\ell_i m_i} + \\ + &= C_f \matrixel{\ell_f (m_f\!\mp\!1)}{\hat{s}}{\ell_i m_i} - C_i \matrixel{\ell_f m_f}{\hat{s}}{\ell_i (m_i\!\pm\!1)} +\end{aligned}$$ + +Where $C_f$ and $C_i$ are constants given below. +We already know that $\Delta \ell = 0$ and $\Delta m = 0$, +so the above matrix elements are only nonzero if $m_f = m_i \pm 1$. +Therefore: + +$$\begin{aligned} + C_i + &= \hbar \sqrt{\ell_i (\ell_i + 1) - m_i (m_i \pm 1)} + \\ + C_f + &= \hbar \sqrt{\ell_f (\ell_f \!+\! 1) - m_f (m_f \!\mp\! 1)} + \\ + &= \hbar \sqrt{\ell_f (\ell_f \!+\! 1) - (m_i \!\pm\! 1) (m_i \!\pm\! 1 \!\mp\! 1)} + \\ + &= \hbar \sqrt{\ell_f (\ell_f \!+\! 1) - m_i (m_i \!\pm\! 1)} +\end{aligned}$$ + +In other words, $C_f = C_i$. The above equation therefore reduces to: + +$$\begin{aligned} + \matrixel{\ell_f m_i}{\hat{s}}{\ell_i m_i} + &= \matrixel{\ell_f (m_i \!\pm\! 1)}{\hat{s}}{\ell_i (m_i\!\pm\!1)} +\end{aligned}$$ + +Which means that the value of the matrix element +does not depend on $m_i$ (or $m_f$) at all. +</div> +</div> + +Similarly, given a general (pseudo)vector operator $\vu{V}$, +which, by nature, must satisfy the following commutation relations, +where $\hat{V}_\pm \equiv \hat{V}_x \pm i \hat{V}_y$: + +$$\begin{gathered} + \comm{\hat{L}_z}{\hat{V}_z} = 0 + \qquad + \comm{\hat{L}_z}{\hat{V}_{\pm}} = \pm \hbar \hat{V}_{\pm} + \qquad + \comm{\hat{L}_{\pm}}{\hat{V}_z} = \mp \hbar \hat{V}_{\pm} + \\ + \comm{\hat{L}_{\pm}}{\hat{V}_{\pm}} = 0 + \qquad + \comm{\hat{L}_{\pm}}{\hat{V}_{\mp}} = \pm 2 \hbar \hat{V}_z +\end{gathered}$$ + +The inner product of any such $\vu{V}$ must obey the following selection rules: + +$$\begin{aligned} + \boxed{ + \Delta \ell + = 0 \:\:\mathrm{or}\: \pm 1 + } + \qquad + \boxed{ + \Delta m + = 0 \:\:\mathrm{or}\: \pm 1 + } +\end{aligned}$$ + +In fact, the complete result involves the Clebsch-Gordan coefficients (from spin addition): + +$$\begin{gathered} + \boxed{ + \matrixel{\ell_f m_f}{\hat{V}_{z}}{\ell_i m_i} + = C^{\ell_i \: 1 \: \ell_f}_{m_i \: 0 \:m_f} \matrixel{\ell_f}{|\hat{V}|}{\ell_i} + } + \\ + \boxed{ + \matrixel{\ell_f m_f}{\hat{V}_{+}}{\ell_i m_i} + = - \sqrt{2} C^{\ell_i \: 1 \: \ell_f}_{m_i \: 1 \:m_f} \matrixel{\ell_f}{|\hat{V}|}{\ell_i} + } + \\ + \boxed{ + \matrixel{\ell_f m_f}{\hat{V}_{-}}{\ell_i m_i} + = \sqrt{2} C^{\ell_i \: 1 \: \ell_f}_{m_i \: -1 \:m_f} \matrixel{\ell_f}{|\hat{V}}{|\ell_i} + } +\end{gathered}$$ + + +## Superselection rule + +Selection rules are not always about atomic electron transitions, or angular momenta even. + +According to the **principle of indistinguishability**, +permuting identical particles never leads to an observable difference. +In other words, the particles are fundamentally indistinguishable, +so for any observable $\hat{O}$ and multi-particle state $\Ket{\Psi}$, we can say: + +$$\begin{aligned} + \matrixel{\Psi}{\hat{O}}{\Psi} + = \matrixel{\hat{P} \Psi}{\hat{O}}{\hat{P} \Psi} +\end{aligned}$$ + +Where $\hat{P}$ is an arbitrary permutation operator. +Indistinguishability implies that $\comm{\hat{P}}{\hat{O}} = 0$ +for all $\hat{O}$ and $\hat{P}$, +which lets us prove the above equation, using that $\hat{P}$ is unitary: + +$$\begin{aligned} + \matrixel{\hat{P} \Psi}{\hat{O}}{\hat{P} \Psi} + = \matrixel{\Psi}{\hat{P}^{-1} \hat{O} \hat{P}}{\Psi} + = \matrixel{\Psi}{\hat{P}^{-1} \hat{P} \hat{O}}{\Psi} + = \matrixel{\Psi}{\hat{O}}{\Psi} +\end{aligned}$$ + +Consider a symmetric state $\Ket{s}$ and an antisymmetric state $\Ket{a}$ +(see [Pauli exclusion principle](/know/concept/pauli-exclusion-principle/)), +which obey the following for a permutation $\hat{P}$: + +$$\begin{aligned} + \hat{P} \Ket{s} + = \Ket{s} + \qquad + \hat{P} \Ket{a} + = - \Ket{a} +\end{aligned}$$ + +Any obervable $\hat{O}$ then satisfies the equation below, +again thanks to the fact that $\hat{P} = \hat{P}^{-1}$: + +$$\begin{aligned} + \matrixel{s}{\hat{O}}{a} + = \matrixel{\hat{P} s}{\hat{O}}{a} + = \matrixel{s}{\hat{P}^{-1} \hat{O}}{a} + = \matrixel{s}{\hat{O} \hat{P}}{a} + = \matrixel{s}{\hat{O}}{\hat{P} a} + = - \matrixel{s}{\hat{O}}{a} +\end{aligned}$$ + +This leads us to the **superselection rule**, +which states that there can never be any interference +between states of different permutation symmetry: + +$$\begin{aligned} + \boxed{ + \matrixel{s}{\hat{O}}{a} + = 0 + } +\end{aligned}$$ + + + +## References +1. D.J. Griffiths, D.F. Schroeter, + *Introduction to quantum mechanics*, 3rd edition, + Cambridge. diff --git a/source/know/concept/self-energy/dyson.png b/source/know/concept/self-energy/dyson.png Binary files differnew file mode 100644 index 0000000..75f82c8 --- /dev/null +++ b/source/know/concept/self-energy/dyson.png diff --git a/source/know/concept/self-energy/fullgf.png b/source/know/concept/self-energy/fullgf.png Binary files differnew file mode 100644 index 0000000..631d23f --- /dev/null +++ b/source/know/concept/self-energy/fullgf.png diff --git a/source/know/concept/self-energy/index.md b/source/know/concept/self-energy/index.md new file mode 100644 index 0000000..05eefaa --- /dev/null +++ b/source/know/concept/self-energy/index.md @@ -0,0 +1,307 @@ +--- +title: "Self-energy" +date: 2021-11-21 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +Suppose we have a time-independent Hamiltonian $\hat{H} = \hat{H}_0 + \hat{W}$, +consisting of a simple $\hat{H}_0$ and a difficult interaction $\hat{W}$, +for example describing Coulomb repulsion between electrons. + +The concept of [imaginary time](/know/concept/imaginary-time/) +exists to handle such difficult time-independent Hamiltonians +at nonzero temperatures. Therefore, we know that the +[Matsubara Green's function](/know/concept/matsubara-greens-function/) +$G$ can be written as follows, where $\mathcal{T}$ is the +[time-ordered product](/know/concept/time-ordered-product/), +and $\beta = 1 / (k_B T)$: + +$$\begin{aligned} + G_{s_b s_a}(\vb{r}_b, \tau_b; \vb{r}_a, \tau_a) + = \frac{\Expval{\mathcal{T}\Big\{ \hat{K}(\hbar \beta, 0) \hat{\Psi}_{s_b}(\vb{r}_b, \tau_b) \hat{\Psi}_{s_a}^\dagger(\vb{r}_a, \tau_a) \Big\}}} + {\hbar \Expval{\hat{K}(\hbar \beta, 0)}} +\end{aligned}$$ + +Where we know that the time evolution operator $\hat{K}$ +is as follows in the [interaction picture](/know/concept/interaction-picture/): + +$$\begin{aligned} + \hat{K}(\tau_2, \tau_1) + &= \mathcal{T}\bigg\{ \exp\!\bigg( \!-\!\frac{1}{\hbar} \int_{\tau_1}^{\tau_2} \hat{W}(\tau) \dd{\tau} \bigg) \bigg\} + \\ + &= \sum_{n = 0}^\infty \frac{1}{n!} \Big( \!-\!\frac{1}{\hbar} \Big)^n + \mathcal{T}\bigg\{ \bigg( \int_{\tau_1}^{\tau_2} \hat{W}(\tau) \dd{\tau} \bigg)^n \bigg\} +\end{aligned}$$ + +Where $\hat{W}$ is the two-body operator in the interaction picture. +We insert this into the full Green's function above, +and abbreviate +$G_{ba} \equiv G_{s_b s_a}(\vb{r}_b, \tau_b; \vb{r}_a, \tau_a)$ +and $\hat{\Psi}_a \equiv \hat{\Psi}_{s_a}(\vb{r}_a, \tau_a)$: + +$$\begin{aligned} + G_{ba} + &= \frac{\displaystyle\sum_{n = 0}^\infty \frac{1}{n!} \Big( \!-\!\frac{1}{\hbar} \Big)^n \int\cdots\int_0^{\hbar \beta} + \Expval{\mathcal{T}\Big\{ \hat{W}(\tau_1) \cdots \hat{W}(\tau_n) \hat{\Psi}_b \hat{\Psi}_a^\dagger \Big\}} \dd{\tau_1} \cdots \dd{\tau_n}} + {\hbar \displaystyle\sum_{n = 0}^\infty \frac{1}{n!} \Big( \!-\!\frac{1}{\hbar} \Big)^n \int\cdots\int_0^{\hbar \beta} + \Expval{\mathcal{T}\Big\{ \hat{W}(\tau_1) \cdots \hat{W}(\tau_n) \Big\}} \dd{\tau_1} \cdots \dd{\tau_n}} +\end{aligned}$$ + +Next, we write out the interaction operator $\hat{W}$ +in the [second quantization](/know/concept/second-quantization/), +assuming there is no spin-flipping, +and that $W(\vb{r}_1, \vb{r}_2) = W(\vb{r}_2, \vb{r}_1)$ +(hence $1/2$ to avoid double-counting): + +$$\begin{aligned} + \hat{W}(\tau_1) + &= \frac{1}{2} \sum_{s_1 s_2} \iint_{-\infty}^\infty \hat{\Psi}_{s_1}^\dagger(\vb{r}_1, \tau_1) \hat{\Psi}_{s_2}^\dagger(\vb{r}_2, \tau_1) + W(\vb{r}_1, \vb{r}_2) \hat{\Psi}_{s_2}(\vb{r}_2, \tau_1) \hat{\Psi}_{s_1}(\vb{r}_1, \tau_1) \dd{\vb{r}_1} \dd{\vb{r}_2} +\end{aligned}$$ + +We integrate this over $\tau_1$ and over a dummy $\tau_2$. +Defining $W_{j'j} \equiv W(\vb{r}_j', \vb{r}_j) \: \delta(\tau_1 \!-\! \tau_2)$ we get: + +$$\begin{aligned} + \int_0^{\hbar \beta} \hat{W}(\tau_1) \dd{\tau_1} + &= \frac{1}{2} \iint \hat{\Psi}_{s_1}^\dagger(\vb{r}_1, \tau_1) \hat{\Psi}_{s_2}^\dagger(\vb{r}_2, \tau_2) + \: W_{1,2} \: \hat{\Psi}_{s_2}(\vb{r}_2, \tau_2) \hat{\Psi}_{s_1}(\vb{r}_1, \tau_1) \dd{\tau_2} \dd{\vb{r}_1} \dd{\vb{r}_2} + \\ + &= \frac{1}{2} \iint \hat{\Psi}_1^\dagger \hat{\Psi}_2^\dagger W_{1,2} \hat{\Psi}_2 \hat{\Psi}_1 \dd{1} \dd{2} +\end{aligned}$$ + +Where we have further abbreviated $\int \dd{j} \equiv \sum_{s_j} \int \dd{\vb{r}_j} \int \dd{\tau_j}$. +The full $G_{ba}$ thus becomes: + +$$\begin{aligned} + G_{ba} + &= \frac{\displaystyle\sum_{n = 0}^\infty \frac{1}{n!} \Big( \!-\! \frac{1}{2 \hbar} \Big)^n (-\hbar)^{2n+1} + \int\cdots\int W_{1'1} \cdots W_{n'n} \: \Big( G^0_\mathrm{num} \Big) \dd{1'} \dd{1} \cdots \dd{n'} \dd{n}} + {\hbar \displaystyle\sum_{n = 0}^\infty \frac{1}{n!} \Big( \!-\! \frac{1}{2 \hbar} \Big)^n (-\hbar)^{2n} + \int\cdots\int W_{1'1} \cdots W_{n'n} \: \Big( G^0_\mathrm{den} \Big) \dd{1'} \dd{1} \cdots \dd{n'} \dd{n}} +\end{aligned}$$ + +Where we have realized that both the numerator and denominator +contain many-particle non-interacting Green's functions, defined as: + +$$\begin{aligned} + G^0_\mathrm{num}(b1'1 \cdots n'n; a1'1 \cdots n'n) + &= \Big( \!-\!\frac{1}{\hbar} \Big)^{2 n + 1} + \Expval{\mathcal{T}\Big\{ \hat{\Psi}_{1'}^\dagger \hat{\Psi}_{1}^\dagger \hat{\Psi}_{1} \hat{\Psi}_{1'} \cdots + \hat{\Psi}_{n'}^\dagger \hat{\Psi}_{n}^\dagger \hat{\Psi}_{n} \hat{\Psi}_{n'} \hat{\Psi}_b \hat{\Psi}_a^\dagger \Big\}} + \\ + G^0_\mathrm{den}(1'1 \cdots n'n; 1'1 \cdots n'n) + &= \Big( \!-\!\frac{1}{\hbar} \Big)^{2 n} + \Expval{\mathcal{T}\Big\{ \hat{\Psi}_{1'}^\dagger \hat{\Psi}_{1}^\dagger \hat{\Psi}_{1} \hat{\Psi}_{1'} \cdots + \hat{\Psi}_{n'}^\dagger \hat{\Psi}_{n}^\dagger \hat{\Psi}_{n} \hat{\Psi}_{n'} \Big\}} +\end{aligned}$$ + +By applying [Wick's theorem](/know/concept/wicks-theorem/), +we can rewrite these as a sum of products of single-particle Green's functions, +so for instance $G^0_\mathrm{num}(b1'1 \cdots n'n; a1'1 \cdots n'n)$ becomes: + +$$\begin{aligned} + G^0_\mathrm{num}(b1'1 \cdots n'n; a1'1 \cdots n'n) + = \mathrm{det} \begin{bmatrix} + G^0_{ba} & G^0_{b1'} & G^0_{b1} & G^0_{b2'} & \cdots & G^0_{bn'} & G^0_{bn} \\ + G^0_{1'a} & G^0_{1'1'} & G^0_{1'1} & G^0_{1'2'} & \cdots & G^0_{1'n'} & G^0_{1'n} \\ + \vdots & \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ + G^0_{n'a} & G^0_{n'1'} & G^0_{n'1} & G^0_{n'2'} & \cdots & G^0_{n'n'} & G^0_{n'n} \\ + G^0_{na} & G^0_{n1'} & G^0_{n1} & G^0_{n2'} & \cdots & G^0_{nn'} & G^0_{nn} + \end{bmatrix} +\end{aligned}$$ + +And analogously for $G^0_\mathrm{den}$. +If we are studying bosons instead of fermions, +the above determinant would need to be replaced by a *permanent*. +We assume fermions from now on. + +We thus have sums over all permutations $p$ +of products of single-particle Green's function, +times $(-1)^p$ to account for swaps of fermionic operators: + +$$\begin{aligned} + G_{ba} + &= -\frac{\displaystyle\sum_{n = 0}^\infty \frac{1}{n!} \Big( \!-\! \frac{\hbar}{2} \Big)^n + \int\cdots\int W_{1'1} \cdots W_{n'n} \: \Big( \sum_{p} (-1)^p \prod_{m = 1}^{2 n + 1} G^0_{(p,m)} \Big) \dd{1}' \dd{1} \cdots \dd{n'} \dd{n}} + {\displaystyle\sum_{n = 0}^\infty \frac{1}{n!} \Big( \!-\! \frac{\hbar}{2} \Big)^n + \int\cdots\int W_{1'1} \cdots W_{n'n} \: \Big( \sum_{p} (-1)^p \prod_{m = 1}^{2 n} G^0_{(p,m)} \Big) \dd{1'} \dd{1} \cdots \dd{n'} \dd{n}} +\end{aligned}$$ + +These integrals over products of interactions and Green's functions +are the perfect place to apply [Feynman diagrams](/know/concept/feynman-diagram/). +Conveniently, it turns out that the factor $(-1)^p$ +is equivalent to the rule that each diagram must be multiplied by $(-1)^F$, +with $F$ the number of fermion loops. +Keep in mind that fermion lines absorb a factor $-\hbar$ each (see above), +and interactions $-1/\hbar$. + +The denominator turns into a sum of all possible diagrams +(including equivalent ones) for each total order $n$ +(the order is the number of interaction lines). +The endpoints $a$ and $b$ do not appear here, +so we conclude that all those diagrams only have internal vertices; +we will therefore refer to them as **internal diagrams**. + +And in the numerator, we sum over all diagrams of total order $n$ +containing the external vertices $a$ and $b$. +Some of them are **connected**, +so all vertices (including $a$ and $b$) are in the same graph, +but most are **disconnected**. +Because disconnected diagrams have no shared lines or vertices to integrate over, +they can simply be factored into separate diagrams. + +If it contains $a$ and $b$, we call it an **external diagram**, +and then clearly all disconnected parts must be internal diagrams +($a$ and $b$ are always connected, +since they are the only vertices with just one fermion line; +all internal vertices must have two). +We thus find: + +$$\begin{aligned} + G_{ba} + &= \frac{\displaystyle\sum_{n = 0}^\infty \frac{1}{2^n n!} + \bigg[ \sum_{m = 0}^{n} \frac{n!}{m! (n \!-\! m)!} \binom{1 \; \mathrm{external}}{\mathrm{order} \; m}_{\!\Sigma\mathrm{all}} + \binom{\mathrm{0\;or\;more\;internal}}{\mathrm{total\;order} \; (n \!-\! m)}_{\!\Sigma\mathrm{all}} \bigg]} + {\hbar \displaystyle\sum_{n = 0}^\infty \frac{1}{2^n n!} \binom{\mathrm{0\;or\;more\;internal}}{\mathrm{total\;order} \; n}_{\!\Sigma\mathrm{all}}} +\end{aligned}$$ + +Where the total order is the sum of the orders of all considered diagrams, +and the new factor is needed for all the possible choices +of vertices to put in the external part. +Note that the external diagram does not directly depend on $n$, +so we reorganize: + +$$\begin{aligned} + G_{ba} + &= \frac{\displaystyle\sum_{m = 0}^{\infty} \frac{1}{2^m m!} \binom{1 \; \mathrm{external}}{\mathrm{order} \; m}_{\!\Sigma\mathrm{all}} + \bigg[ \sum_{n = 0}^\infty \frac{1}{2^{n-m} (n \!-\! m)!} + \binom{\mathrm{0\;or\;more\;internal}}{\mathrm{total\;order} \; (n \!-\! m)}_{\!\Sigma\mathrm{all}} \bigg]} + {\hbar \displaystyle\sum_{n = 0}^\infty \frac{1}{2^n n!} \binom{\mathrm{0\;or\;more\;internal}}{\mathrm{total\;order} \; n}_{\!\Sigma\mathrm{all}}} +\end{aligned}$$ + +Since both $n$ and $m$ start at zero, +and the sums include all possible diagrams, +we see that the second sum in the numerator does not actually depend on $m$: + +$$\begin{aligned} + \hbar G_{ba} + &= \frac{\displaystyle\sum_{m = 0}^{\infty} \frac{1}{2^m m!} \binom{1 \; \mathrm{external}}{\mathrm{order} \; m}_{\!\Sigma\mathrm{all}} + \bigg[ \sum_{n = 0}^\infty \frac{1}{2^n n!} \binom{\mathrm{0\;or\;more\;internal}}{\mathrm{total\;order} \; n}_{\!\Sigma\mathrm{all}} \bigg]} + {\displaystyle\sum_{n = 0}^\infty \frac{1}{2^n n!} \binom{\mathrm{0\;or\;more\;internal}}{\mathrm{total\;order} \; n}_{\!\Sigma\mathrm{all}}} + \\ + &= \sum_{m = 0}^{\infty} \frac{1}{2^m m!} \binom{1 \; \mathrm{external}}{\mathrm{order} \; m}_{\!\Sigma\mathrm{all}} +\end{aligned}$$ + +In other words, all the disconnected diagrams simply cancel out, +and we are left with a sum over all possible fully connected diagrams +that contain $a$ and $b$. Furthermore, it can be shown using combinatorics +that exactly $2^m m!$ diagrams at each order are topologically equivalent, +so we are left with non-equivalent diagrams only. +Let $G(b,a) = G_{ba}$: + +<a href="fullgf.png"> +<img src="fullgf.png" style="width:90%"> +</a> + +A **reducible diagram** is a Feynman diagram +that can be cut in two valid diagrams +by removing just one fermion line, +while an **irreducible diagram** cannot be split like that. + +At last, we define the **self-energy** $\Sigma(y,x)$ +as the sum of all irreducible terms in $G(b,a)$, +after removing the two external lines from/to $a$ and $b$: + +<a href="selfenergy.png"> +<img src="selfenergy.png" style="width:90%"> +</a> + +Despite its appearance, the self-energy has the semantics of a line, +so it has two endpoints over which to integrate if necessary. + +By construction, by reattaching $G^0(x,a)$ and $G^0(b,y)$ to the self-energy, +we get all irreducible diagrams, +and by connecting multiple irreducible diagrams with single fermion lines, +we get all fully connected diagrams containing the endpoints $a$ and $b$. + +In other words, the full $G(b,a)$ is constructed +by taking the unperturbed $G^0(b,a)$ +and inserting one or more irreducible diagrams between $a$ and $b$. +We can equally well insert a single irreducible diagram +as a sequence of connected irreducible diagrams. +Thanks to this recursive structure, +you can convince youself that $G(b,a)$ obeys +a [Dyson equation](/know/concept/dyson-equation/) involving $\Sigma(y, x)$: + +<a href="dyson.png"> +<img src="dyson.png" style="width:95%"> +</a> + +This makes sense: in the "normal" Dyson equation +we have a one-body perturbation instead of $\Sigma$, +while $\Sigma$ represents a two-body effect +as an infinite sum of one-body diagrams. +Interpreting this diagrammatic Dyson equation yields: + +$$\begin{aligned} + \boxed{ + G(b, a) + = G^0(b, a) + \iint G^0(b, y) \: \Sigma(y, x) \: G(x, a) \dd{x} \dd{y} + } +\end{aligned}$$ + +Keep in mind that $\int \dd{x} \equiv \sum_{s_x} \int \dd{\vb{r}_x} \int \dd{\tau_x}$. +In the special case of a system with continuous translational symmetry +and no spin dependence, this simplifies to: + +$$\begin{aligned} + \boxed{ + G_{s}(\tilde{\vb{k}}) + = G_{s}^0(\tilde{\vb{k}}) + G_{s}^0(\tilde{\vb{k}}) \: \Sigma_{s}(\tilde{\vb{k}}) \: G_{s}(\tilde{\vb{k}}) + } +\end{aligned}$$ + +Where $\tilde{\vb{k}} \equiv (\vb{k}, i \omega_n)$, +with $\omega_n$ being a fermionic Matsubara frequency. +Note that conservation of spin, $\vb{k}$ and $\omega_n$, +together with the linear structure of the Dyson equation, +makes $\Sigma$ diagonal in all of those quantities. +Isolating for $G$: + +$$\begin{aligned} + G_{s}(\tilde{\vb{k}}) + = \frac{G_{s}^0(\tilde{\vb{k}})}{1 - G_{s}^0(\tilde{\vb{k}}) \: \Sigma_{s}(\tilde{\vb{k}})} + = \frac{1}{1 / G_{s}^0(\tilde{\vb{k}}) - \Sigma_{s}(\tilde{\vb{k}})} +\end{aligned}$$ + +From [equation-of-motion theory](/know/concept/equation-of-motion-theory/), +we already know an expression for $G$ in diagonal $\vb{k}$-space: + +$$\begin{aligned} + G_s^0(\vb{k}, i \omega_n) + = \frac{1}{i \hbar \omega_n - \varepsilon_\vb{k}} + \quad \implies \quad + G_{s}(\vb{k}, i \omega_n) + = \frac{1}{i \hbar \omega_n - \varepsilon_\vb{k} - \Sigma_{s}(\vb{k}, i \omega_n)} +\end{aligned}$$ + +The self-energy thus corrects the non-interacting energies for interactions. +It can therefore be regarded as the energy +a particle has due to changes it has caused in its environment. + +Unfortunately, in practice, $\Sigma$ is rarely as simple as +in the translationally-invariant example above; +in fact, it does not even need to be Hermitian, +i.e. $\Sigma(y,x) \neq \Sigma^*(x,y)$, +in which case it resists the standard techniques for analysis. + + + +## References +1. H. Bruus, K. Flensberg, + *Many-body quantum theory in condensed matter physics*, + 2016, Oxford. diff --git a/source/know/concept/self-energy/selfenergy.png b/source/know/concept/self-energy/selfenergy.png Binary files differnew file mode 100644 index 0000000..59b8542 --- /dev/null +++ b/source/know/concept/self-energy/selfenergy.png diff --git a/source/know/concept/self-phase-modulation/index.md b/source/know/concept/self-phase-modulation/index.md new file mode 100644 index 0000000..b2a4b58 --- /dev/null +++ b/source/know/concept/self-phase-modulation/index.md @@ -0,0 +1,98 @@ +--- +title: "Self-phase modulation" +date: 2021-02-26 +categories: +- Physics +- Optics +- Fiber optics +- Nonlinear optics +layout: "concept" +--- + +In fiber optics, **self-phase modulation** (SPM) is a nonlinear effect +that gradually broadens pulses' spectra. +Unlike dispersion, SPM does create new frequencies: in the $\omega$-domain, +the pulse steadily spreads out with a distinctive "accordion" peak. +Lower frequencies are created at the front of the +pulse and higher ones at the back, giving S-shaped spectrograms. + +A pulse envelope $A(z, t)$ inside a fiber must obey the nonlinear Schrödinger equation, +where the parameters $\beta_2$ and $\gamma$ respectively +control dispersion and nonlinearity: + +$$\begin{aligned} + 0 + = i \pdv{A}{z} - \frac{\beta_2}{2} \pdvn{2}{A}{t} + \gamma |A|^2 A +\end{aligned}$$ + +By setting $\beta_2 = 0$ to neglect dispersion, +solving this equation becomes trivial. +For any arbitrary input pulse $A_0(t) = A(0, t)$, +we arrive at the following analytical solution: + +$$\begin{aligned} + A(z,t) = A_0 \exp\!\big( i \gamma |A_0|^2 z\big) +\end{aligned}$$ + +The intensity $|A|^2$ in the time domain is thus unchanged, +and only its phase is modified. +It is also clear that the largest phase increase occurs at the peak of the pulse, +where the intensity is $P_0$. +To quantify this, it is useful to define the **nonlinear length** $L_N$, +which gives the distance after which the phase of the +peak has increased by exactly 1 radian: + +$$\begin{aligned} + \gamma P_0 L_N = 1 + \qquad \implies \qquad + \boxed{ + L_N = \frac{1}{\gamma P_0} + } +\end{aligned}$$ + +SPM is illustrated below for the following Gaussian initial pulse envelope, +with parameter values $T_0 = 6\:\mathrm{ps}$, $P_0 = 1\:\mathrm{kW}$, +$\beta_2 = 0$, and $\gamma = 0.1/\mathrm{W}/\mathrm{m}$: + +$$\begin{aligned} + A(0, t) + = \sqrt{P_0} \exp\!\Big(\!-\!\frac{t^2}{2 T_0^2}\Big) +\end{aligned}$$ + +From earlier, we then know the analytical solution for the $z$-evolution: + +$$\begin{aligned} + A(z, t) = \sqrt{P_0} \exp\!\Big(\!-\!\frac{t^2}{2 T_0^2}\Big) \exp\!\bigg( i \gamma z P_0 \exp\!\Big(\!-\!\frac{t^2}{T_0^2}\Big) \bigg) +\end{aligned}$$ + +<a href="pheno-spm.jpg"> +<img src="pheno-spm-small.jpg" style="width:100%"> +</a> + +The **instantaneous frequency** $\omega_\mathrm{SPM}(z, t)$, +which describes the dominant angular frequency at a given point in the time domain, +is found to be as follows for the Gaussian pulse, +where $\phi(z, t)$ is the phase of $A(z, t) = \sqrt{P(z, t)} \exp(i \phi(z, t))$: + +$$\begin{aligned} + \omega_{\mathrm{SPM}}(z,t) + = - \pdv{\phi}{t} + = 2 \gamma z P_0 \frac{t}{T_0^2} \exp\!\Big(\!-\!\frac{t^2}{T_0^2}\Big) +\end{aligned}$$ + +This result gives the S-shaped spectrograms seen in the illustration. +The frequency shift thus not only depends on $L_N$, +but also on $T_0$: the spectra of narrow pulses broaden much faster. + +The interaction between self-phase modulation +and [dispersion](/know/concept/dispersive-broadening/) +leads to many interesting effects, +such as [modulational instability](/know/concept/modulational-instability/) +and [optical wave breaking](/know/concept/optical-wave-breaking/). + + + +## References +1. O. Bang, + *Numerical methods in photonics: lecture notes*, 2019, + unpublished. diff --git a/source/know/concept/self-phase-modulation/pheno-spm-small.jpg b/source/know/concept/self-phase-modulation/pheno-spm-small.jpg Binary files differnew file mode 100644 index 0000000..6f041ec --- /dev/null +++ b/source/know/concept/self-phase-modulation/pheno-spm-small.jpg diff --git a/source/know/concept/self-phase-modulation/pheno-spm.jpg b/source/know/concept/self-phase-modulation/pheno-spm.jpg Binary files differnew file mode 100644 index 0000000..6d5c92a --- /dev/null +++ b/source/know/concept/self-phase-modulation/pheno-spm.jpg diff --git a/source/know/concept/self-steepening/index.md b/source/know/concept/self-steepening/index.md new file mode 100644 index 0000000..ba0e906 --- /dev/null +++ b/source/know/concept/self-steepening/index.md @@ -0,0 +1,140 @@ +--- +title: "Self-steepening" +date: 2021-02-26 +categories: +- Physics +- Optics +- Fiber optics +- Nonlinear optics +layout: "concept" +--- + +For a laser pulse travelling through an optical fiber, +its intensity is highest at its peak, so the Kerr effect will be strongest there. +This means that the peak travels slightly slower +than the rest of the pulse, leading to **self-steepening** of its trailing edge. +Mathematically, this is described by adding a new term to the +nonlinear Schrödinger equation: + +$$\begin{aligned} + 0 + = i\pdv{A}{z} - \frac{\beta_2}{2} \pdvn{2}{A}{t} + \gamma \Big(1 + \frac{i}{\omega_0} \pdv{}{t} \Big) \big(|A|^2 A\big) +\end{aligned}$$ + +Where $\omega_0$ is the angular frequency of the pump. +We will use the following ansatz, +consisting of an arbitrary power profile $P$ with a phase $\phi$: + +$$\begin{aligned} + A(z,t) = \sqrt{P(z,t)} \, \exp\!\big(i \phi(z,t)\big) +\end{aligned}$$ + +For a long pulse travelling over a short distance, it is reasonable to +neglect dispersion ($\beta_2 = 0$). +Inserting the ansatz then gives the following, where $\varepsilon = \gamma / \omega_0$: + +$$\begin{aligned} + 0 &= i \frac{1}{2} \frac{P_z}{\sqrt{P}} - \sqrt{P} \phi_z + \gamma P \sqrt{P} + i \varepsilon \frac{3}{2} P_t \sqrt{P} - \varepsilon P \sqrt{P} \phi_t +\end{aligned}$$ + +This results in two equations, respectively corresponding to the real +and imaginary parts: + +$$\begin{aligned} + 0 &= - \phi_z - \varepsilon P \phi_t + \gamma P + \\ + 0 &= P_z + \varepsilon 3 P_t P +\end{aligned}$$ + +The phase $\phi$ is not so interesting, so we focus on the latter equation for $P$. +As it turns out, it has a general solution of the form below, which shows that +more intense parts of the pulse will tend to lag behind compared to the rest: + +$$\begin{aligned} + P(z,t) = f(t - 3 \varepsilon z P) +\end{aligned}$$ + +Where $f$ is the initial power profile: $f(t) = P(0,t)$. +The derivatives $P_t$ and $P_z$ are then given by: + +$$\begin{aligned} + P_t + &= (1 - 3 \varepsilon z P_t) \: f' + \qquad \quad \implies \quad + P_t + = \frac{f'}{1 + 3 \varepsilon z f'} + \\ + P_z + &= (-3 \varepsilon P - 3 \varepsilon z P_z) \: f' + \quad \implies \quad + P_z + = \frac{- 3 \varepsilon P f'}{1 + 3 \varepsilon z f'} +\end{aligned}$$ + +These derivatives both go to infinity when their denominator is zero, +which, since $\varepsilon$ is positive, will happen earliest where $f'$ +has its most negative value, called $f_\mathrm{min}'$, +which is located on the trailing edge of the pulse. +At the propagation distance where this occurs, $L_\mathrm{shock}$, +the pulse will "tip over", creating a discontinuous shock: + +$$\begin{aligned} + \boxed{ + L_\mathrm{shock} = -\frac{1}{3 \varepsilon f_\mathrm{min}'} + } +\end{aligned}$$ + +In practice, however, this will never actually happen, because by the time +$L_\mathrm{shock}$ is reached, the pulse spectrum will have become so +broad that dispersion can no longer be neglected. + +A simulation of self-steepening without dispersion is illustrated below +for the following Gaussian initial power distribution, +with $T_0 = 25\:\mathrm{fs}$, $P_0 = 3\:\mathrm{kW}$, +$\beta_2 = 0$ and $\gamma = 0.1/\mathrm{W}/\mathrm{m}$: + +$$\begin{aligned} + f(t) = P(0,t) = P_0 \exp\!\Big(\! -\!\frac{t^2}{T_0^2} \Big) +\end{aligned}$$ + + +Its steepest points are found to be at $2 t^2 = T_0^2$, so +$f_\mathrm{min}'$ and $L_\mathrm{shock}$ are given by: + +$$\begin{aligned} + f_\mathrm{min}' = - \frac{\sqrt{2} P_0}{T_0} \exp\!\Big(\!-\!\frac{1}{2}\Big) + \quad \implies \quad + L_\mathrm{shock} = \frac{T_0}{3 \sqrt{2} \varepsilon P_0} \exp\!\Big(\frac{1}{2}\Big) +\end{aligned}$$ + +This example Gaussian pulse therefore has a theoretical +$L_\mathrm{shock} = 0.847\,\mathrm{m}$, +which turns out to be accurate, +although the simulation breaks down due to insufficient resolution: + +<a href="pheno-steep.jpg"> +<img src="pheno-steep-small.jpg" style="width:100%"> +</a> + +Unfortunately, self-steepening cannot be simulated perfectly: as the +pulse approaches $L_\mathrm{shock}$, its spectrum broadens to infinite +frequencies to represent the singularity in its slope. +The simulation thus collapses into chaos when the edge of the frequency window is reached. +Nevertheless, the general trends are nicely visible: +the trailing slope becomes extremely steep, and the spectrum +broadens so much that dispersion cannot be neglected anymore. + +When self-steepening is added to the nonlinear Schrödinger equation, +it no longer conserves the total pulse energy $\int |A|^2 \dd{t}$. +Fortunately, the photon number $N_\mathrm{ph}$ is still +conserved, which for the physical envelope $A(z,t)$ is defined as: + +$$\begin{aligned} + \boxed{ + N_\mathrm{ph}(z) = \int_0^\infty \frac{|\tilde{A}(z,\omega)|^2}{\omega} \dd{\omega} + } +\end{aligned}$$ + + +## References +1. B.R. Suydam, [Self-steepening of optical pulses](https://doi.org/10.1007/0-387-25097-2_6), 2006, Springer. diff --git a/source/know/concept/self-steepening/pheno-steep-small.jpg b/source/know/concept/self-steepening/pheno-steep-small.jpg Binary files differnew file mode 100644 index 0000000..bb2a158 --- /dev/null +++ b/source/know/concept/self-steepening/pheno-steep-small.jpg diff --git a/source/know/concept/self-steepening/pheno-steep.jpg b/source/know/concept/self-steepening/pheno-steep.jpg Binary files differnew file mode 100644 index 0000000..c369d62 --- /dev/null +++ b/source/know/concept/self-steepening/pheno-steep.jpg diff --git a/source/know/concept/shors-algorithm/index.md b/source/know/concept/shors-algorithm/index.md new file mode 100644 index 0000000..729f13b --- /dev/null +++ b/source/know/concept/shors-algorithm/index.md @@ -0,0 +1,301 @@ +--- +title: "Shor's algorithm" +date: 2021-04-13 +categories: +- Quantum information +- Cryptography +- Algorithms +layout: "concept" +--- + +**Shor's algorithm** was the first truly useful quantum algorithm. +It can solve important problems, +most notably integer factorization, +much more efficiently than any classical algorithm. +It weakens widely-used cryptographic schemes, +such as RSA and [Diffie-Hellman](/know/concept/diffie-hellman-key-exchange/). + +In essence, Shor's algorithm's revolutionary achievement +is that it can efficiently find the periods $s_1, ..., s_A$ +of a function $f(x_1, ..., x_A)$ on a discrete finite field, where: + +$$\begin{aligned} + f(x_1, ..., x_A) + = f(x_1 + s_1, ..., x_A + s_A) +\end{aligned}$$ + +This is a so-called *hidden subgroup problem* for a *finite Abelian group*. +With minimal modifications, +Shor's algorithm can solve practically every such problem. + + +## Integer factorization + +Originally, Shor's algorithm was designed to factorize an integer $N$, +in which case the goal is to find the period $s$ of +the modular exponentiation function $f$ (for reasons explained later): + +$$\begin{aligned} + f(x) + = a^x \bmod N +\end{aligned}$$ + +For a given $a$ and $N$. +The period $s$ is the smallest integer satisfying $f(x) = f(x+s)$. +To do this, the following $2q$-qubit quantum circuit is used, +with $q$ chosen so that $N^2 \le 2^q < 2 N^2$: + +<a href="shors-circuit.png"> +<img src="shors-circuit.png" style="width:70%"> +</a> + +Here, $\mathrm{QFT}_q$ refers to the $q$-qubit +[quantum Fourier transform](/know/concept/quantum-fourier-transform/), +and the oracle $U_f$ calculates $f(x)$ for predetermined values of $a$ and $N$. +It is an XOR oracle, working as follows: + +$$\begin{aligned} + \Ket{x} \Ket{y} + \quad \to \boxed{U_f(a, N)} \to \quad + \Ket{x} \Ket{y \oplus f(x)} +\end{aligned}$$ + +Execution starts by applying the [Hadamard gate](/know/concept/quantum-gate/) $H$ +to the first $q$ qubits, yielding: + +$$\begin{aligned} + \Ket{0}^{\otimes q} \Ket{0}^{\otimes q} + \quad \to \boxed{H^{\otimes q}} \to \quad + \Ket{+}^{\otimes q} \Ket{0}^{\otimes q} + = \frac{1}{\sqrt{Q}} \sum_{x = 0}^{Q - 1} \Ket{x} \Ket{0}^{\otimes q} +\end{aligned}$$ + +Where $Q = 2^q$, and $\Ket{x}$ is the computational basis state $\Ket{x_1} \cdots \Ket{x_q}$. +Moving on to $U_f$: + +$$\begin{aligned} + \frac{1}{\sqrt{Q}} \sum_{x = 0}^{Q - 1} \Ket{x} \Ket{0}^{\otimes q} + \quad \to \boxed{U_f(a, N)} \to \quad + \frac{1}{\sqrt{Q}} \sum_{x = 0}^{Q - 1} \Ket{x} \Ket{f(x)} +\end{aligned}$$ + +Then we measure $f(x)$, causing it collapse as follows, +for an unknown arbitrary value of $x_0$: + +$$\begin{aligned} + f(x_0) = f(x_0 + s) = f(x_0 + 2s) = \cdots = f(x_0 + (L-1) s) +\end{aligned}$$ + +Due to [entanglement](/know/concept/quantum-entanglement/), +the unmeasured (top $q$) qubits change state into a superposition: + +$$\begin{aligned} + \frac{1}{\sqrt{L}} \sum_{\ell = 0}^{L - 1} \Ket{x_0 + \ell s} +\end{aligned}$$ + +Clearly, there is a periodic structure here, +but we cannot measure it directly, +because we do not know the value of $x_0$, +which, to make matters worse, changes every time we run the algorithm. +This is where the QFT comes in, which outputs the following state: + +$$\begin{aligned} + \frac{1}{\sqrt{QL}} \sum_{k = 0}^{Q - 1} \bigg( \sum_{\ell = 0}^{L - 1} \omega_Q^{(x_0 + \ell s) k} \bigg) \Ket{k} +\end{aligned}$$ + +Where $\omega_Q$ is a $Q$th root of unity. +Measuring this state yields a $\Ket{k}$, with a probability $P(k)$: + +$$\begin{aligned} + P(k) + = \frac{1}{QL} \bigg| \sum_{\ell = 0}^{L - 1} \omega_Q^{(x_0 + \ell s) k} \bigg|^2 + = \frac{1}{QL} \bigg| \omega_Q^{x_0 k} \sum_{\ell = 0}^{L - 1} \omega_Q^{\ell s k} \bigg|^2 + = \frac{1}{QL} \bigg| \sum_{\ell = 0}^{L - 1} \omega_Q^{\ell s k} \bigg|^2 +\end{aligned}$$ + +The last step holds because $|\omega_Q| = 1$. +Surprisingly, this implies that we did not need +to perform the measurement of $f(x)$ earlier! +This makes sense: the period $s$ does not depend on $x_0$, +so why would we need an implicit $x_0$ to determine $s$? + +So, what does the above probability $P(k)$ work out to? +There are two cases: + +$$\begin{alignedat}{2} + &\mathrm{if} \: \omega_Q^{sk} = 1: \qquad + &&P(k) = \frac{1}{QL} |L|^2 = \frac{L}{Q} + \\ + &\mathrm{if} \: \omega_Q^{sk} \neq 1: \qquad + &&P(k) = \frac{1}{QL} \Bigg| \frac{1 - \omega_Q^{sk L}}{1 - \omega_Q^{sk}} \Bigg|^2 +\end{alignedat}$$ + +Where the latter case was evaluated as a geometric series. +The condition $\omega_Q^{sk}\!=\!1$ is equivalent to asking +if $sk$ is a multiple of $Q$, i.e. if $sk = cQ$, for an integer $c$. + +Recall that $L$ is the number of times that $s$ fits in $Q$, +so $L\!=\!\lfloor Q / s \rfloor$. +Assuming $Q/s$ is an integer, then $L\!=\!Q/s$ and $Q\!=\!s L$, +which tells us that +$\omega_Q^{sk}\!=\!\omega_{s L}^{s k}\!=\!\omega_L^k$. +This implies that if $k$ is a multiple of $L$ (i.e. $k\!=\!c L$), +then $\omega_L^k\!=\!1$, so $P(k) = L / Q$, +which is exactly what we got earlier! + +In other words, the condition $\omega_Q^{sk}\!=\!1$ +is equivalent to $Q/s$ being an integer. +In that case, we have that $Q\!=\!sL$, +which we substitute into $P(k)$ from earlier: + +$$\begin{aligned} + \mathrm{if} \: (Q/s) \in \mathbb{N}: \qquad + P(k) + = \frac{L}{Q} + = \frac{1}{s} +\end{aligned}$$ + +And because $k$ is a multiple of $L$, +and $L$ fits $s$ times in $Q$, +there must be exactly $s$ values of $k$ that satisfy $P(k) = 1/s$. +Therefore the probability of all other $k$-values is zero! +This becomes clearer when you look at the sum used to calculate $P(k)$: +if $Q\!=\!sL$, then it sums $\omega_L^{\ell k}$ over $\ell$, +leading to perfect destructive interference for the "bad" $k$-values, +leaving only the "good" ones. + +**So, to summarize: if** $Q/s$ **is an integer**, +then measuring only yields $k$-values that are multiples of $L\!=\!Q/s$. +Running Shor's algorithm several times then gives +several $k$-values separated by $L$. +That tells us what $L$ is, and we already know $Q$, +so we *finally* find the period $s = Q/L$. + +That begs the question: what if $Q/s$ is not an integer? +We cannot *check* this, since $s$ is unknown! +Instead, we rewrite the probability $P(k)$ as follows: + +$$\begin{aligned} + \mathrm{if} \: (Q/s) \not\in \mathbb{N}: \qquad + P(k) + = \frac{1}{QL} \Bigg| \frac{1 - \omega_Q^{sk L}}{1 - \omega_Q^{sk}} \Bigg|^2 + = \frac{1}{QL} \Bigg| \frac{\sin(\pi s k L / Q)}{\sin(\pi s k / Q)} \Bigg|^2 +\end{aligned}$$ + +This function peaks if $s k$ is close to a multiple of $Q$, i.e. $s k \approx c Q$, +which we rearrange: + +$$\begin{aligned} + \frac{k}{Q} \approx \frac{c}{s} +\end{aligned}$$ + +We know the left-hand side, +and, from the definition of $f(x)$, +clearly $s \le N$. +We chose $Q \sim N^2$, +so $s$ is quite small, +and consequently $c$ is too, since $k < Q$. + +In other words, $c/s$ is a "simple" fraction, +so our goal is to find a "simple" fraction +that is close to the "complicated" fraction $k/Q$. +For example, if $k/Q\!=\!0.332$, +then probably $c/s\!=\!1/3$. + +This can be done rigorously using the **continued fractions algorithm**: +write $k/Q$ as a continued fraction, +until the non-integer part of the denominator becomes small enough. +This part is then neglected, +and we calculate whatever is left, to get an estimate of $c/s$. + +Of course, $P(k)$ is a probability distribution, +so even though the odds are in our favour, +we might occasionally measure a misleading $k$-value. +Running Shor's algorithm several times "fixes" this. + +**So, to summarize: if** $Q/s$ **is not an integer**, +the measured $k$-values are generally close to $c Q / s$ for an integer $c$. +By approximating $k/Q$ using the continued fraction algorithm, +we estimate $c/s$. +Repeating this procedure gives several values of $c/s$, +such that $s$ is easy to deduce +by taking the least common multiple of the denominators. + +In any case, once we think we have $s$, +we can easily verify that $f(x)\!=\!f(x\!+\!s)$. +Whether $s$ is the *smallest* such integer depends on how lucky we are, +but fortunately, for most applications of this algorithm, +that does not actually matter, +and usually we find the smallest $s$ anyway. + +You typically need to repeat the algorithm $\mathcal{O}(\log{q})$ times, +and the QFT is $\mathcal{O}(q^2)$. +The bottleneck is modular exponentiation $f$, +which is $\mathcal{O}(q^2 (\log{q}) \log{\log{q}})$ +and therefore worse than the QFT, +yielding a total complexity of $\mathcal{O}(q^2 (\log{q})^2 \log{\log{q}})$. + +OK, but what does $s$ have to do with factorizing integers? +Well, recall that $f$ is given by: + +$$\begin{aligned} + f(x) + = a^x \bmod N +\end{aligned}$$ + +$N$ is the number to factorize, and $a$ is a random integer *coprime* to $N$, +meaning $\gcd(a, N) = 1$. +The fact that $s$ is the period of $f$ for a certain $a$-value, implies that: + +$$\begin{aligned} + a^x + = a^{x + s} \bmod N + \quad \implies \quad + 1 + = a^s \bmod N +\end{aligned}$$ + +Suppose that $s$ is even. In that case, +we can rewrite the above equation as follows: + +$$\begin{aligned} + (a^{s/2})^2 - 1 + = 0 \bmod N +\end{aligned}$$ + +In other words, $(a^{s/2})^2 \!-\! 1$ is a multiple of $N$. +We then use that $(a\!-\!b) (a\!+\!b) = a^2\!-\!b^2$: + +$$\begin{aligned} + \big( a^{s/2} - 1 \big) \big( a^{s/2} + 1 \big) + = 0 \bmod N +\end{aligned}$$ + +Because $s$ is even by assumption, the two factors on the left are integers, +and as just mentioned, their product is a multiple of $N$. +Then we only need to calculate: + +$$\begin{aligned} + \gcd\!\big( a^{s/2}\!-\!1, N \big) > 1 + \quad\:\: \mathrm{and} \quad\:\: + \gcd\!\big( a^{s/2}\!+\!1, N \big) > 1 +\end{aligned}$$ + +And there we have the factors of $N$! +The $\gcd$ can be calculated efficiently in $\mathcal{O}(q^2)$ time. + +But what if $s$ is odd? +No problem, then we just choose a new $a$ coprime to $N$, +and keep repeating Shor's algorithm until we do find an even $s$. +We do the same if $a^{s/2}\!\pm\!1$ is itself a multiple of $N$. + + + +## References +1. J.S. Neergaard-Nielsen, + *Quantum information: lectures notes*, + 2021, unpublished. +2. S. Aaronson, + *Introduction to quantum information science: lecture notes*, + 2018, unpublished. + diff --git a/source/know/concept/shors-algorithm/shors-circuit.png b/source/know/concept/shors-algorithm/shors-circuit.png Binary files differnew file mode 100644 index 0000000..d373199 --- /dev/null +++ b/source/know/concept/shors-algorithm/shors-circuit.png diff --git a/source/know/concept/sigma-algebra/index.md b/source/know/concept/sigma-algebra/index.md new file mode 100644 index 0000000..30be914 --- /dev/null +++ b/source/know/concept/sigma-algebra/index.md @@ -0,0 +1,54 @@ +--- +title: "Sigma-algebra" +date: 2021-10-22 +categories: +- Mathematics +- Measure theory +layout: "concept" +--- + +In set theory, given a set $\Omega$, a $\sigma$**-algebra** +is a family $\mathcal{F}$ of subsets of $\Omega$ +with these properties: + +1. The full set is included $\Omega \in \mathcal{F}$. +2. For all subsets $A$, if $A \in \mathcal{F}$, + then its complement $\Omega \!-\! A \in \mathcal{F}$ too. +3. If two events $A, B \in \mathcal{F}$, + then their union $A \cup B \in \mathcal{F}$ too. + +This forms a Boolean algebra: +property (1) represents TRUE, +(2) is NOT, and (3) is AND, +and that is all we need to define all logic. +For example, FALSE and OR follow from the above points: + +4. The empty set is included $\varnothing \in \mathcal{F}$. +5. If two events $A, B \in \mathcal{F}$, + then their intersection $A \cap B \in \mathcal{F}$ too. + +For a given $\Omega$, there are typically multiple valid $\mathcal{F}$, +in which case you need to specify your choice. +Usually this would be the smallest $\mathcal{F}$ +(i.e. smallest family of subsets) +that contains all subsets of special interest +for the topic at hand. +Likewise, a **sub-$\sigma$-algebra** +is a sub-family of a certain $\mathcal{F}$, +which is a valid $\sigma$-algebra in its own right. + +A notable $\sigma$-algebra is the **Borel algebra** $\mathcal{B}(\Omega)$, +which is defined when $\Omega$ is a metric space, +such as the real numbers $\mathbb{R}$. +Using that as an example, the Borel algebra $\mathcal{B}(\mathbb{R})$ +is defined as the family of all open intervals of the real line, +and all the subsets of $\mathbb{R}$ obtained by countable sequences +of unions and intersections of those intervals. +The elements of $\mathcal{B}$ are **Borel sets**. + + + +## References +1. U.H. Thygesen, + *Lecture notes on diffusions and stochastic differential equations*, + 2021, Polyteknisk Kompendie. diff --git a/source/know/concept/simons-algorithm/index.md b/source/know/concept/simons-algorithm/index.md new file mode 100644 index 0000000..2391e42 --- /dev/null +++ b/source/know/concept/simons-algorithm/index.md @@ -0,0 +1,184 @@ +--- +title: "Simon's algorithm" +date: 2021-05-01 +categories: +- Quantum information +- Algorithms +layout: "concept" +--- + +**Simon's algorithm** was the first proof that quantum computers +are able to solve some problems *exponentially* faster +than classical computers. +In the same spirit as +the [Deutsch-Jozsa algorithm](/know/concept/deutsch-jozsa-algorithm/) +and the [Bernstein-Vazirani algorithm](/know/concept/bernstein-vazirani-algorithm/), +the problem it solves, known as **Simon's problem**, +is of no practical use, +but nevertheless Simon's algorithm is an important landmark. + +Simon's problem is this: +we are given a "black box" function $f(x)$ +that takes an $n$-bit input $x$ +and returns an $n$-bit output. +We are promised that there exists an $s$ such that for all $x_1$ and $x_2$: + +$$\begin{aligned} + f(x_1) + = f(x_2) + \quad \Leftrightarrow \quad + x_2 = s \oplus x_1 +\end{aligned}$$ + +In other words, regardless of what $f(x)$ does behind the scenes, +its output is the same for inputs $x_1$ and $x_2$ +if and only if $x_2 = s \oplus x_1$, +or, equivalently, $x_1 = s \oplus x_2$. + +The goal is to find the $n$-bit number $s$, using as few calls to $f$ as possible. +There are two cases: +if $s = 0$, then $f$ is one-to-one, since $x_2 = 0 \oplus x_1 = x_1$. +Otherwise, if $s \neq 0$, then $f$ is two-to-one by definition: +for every $x_1$ there exists exactly one $x_2$ such that $x_2 = s \oplus x_1$. + +A classical computer solves this by randomly guessing inputs, +until it finds two that give the same output, +and then $s = x_1 \oplus x_2$. +For $n$-bit numbers, this takes $\mathcal{O}(\sqrt{2^n})$ guesses +(the square root is due to the birthday paradox). + +A quantum computer needs to query $f$ only $\mathcal{O}(n)$ times, +although the exact number varies due to the algorithm's probabilistic nature. +It uses the following circuit: + +<a href="simons-circuit.png"> +<img src="simons-circuit.png" style="width:52%"> +</a> + +The XOR oracle $U_f$ implements $f$, +and has the following action for $n$-bit $a$ and $b$: + +$$\begin{aligned} + \Ket{a} \Ket{b} + \quad \to \boxed{U_f} \to \quad + \Ket{a} \Ket{b \oplus f(a)} +\end{aligned}$$ + +Starting from the state $\Ket{0}^{\otimes 2 n}$, +we apply the [Hadamard gate](/know/concept/quantum-gate/) $H$ +to each of the first $n$ qubits: + +$$\begin{aligned} + \Ket{0}^{\otimes n} \Ket{0}^{\otimes n} + \quad \to \boxed{H^{\otimes n}} \to \quad + \Ket{+}^{\otimes n} \Ket{0}^{\otimes n} + = \frac{1}{\sqrt{2^n}} \sum_{x = 0}^{2^n - 1} \Ket{x} \Ket{0}^{\otimes n} +\end{aligned}$$ + +Where $\Ket{x}$ is shorthand for $\Ket{x}_1 \cdots \Ket{x}_n$. +In other words, we now have an equal superposition of all possible inputs $x$, +with a constant $\Ket{0}^{\otimes n}$ beside it. +We give this to the oracle $U_f$: + +$$\begin{aligned} + \frac{1}{\sqrt{2^n}} \sum_{x = 0}^{2^n - 1} \Ket{x} \Ket{0}^{\otimes n} + \quad \to \boxed{U_f} \to \quad + \frac{1}{\sqrt{2^n}} \sum_{x = 0}^{2^n - 1} \Ket{x} \Ket{f(x)} +\end{aligned}$$ + +Then we apply $H^{\otimes n}$ to the first $n$ qubits again, +which, thanks to the definition of the Hadamard transform, +yields the following, +where $x \cdot y$ is the bitwise dot product: + +$$\begin{aligned} + \frac{1}{\sqrt{2^n}} \sum_{x = 0}^{2^n - 1} \Ket{x} \Ket{f(x)} + \quad \to \boxed{H^{\otimes n}} \to \quad + &\frac{1}{2^n} \sum_{x = 0}^{2^n - 1} \bigg( \sum_{y = 0}^{2^n - 1} (-1)^{x \cdot y} \Ket{y} \bigg) \Ket{f(x)} +\end{aligned}$$ + + +Next, we measure all qubits. +The order in which we do this does not matter, +but, for clarity, let us measure the last $n$ qubits first, +yielding $\Ket{f(x_1)}$ for some $x_1$. +Doing this leaves the $2n$ qubits in the following state, +where $f(x_1) = f(x_2)$ and $x_2 = s \oplus x_1$: + +$$\begin{alignedat}{2} + &\mathrm{if} \: s = 0: \qquad + &&\frac{1}{\sqrt{2^{n}}} \sum_{y = 0}^{2^n - 1} (-1)^{x_1 \cdot y} \Ket{y} \Ket{f(x_1)} + \\ + &\mathrm{if} \: s \neq 0: \qquad + &&\frac{1}{\sqrt{2^{n+1}}} \sum_{y = 0}^{2^n - 1} \Big( (-1)^{x_1 \cdot y} + (-1)^{x_2 \cdot y} \Big) \Ket{y} \Ket{f(x_1)} +\end{alignedat}$$ + +If $s = 0$, we get an equiprobable superposition of all $y$. +So, when we measure the first $n$ qubits, the result is a uniformly random number, +regardless of the phase $(-1)^{x_1 \cdot y}$. + +If $s \neq 0$, the situation is more interesting, +because we can only measure $y$-values where: + +$$\begin{aligned} + (-1)^{x_1 \cdot y} + (-1)^{x_2 \cdot y} \neq 0 +\end{aligned}$$ + +Since $x_2 = s \oplus x_1$ by definition, +we can rewrite this as follows: + +$$\begin{aligned} + (-1)^{x_1 \cdot y} + (-1)^{x_1 \cdot y \oplus s \cdot y} + = (-1)^{x_1 \cdot y} + (-1)^{x_1 \cdot y} (-1)^{s \cdot y} + \neq 0 +\end{aligned}$$ + +Clearly, the expression can only be nonzero if $s \cdot y$ is even. +In other words, when we measure the first $n$ qubits, +we get a random $y$-value, +for which $s \cdot y$ is guaranteed to be even. + +In both cases $s = 0$ and $s \neq 0$, +we measure a $y$-value that satisfies the equation: + +$$\begin{aligned} + s \cdot y = 0 \:\:(\bmod 2) +\end{aligned}$$ + +This tells us something about $s$, albeit not much. +But if we run Simon's algorithm $N$ times, +we get various $y$-values $y_1, ..., y_N$, +from which we can build a system of linear equations: + +$$\begin{aligned} + s \cdot y_1 &= 0 \:\:(\bmod 2) + \\ + s \cdot y_2 &= 0 \:\:(\bmod 2) + \\ + &\:\:\vdots + \\ + s \cdot y_N &= 0 \:\:(\bmod 2) +\end{aligned}$$ + +This can be solved efficiently by a classical computer. +In the best-case scenario, all those $y$-values would be linearly independent +(when regarded as vectors of bits), +in which case only $N = n - 1$ equations would be necessary. +Simon's algorithm is therefore $\mathcal{O}(n)$. + +It may feel like "cheating" to use a classical computer at the end. +Remember that the point of this algorithm is to limit the number of oracle queries, +which we did successfully. +Querying an oracle might be a very expensive operation, +so that is a big improvement! +That said, Simon's algorithm currently has no known practical uses. + + + +## References +1. J.S. Neergaard-Nielsen, + *Quantum information: lectures notes*, + 2021, unpublished. +2. S. Aaronson, + *Introduction to quantum information science: lecture notes*, + 2018, unpublished. diff --git a/source/know/concept/simons-algorithm/simons-circuit.png b/source/know/concept/simons-algorithm/simons-circuit.png Binary files differnew file mode 100644 index 0000000..b1f5ffb --- /dev/null +++ b/source/know/concept/simons-algorithm/simons-circuit.png diff --git a/source/know/concept/slater-determinant/index.md b/source/know/concept/slater-determinant/index.md new file mode 100644 index 0000000..eca8048 --- /dev/null +++ b/source/know/concept/slater-determinant/index.md @@ -0,0 +1,48 @@ +--- +title: "Slater determinant" +date: 2021-02-22 +categories: +- Quantum mechanics +- Physics +layout: "concept" +--- + +In quantum mechanics, the **Slater determinant** is a trick +to create a many-particle wave function for a system of $N$ fermions, +with the necessary antisymmetry. + +Given an orthogonal set of individual states $\psi_n(x)$, we write +$\psi_n(x_n)$ to say that particle $x_n$ is in state $\psi_n$. Now the +goal is to find an expression for an overall many-particle wave +function $\Psi(x_1, ..., x_N)$ that satisfies the +[Pauli exclusion principle](/know/concept/pauli-exclusion-principle/). +Enter the Slater determinant: + +$$\begin{aligned} + \boxed{ + \Psi(x_1, ..., x_N) + = \frac{1}{\sqrt{N!}} \det\! + \begin{bmatrix} + \psi_1(x_1) & \cdots & \psi_N(x_1) \\ + \vdots & \ddots & \vdots \\ + \psi_1(x_N) & \cdots & \psi_N(x_N) + \end{bmatrix} + }\end{aligned}$$ + +Swapping the state of two particles corresponds to exchanging two rows, +which flips the sign of the determinant. +Similarly, switching two columns means swapping two states, +which also results in a sign change. +Finally, putting two particles into the same state makes $\Psi$ vanish. + +Not all valid many-fermion wave functions can be +written as a single Slater determinant; a linear combination of multiple +may be needed. Nevertheless, an appropriate choice of the input set +$\psi_n(x)$ can optimize how well a single determinant approximates a +given $\Psi$. + +In fact, there exists a similar trick for bosons, where the goal is to +create a symmetric wave function which allows multiple particles to +occupy the same state. In this case, one needs to take the **Slater +permanent** of the same matrix, which is simply the determinant, but with +all minuses replaced by pluses. diff --git a/source/know/concept/sokhotski-plemelj-theorem/index.md b/source/know/concept/sokhotski-plemelj-theorem/index.md new file mode 100644 index 0000000..b5c0b1b --- /dev/null +++ b/source/know/concept/sokhotski-plemelj-theorem/index.md @@ -0,0 +1,109 @@ +--- +title: "Sokhotski-Plemelj theorem" +date: 2021-11-01 +categories: +- Mathematics +- Complex analysis +- Quantum mechanics +layout: "concept" +--- + +The goal is to evaluate integrals of the following form, where $a < 0 < b$, +and $f(x)$ is assumed to be continuous in the integration interval $[a, b]$: + +$$\begin{aligned} + \lim_{\eta \to 0^+} \int_a^b \frac{f(x)}{x + i \eta} \dd{x} +\end{aligned}$$ + +To do so, we start by splitting the integrand +into its real and imaginary parts (limit hidden): + +$$\begin{aligned} + \int_a^b \frac{f(x)}{x + i \eta} \dd{x} + &= \int_a^b \frac{x - i \eta}{x^2 + \eta^2} f(x) \dd{x} + = \int_a^b \bigg( \frac{x}{x^2 + \eta^2} - i \frac{\eta}{x^2 + \eta^2} \bigg) f(x) \dd{x} +\end{aligned}$$ + +To evaluate the real part, +we notice that for $\eta \to 0^+$ the integrand diverges for $x \to 0$, +and thus split the integral as follows: + +$$\begin{aligned} + \lim_{\eta \to 0^+} \int_a^b \frac{x f(x)}{x^2 + \eta^2} \dd{x} + &= \lim_{\eta \to 0^+} \bigg( \int_a^{-\eta} \frac{x f(x)}{x^2 + \eta^2} \dd{x} + \int_\eta^b \frac{x f(x)}{x^2 + \eta^2} \dd{x} \bigg) +\end{aligned}$$ + +This is simply the definition of the +[Cauchy principal value](/know/concept/cauchy-principal-value/) $\mathcal{P}$, +so the real part is given by: + +$$\begin{aligned} + \lim_{\eta \to 0^+} \int_a^b \frac{x f(x)}{x^2 + \eta^2} \dd{x} + &= \mathcal{P} \int_a^b \frac{x f(x)}{x^2} \dd{x} + = \mathcal{P} \int_a^b \frac{f(x)}{x} \dd{x} +\end{aligned}$$ + +Meanwhile, in the imaginary part, +we substitute $\eta$ for $1 / m$, and introduce $\pi$: + +$$\begin{aligned} + \lim_{\eta \to 0^+} \int_a^b \frac{\eta \: f(x)}{x^2 + \eta^2} \dd{x} + &= \lim_{m \to +\infty} \frac{\pi}{\pi} \int_a^b \frac{1/m}{x^2 + 1/m^2} f(x) \dd{x} + \\ + &= \lim_{m \to +\infty} \frac{\pi}{\pi} \int_a^b \frac{m}{1 + m^2 x^2} f(x) \dd{x} +\end{aligned}$$ + +The expression $m / \pi (1 + m^2 x^2)$ is a so-called *nascent delta function*, +meaning that in the limit $m \to +\infty$ it converges to +the [Dirac delta function](/know/concept/dirac-delta-function/): + +$$\begin{aligned} + \lim_{\eta \to 0^+} \int_a^b \frac{\eta \: f(x)}{x^2 + \eta^2} \dd{x} + &= \pi \int_a^b \delta(x) \: f(x) \dd{x} + = \pi f(0) +\end{aligned}$$ + +By combining the real and imaginary parts, +we thus arrive at the (real version of the) +so-called **Sokhotski-Plemelj theorem** of complex analysis: + +$$\begin{aligned} + \boxed{ + \lim_{\eta \to 0^+} \int_a^b \frac{f(x)}{x + i \eta} \dd{x} + = \mathcal{P} \int_a^b \frac{f(x)}{x} \dd{x} - i \pi f(0) + } +\end{aligned}$$ + +However, this theorem is often written in the following sloppy way, +where $\eta$ is defined up front to be small, +the integral is hidden, and $f(x)$ is set to $1$. +This awkwardly leaves $\mathcal{P}$ behind: + +$$\begin{aligned} + \frac{1}{x + i \eta} + = \mathcal{P} \Big( \frac{1}{x} \Big) - i \pi \delta(x) +\end{aligned}$$ + +The full, complex version of the Sokhotski-Plemelj theorem +evaluates integrals of the following form +over a contour $C$ in the complex plane: + +$$\begin{aligned} + \phi(z) = \frac{1}{2 \pi i} \oint_C \frac{f(\zeta)}{\zeta - z} \dd{\zeta} +\end{aligned}$$ + +Where $f(z)$ must be [holomorphic](/know/concept/holomorphic-function/). +The Sokhotski-Plemelj theorem then states: + +$$\begin{aligned} + \boxed{ + \lim_{w \to z} \phi(w) + = \frac{1}{2 \pi i} \mathcal{P} \oint_C \frac{f(\zeta)}{\zeta - z} \dd{\zeta} \pm \frac{f(z)}{2} + } +\end{aligned}$$ + +Where the sign is positive if $z$ is inside $C$, and negative if it is outside. +The real version follows by letting $C$ follow the whole real axis, +making $C$ an infinitely large semicircle, +so that the integrand vanishes away from the real axis, +because $1 / (\zeta \!-\! z) \to 0$ for $|\zeta| \to \infty$. diff --git a/source/know/concept/spherical-coordinates/index.md b/source/know/concept/spherical-coordinates/index.md new file mode 100644 index 0000000..fb56ce0 --- /dev/null +++ b/source/know/concept/spherical-coordinates/index.md @@ -0,0 +1,205 @@ +--- +title: "Spherical coordinates" +date: 2021-03-04 +categories: +- Mathematics +- Physics +layout: "concept" +--- + +**Spherical coordinates** are an extension of polar coordinates to 3D. +The position of a given point in space is described by +three coordinates $(r, \theta, \varphi)$, defined as: + +* $r$: the **radius** or **radial distance**: distance to the origin. +* $\theta$: the **elevation**, **polar angle** or **colatitude**: + angle to the positive $z$-axis, or **zenith**, i.e. the "north pole". +* $\varphi$: the **azimuth**, **azimuthal angle** or **longitude**: + angle from the positive $x$-axis, typically in the counter-clockwise sense. + +Cartesian coordinates $(x, y, z)$ and the spherical system +$(r, \theta, \varphi)$ are related by: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + x &= r \sin\theta \cos\varphi \\ + y &= r \sin\theta \sin\varphi \\ + z &= r \cos\theta + \end{aligned} + } +\end{aligned}$$ + +Conversely, a point given in $(x, y, z)$ +can be converted to $(r, \theta, \varphi)$ +using these formulae: + +$$\begin{aligned} + \boxed{ + r = \sqrt{x^2 + y^2 + z^2} + \qquad + \theta = \arccos(z / r) + \qquad + \varphi = \mathtt{atan2}(y, x) + } +\end{aligned}$$ + +The spherical coordinate system is an orthogonal +[curvilinear system](/know/concept/curvilinear-coordinates/), +whose scale factors $h_r$, $h_\theta$ and $h_\varphi$ we want to find. +To do so, we calculate the differentials of the Cartesian coordinates: + +$$\begin{aligned} + \dd{x} &= \dd{r} \sin\theta \cos\varphi + \dd{\theta} r \cos\theta \cos\varphi - \dd{\varphi} r \sin\theta \sin\varphi + \\ + \dd{y} &= \dd{r} \sin\theta \sin\varphi + \dd{\theta} r \cos\theta \sin\varphi + \dd{\varphi} r \sin\theta \cos\varphi + \\ + \dd{z} &= \dd{r} \cos\theta - \dd{\theta} r \sin\theta +\end{aligned}$$ + +And then we calculate the line element $\dd{\ell}^2$, +skipping many terms thanks to orthogonality: + +$$\begin{aligned} + \dd{\ell}^2 + &= \:\:\:\: \dd{r}^2 \big( \sin^2(\theta) \cos^2(\varphi) + \sin^2(\theta) \sin^2(\varphi) + \cos^2(\theta) \big) + \\ + &\quad + \dd{\theta}^2 \big( r^2 \cos^2(\theta) \cos^2(\varphi) + r^2 \cos^2(\theta) \sin^2(\varphi) + r^2 \sin^2(\theta) \big) + \\ + &\quad + \dd{\varphi}^2 \big( r^2 \sin^2(\theta) \sin^2(\varphi) + r^2 \sin^2(\theta) \cos^2(\varphi) \big) + \\ + &= \dd{r}^2 + r^2 \: \dd{\theta}^2 + r^2 \sin^2(\theta) \: \dd{\varphi}^2 +\end{aligned}$$ + +Finally, we can simply read off +the squares of the desired scale factors +$h_r^2$, $h_\theta^2$ and $h_\varphi^2$: + +$$\begin{aligned} + \boxed{ + h_r = 1 + \qquad + h_\theta = r + \qquad + h_\varphi = r \sin\theta + } +\end{aligned}$$ + +With these factors, we can easily convert things from the Cartesian system +using the standard formulae for orthogonal curvilinear coordinates. +The basis vectors are: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \vu{e}_r + &= \sin\theta \cos\varphi \:\vu{e}_x + \sin\theta \sin\varphi \:\vu{e}_y + \cos\theta \:\vu{e}_z + \\ + \vu{e}_\theta + &= \cos\theta \cos\varphi \:\vu{e}_x + \cos\theta \sin\varphi \:\vu{e}_y - \sin\theta \:\vu{e}_z + \\ + \vu{e}_\varphi + &= - \sin\varphi \:\vu{e}_x + \cos\varphi \:\vu{e}_y + \end{aligned} + } +\end{aligned}$$ + +The basic vector operations (gradient, divergence, Laplacian and curl) are given by: + +$$\begin{aligned} + \boxed{ + \nabla f + = \vu{e}_r \pdv{f}{r} + + \vu{e}_\theta \frac{1}{r} \pdv{f}{\theta} + \mathbf{e}_\varphi \frac{1}{r \sin\theta} \pdv{f}{\varphi} + } +\end{aligned}$$ + +$$\begin{aligned} + \boxed{ + \nabla \cdot \vb{V} + = \frac{1}{r^2} \pdv{(r^2 V_r)}{r} + + \frac{1}{r \sin\theta} \pdv{(\sin\theta V_\theta)}{\theta} + + \frac{1}{r \sin\theta} \pdv{V_\varphi}{\varphi} + } +\end{aligned}$$ + +$$\begin{aligned} + \boxed{ + \nabla^2 f + = \frac{1}{r^2} \pdv{}{r}\Big( r^2 \pdv{f}{r} \Big) + + \frac{1}{r^2 \sin\theta} \pdv{}{\theta}\Big( \sin\theta \pdv{f}{\theta} \Big) + + \frac{1}{r^2 \sin^2(\theta)} \pdvn{2}{f}{\varphi} + } +\end{aligned}$$ + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \nabla \times \vb{V} + &= \frac{\vu{e}_r}{r \sin\theta} \Big( \pdv{(\sin\theta V_\varphi)}{\theta} - \pdv{V_\theta}{\varphi} \Big) + \\ + &+ \frac{\vu{e}_\theta}{r} \Big( \frac{1}{\sin\theta} \pdv{V_r}{\varphi} - \pdv{(r V_\varphi)}{r} \Big) + \\ + &+ \frac{\vu{e}_\varphi}{r} \Big( \pdv{(r V_\theta)}{r} - \pdv{V_r}{\theta} \Big) + \end{aligned} + } +\end{aligned}$$ + +The differential element of volume $\dd{V}$ +takes the following form: + +$$\begin{aligned} + \boxed{ + \dd{V} + = r^2 \sin\theta \dd{r} \dd{\theta} \dd{\varphi} + } +\end{aligned}$$ + +So, for example, an integral over all of space is converted like so: + +$$\begin{aligned} + \iiint_{-\infty}^\infty f(x, y, z) \dd{V} + = \int_0^{2\pi} \int_0^\pi \int_0^\infty f(r, \theta, \varphi) \: r^2 \sin\theta \dd{r} \dd{\theta} \dd{\varphi} +\end{aligned}$$ + +The isosurface elements are as follows, where $S_r$ is a surface at constant $r$, etc.: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + \dd{S}_r = r^2 \sin\theta \dd{\theta} \dd{\varphi} + \qquad + \dd{S}_\theta = r \sin\theta \dd{r} \dd{\varphi} + \qquad + \dd{S}_\varphi = r \dd{r} \dd{\theta} + \end{aligned} + } +\end{aligned}$$ + +Similarly, the normal vector element $\dd{\vu{S}}$ for an arbitrary surface is given by: + +$$\begin{aligned} + \boxed{ + \dd{\vu{S}} + = \vu{e}_r \: r^2 \sin\theta \dd{\theta} \dd{\varphi} + + \vu{e}_\theta \: r \sin\theta \dd{r} \dd{\varphi} + + \vu{e}_\varphi \: r \dd{r} \dd{\theta} + } +\end{aligned}$$ + +And finally, the tangent vector element $\dd{\vu{\ell}}$ of a given curve is as follows: + +$$\begin{aligned} + \boxed{ + \dd{\vu{\ell}} + = \vu{e}_r \: \dd{r} + + \vu{e}_\theta \: r \dd{\theta} + + \vu{e}_\varphi \: r \sin\theta \dd{\varphi} + } +\end{aligned}$$ + + +## References +1. M.L. Boas, + *Mathematical methods in the physical sciences*, 2nd edition, + Wiley. diff --git a/source/know/concept/spitzer-resistivity/index.md b/source/know/concept/spitzer-resistivity/index.md new file mode 100644 index 0000000..bab8ecc --- /dev/null +++ b/source/know/concept/spitzer-resistivity/index.md @@ -0,0 +1,103 @@ +--- +title: "Spitzer resistivity" +date: 2021-10-05 +categories: +- Physics +- Plasma physics +layout: "concept" +--- + +If an [electric field](/know/concept/electric-field/) +with magnitude $E$ is applied to the plasma, the electrons experience +a [Lorentz force](/know/concept/lorentz-force/) $q_e E$ +(we neglect the ions due to their mass), +where $q_e$ is the electron charge. + +However, collisions slow them down while they travel through the plasma., +This can be modelled as a drag force $f_{ei} m_e v_e$, +where $f_{ei}$ is the electron-ion collision frequency +(we neglect $f_{ee}$ since all electrons are moving together), +$m_e$ is their mass, +and $v_e$ their typical velocity relative to the ions in the background. +Balancing the two forces yields the following relation: + +$$\begin{aligned} + q_e E + = f_{ei} m_e v_e +\end{aligned}$$ + +Using that the current density $J = q_e n_e v_e$, +we can rearrange this like so: + +$$\begin{aligned} + E + = f_{ei} m_e \frac{J}{n_e q_e^2} + = \frac{m_e f_{ei}}{n_e q_e^2} J + = \eta J +\end{aligned}$$ + +This is Ohm's law, where $\eta$ is the resistivity. +From our derivation of the [Coulomb logarithm](/know/concept/coulomb-logarithm/) $\ln(\Lambda)$, +we estimate $f_{ei}$ to be as follows, +where $n_i$ is the ion density, +$\sigma$ is the collision cross-section, +and $\mu$ is the [reduced mass](/know/concept/reduced-mass/) +of the electron-ion system: + +$$\begin{aligned} + f_{ei} + = n_i \sigma v_e + = \frac{1}{2 \pi} \Big( \frac{q_e q_i}{\varepsilon_0 \mu} \Big)^2 \frac{n_i}{v_e^3} \ln(\Lambda) + \approx \frac{1}{2 \pi} \frac{Z q_e^4}{\varepsilon_0^2 m_e^2} \frac{n_e}{v_e^3} \ln(\Lambda) +\end{aligned}$$ + +Where we used that $\mu \approx m_e$, +and $q_i = -Z q_e$ for some ionization $Z$, +and as a result $n_e \approx Z n_i$ due to the plasma's quasi-neutrality. +Beware: authors disagree about the constant factors in $f_{ei}$; +recall that it was derived from fairly rough estimates. +This article follows Bellan. + +Inserting this expression for $f_{ei}$ into +the so-called **Spitzer resistivity** $\eta$ then yields: + +$$\begin{aligned} + \boxed{ + \eta + = \frac{m_e f_{ei}}{n_e q_e^2} + = \frac{1}{2 \pi} \frac{Z q_e^2}{\varepsilon_0^2 m_e} \frac{1}{v_e^3} \ln(\Lambda) + } +\end{aligned}$$ + +A reasonable estimate for the typical velocity $v_e$ +at thermal equilibrium is as follows, +where $k_B$ is Boltzmann's constant, +and $T_e$ is the electron temperature: + +$$\begin{aligned} + \frac{1}{2} m_e v_e^2 + = \frac{3}{2} k_B T_e + \quad \implies \quad + v_e + = \sqrt{\frac{3 k_B T_e}{m_e}} +\end{aligned}$$ + +Other choices exist, +see e.g. the [Maxwell-Boltzmann distribution](/know/concept/maxwell-boltzmann-distribution/), +but always $v_e \propto \sqrt{T_e/m_e}$. +Inserting this $v_e$ into $\eta$ then gives: + +$$\begin{aligned} + \eta + = \frac{1}{6 \pi \sqrt{3}} \frac{Z q_e^2 \sqrt{m_e}}{\varepsilon_0^2 (k_B T_e)^{3/2}} \ln(\Lambda) +\end{aligned}$$ + + + +## References +1. P.M. Bellan, + *Fundamentals of plasma physics*, + 1st edition, Cambridge. +2. M. Salewski, A.H. Nielsen, + *Plasma physics: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/step-index-fiber/bessel.jpg b/source/know/concept/step-index-fiber/bessel.jpg Binary files differnew file mode 100644 index 0000000..464a1e7 --- /dev/null +++ b/source/know/concept/step-index-fiber/bessel.jpg diff --git a/source/know/concept/step-index-fiber/index.md b/source/know/concept/step-index-fiber/index.md new file mode 100644 index 0000000..20c35dd --- /dev/null +++ b/source/know/concept/step-index-fiber/index.md @@ -0,0 +1,421 @@ +--- +title: "Step-index fiber" +date: 2022-02-11 +categories: +- Physics +- Optics +- Fiber optics +layout: "concept" +--- + +As light propagates in the $z$-direction through an optical fiber, +the transverse profile $F(x,y)$ of the [electric field](/know/concept/electric-field/) +can be shown to obey the *Helmholtz equation* in 2D: + +$$\begin{aligned} + \nabla_{\!\perp}^2 F + (n^2 k^2 - \beta^2) F = 0 +\end{aligned}$$ + +With $n$ being the position-dependent refractive index, +$k$ the vacuum wavenumber $\omega / c$, +and $\beta$ the mode's propagation constant, to be determined later. +In [polar coordinates](/know/concept/cylindrical-polar-coordinates/) +$(r,\phi)$ this equation can be rewritten as follows: + +$$\begin{aligned} + \pdvn{2}{F}{r} + \frac{1}{r} \pdv{F}{r} + \frac{1}{r^2} \pdvn{2}{F}{\phi} + \mu F = 0 +\end{aligned}$$ + +Where we have defined $\mu \equiv n^2 k^2 \!-\! \beta^2$ for brevity. +From now on, we only consider choices of $\mu$ that do not depend on $\phi$ or $z$, +but may vary with $r$. + +This Helmholtz equation can be solved by *separation of variables*: +we assume that there exist two functions $R(r)$ and $\Phi(\phi)$ +such that $F(r,\phi) = R(r) \, \Phi(\phi)$. +Inserting this ansatz: + +$$\begin{aligned} + R'' \Phi + \frac{1}{r} R' \Phi + \frac{1}{r^2} R \Phi'' + \mu R \Phi = 0 +\end{aligned}$$ + +We rearrange this such that each side only depends on one variable, +by dividing by $R\Phi$ (ignoring the fact that it may be zero), +and multiplying by $r^2$. +Since this equation should hold for *all* values of $r$ and $\phi$, +this means that both sides must equal a constant $\ell^2$: + +$$\begin{aligned} + r^2 \frac{R''}{R} + r \frac{R'}{R} + \mu r^2 + = -\frac{\Phi''}{\Phi} + = \ell^2 +\end{aligned}$$ + +This gives an eigenvalue problem for $\Phi$, +and the well-known *Bessel equation* for $R$: + +$$\begin{aligned} + \boxed{ + \Phi'' + \ell^2 \Phi = 0 + } + \qquad \qquad + \boxed{ + r^2 R'' + r R' + (\mu r^2 \!-\! \ell^2) R = 0 + } +\end{aligned}$$ + +We will return to $R$ later; we start with $\Phi$, because it has the +simplest equation. Since the angle $\phi$ is limited to $[0,2\pi]$, +$\Phi$ must be $2 \pi$-periodic, so: + +$$\begin{aligned} + \Phi(0) = \Phi(2\pi) + \qquad \qquad + \Phi'(0) = \Phi'(2\pi) +\end{aligned}$$ + +The above equation for $\Phi$ with these periodic boundary conditions +is a [Sturm-Liouville problem](/know/concept/sturm-liouville-theory/). +Consequently, there are infinitely many allowed values of $\ell^2$, +all real, and one of them is lowest, known as the *ground state*. + +To find the eigenvalues $\ell^2$ and their corresponding $\Phi$, +we in turn assume that $\ell^2 < 0$, $\ell^2 = 0$, or $\ell^2 > 0$, +and check if we can then arrive at a non-trivial $\Phi$ for each case. + +* For $\ell^2 < 0$, solutions have the form $\Phi(\phi) = A \sinh(\phi \ell) + B \cosh(\phi \ell)$, + where $A$ and $B$ are unknown linearity constants. + At least one of these constants must be nonzero for $\Phi$ to be non-trivial, + but the challenge is to satisfy the boundary conditions: + + $$\begin{alignedat}{3} + \Phi(0) &= \Phi(2 \pi) + \:\quad &&\implies \quad\:\: + 0 &&= A \sinh(2 \pi \ell) + B \big( \cosh(2 \pi \ell) - 1 \big) + \\ + \Phi'(0) &= \Phi'(2 \pi) + \: \quad &&\implies \quad \:\: + 0 &&= A \ell \big( \cosh(2 \pi \ell) - 1 \big) + B \ell \sinh(2 \pi \ell) + \end{alignedat}$$ + + This only has non-trivial solutions + if the determinant of the system matrix is zero: + + $$\begin{aligned} + 0 + &= \mathrm{det} + \begin{bmatrix} + \sinh(2 \pi \ell) & \cosh(2 \pi \ell) - 1 \\ + \cosh(2 \pi \ell) - 1 & \sinh(2 \pi \ell) + \end{bmatrix} + = 2 \big( \cosh(2 \pi \ell) - 1 \big) + \end{aligned}$$ + + This can only be zero if $\ell = 0$, + which contradicts the premise that $\ell^2 < 0$, + so we conclude that $\ell^2$ cannot be negative, + because no non-trivial solutions exist here. + +* For $\ell^2 = 0$, the solution is $\Phi(\phi) = A \phi + B$. + Putting this in the boundary conditions: + + $$\begin{alignedat}{3} + \Phi(0) &= \Phi(2 \pi) + \qquad &&\implies \qquad + A &&= 0 + \\ + \Phi'(0) &= \Phi'(2 \pi) + \qquad &&\implies \qquad + B &&= B + \end{alignedat}$$ + + $B$ can be nonzero, so this a valid solution. + We conclude that $\ell^2 = 0$ is the ground state. + +* For $\ell^2 > 0$, all solutions have the form + $\Phi(\phi) = A \sin(\phi \ell) + B \cos(\phi \ell)$, therefore: + + $$\begin{alignedat}{3} + \Phi(0) &= \Phi(2 \pi) + \quad &&\implies \quad + 0 &&= A \sin(2 \pi \ell) + B \big(\cos(2\pi \ell) - 1\big) + \\ + \Phi'(0) &= \Phi'(2 \pi) + \quad &&\implies \quad + 0 &&= A \big(\cos(2 \pi \ell) - 1\big) - B \sin(2 \pi \ell) + \end{alignedat}$$ + + This system only has nontrivial solutions + if the determinant of its matrix is zero: + + $$\begin{aligned} + 0 + &= \mathrm{det} + \begin{bmatrix} + \sin(2 \pi \ell) & \cos(2 \pi \ell) - 1 \\ + \cos(2 \pi \ell) - 1 & -\sin(2 \pi \ell) + \end{bmatrix} + = 2 \big(\cos(2 \pi \ell) - 1\big) + \end{aligned}$$ + + Meaning that $\ell$ must be an integer. + We revisit the boundary conditions and indeed see: + + $$\begin{alignedat}{3} + 0 &= A \sin(2 \pi \ell) + B \big(\cos(2 \pi \ell) - 1\big) + \qquad &&\implies \qquad + 0 &&= 0 + \\ + 0 &= A \big(\cos(2 \pi \ell) - 1\big) - B \sin(2 \pi \ell) + \qquad &&\implies \qquad + 0 &&= 0 + \end{alignedat}$$ + + So $A$ and $B$ are *both* unconstrained, + and each integer $\ell$ is a doubly-degenerate eigenvalue. + The two linearly independent solutions, + $\sin(\phi \ell)$ and $\cos(\phi \ell)$, + represent the polarization of light in the mode. + For simplicity, we assume that all light is in a single polarization, + so only $\cos(\phi \ell)$ will be considered from now on. + +By combining our result for $\ell^2 = 0$ and $\ell^2 > 0$, +we get the following for $\ell = 0, 1, 2, ...$: + +$$\begin{aligned} + \boxed{ + \Phi_\ell(\phi) = A \cos(\phi \ell) + } +\end{aligned}$$ + +Here, $\ell$ is called the **primary mode index**. +We exclude $\ell < 0$ because $\cos(x) \propto \cos(-x)$ +and $\sin(x) \propto \sin(-x)$, +and because $A$ is free to choose thanks to linearity. + +Let us now revisit the Bessel equation for the radial function $R(r)$, +which should be continuous and differentiable throughout the fiber: + +$$\begin{aligned} + r^2 R'' + r R' + \mu r^2 R - \ell^2 R = 0 +\end{aligned}$$ + +To continue, we need to specify the refractive index $n(r)$, contained in $\mu(r)$. +We choose a **step-index fiber**, +whose cross-section consists of a **core** with radius $a$, +surrounded by a **cladding** that extends to infinity $r \to \infty$. +In the core $r < a$, the index $n$ is a constant $n_i$, +while in the cladding $r > a$ it is another constant $n_o$. + +Since $\mu$ is different in the core and cladding, +we will get different solutions $R_i$ and $R_o$ there, +so we must demand that the field is continuous at the boundary $r = a$: + +$$\begin{aligned} + R_i(a) = R_o(a) + \qquad \qquad + R_i'(a) = R_o'(a) +\end{aligned}$$ + +Furthermore, for a physically plausible solution, +we require that $R_i$ is finite +and that $R_o$ decays monotonically to zero when $r \to \infty$. +These constraints will turn out to restrict $\mu$. + +Introducing a new coordinate $\rho \equiv r \sqrt{|\mu|}$ +gives the Bessel equation's standard form, +which has well-known solutions called *Bessel functions*, shown below. +Let $\pm$ be the sign of $\mu$: + +$$\begin{aligned} + \begin{cases} + \displaystyle + 0 = \rho^2 \pdvn{2}{R}{\rho} + \rho \pdv{R}{\rho} \pm \rho^2 R - \ell^2 R + & \mathrm{for}\; \mu \neq 0 + \\ + \displaystyle + 0 = r^2 \pdvn{2}{R}{r} + r \pdv{R}{r} - \ell^2 R + & \mathrm{for}\; \mu = 0 + \end{cases} +\end{aligned}$$ + +<a href="bessel.jpg"> +<img src="bessel.jpg" style="width:100%"> +</a> + +Looking at these solutions with our constraints for $R_o$ in mind, +we see that for $\mu > 0$ none of the solutions decay +*monotonically* to zero, so we must have $\mu \le 0$ in the cladding. +Of the remaining candidates, $\ln\!(r)$, $r^\ell$ and $I_\ell(\rho)$ do not decay at all, +leading to the following $R_o$: + +$$\begin{aligned} + R_{o,\ell}(r) = + \begin{cases} + r^{-\ell} + & \mathrm{for}\; \mu = 0 \;\mathrm{and}\; \ell = 1,2,3,... + \\ + K_\ell(\rho) = K_\ell(r \sqrt{-\mu}) + & \mathrm{for}\; \mu < 0 \;\mathrm{and}\; \ell = 0,1,2,... + \end{cases} +\end{aligned}$$ + +Next, for $R_i$, we see that when $\mu < 0$ all solutions are invalid +since they diverge at $r = 0$, +and so do $\ln\!(r)$, $r^{-\ell}$ and $Y_\ell(\rho)$. +Of the remaining candidates, $r^0$ and $r^\ell$ have a non-negative slope +at the boundary $r = a$, so they can never be continuous with $R_o'$. +This leaves $J_\ell(\rho)$ for $\mu > 0$: + +$$\begin{aligned} + R_{i,\ell}(r) = + J_\ell(\rho) = J_\ell(r \sqrt{\mu}) + \qquad \mathrm{for}\; \mu > 0 \;\mathrm{and}\; \ell = 0,1,2,... +\end{aligned}$$ + +Putting this all together, we now know what the full solution for $F$ should look like: + +$$\begin{aligned} + F_\ell(r, \phi) + = R_\ell(r) \, \Phi_\ell(\phi) + = + \begin{cases} + A_\ell \: R_{i,\ell}(r) \, \cos(\phi \ell) + & \mathrm{for}\; r \le a + \\ + B_\ell \: R_{o,\ell}(r) \, \cos(\phi l) + & \mathrm{for}\; r \ge a + \end{cases} +\end{aligned}$$ + +Where $A_\ell$ and $B_\ell$ are constants to be chosen +based on the light's intensity, and to satisfy the continuity condition at $r = a$. + +We found that $\mu \le 0$ in the cladding and $\mu > 0$ in the core. +Since $\mu \equiv n^2 k^2 \!-\! \beta^2$ by definition, +this discovery places a constraint on the propagation constant $\beta$: + +$$\begin{aligned} + n_i^2 k^2 > \beta^2 \ge n_o^2 k^2 +\end{aligned}$$ + +Therefore, $n_i > n_o$ in a step-index fiber, +and there is only a limited range of allowed $\beta$-values; +the fiber is not able to guide the light outside this range. + +However, not all $\beta$ in this range are created equal for all $k$. +To investigate further, let us define the quantities +$\xi_\mathrm{core}$ and $\xi_\mathrm{clad}$ like so, +assuming $n_i$ and $n_o$ do not depend on $k$: + +$$\begin{aligned} + \xi_i(k) + \equiv \sqrt{ n_i^2 k^2 - \beta^2(k) } + \qquad \qquad + \xi_o(k) + \equiv \sqrt{ \beta^2(k) - n_o^2 k^2 } +\end{aligned}$$ + +It is important to note that the sum of their squares is constant with respect to $\beta$: + +$$\begin{aligned} + \xi_i^2 + \xi_o^2 = (\mathrm{NA})^2 k^2 +\end{aligned}$$ + +Where $\mathrm{NA}$ is the so-called **numerical aperture**, +often mentioned in papers and datasheets as one of a fiber's key parameters. +It is defined as: + +$$\begin{aligned} + \boxed{ + \mathrm{NA} + \equiv \sqrt{n_i^2 - n_o^2} + } +\end{aligned}$$ + +From this, we define a new fiber parameter: the $V$-**number**, +which is extremely useful: + +$$\begin{aligned} + \boxed{ + V + \equiv a \sqrt{\xi_i^2 + \xi_o^2} + = a k \: \mathrm{NA} + } +\end{aligned}$$ + +Now, the allowed values of $\beta$ are found +by fulfilling the boundary conditions (for $\mu \neq 0$): + +$$\begin{aligned} + A_\ell J_\ell(a \xi_i) + &= B_\ell K_\ell(a \xi_o) + \\ + A_\ell \xi_i J_\ell'(a \xi_i) + &= B_\ell \xi_o K_\ell'(a \xi_o) +\end{aligned}$$ + +To remove $A_\ell$ and $B_\ell$, +we divide the latter equation by the former, +meanwhile defining $X \equiv a \xi_i$ and $Y \equiv a \xi_o$ +for convenience, such that $X^2 + Y^2 = V^2$: + +$$\begin{aligned} + X \frac{J_\ell'(X)}{J_\ell(X)} = Y \frac{K_\ell'(Y)}{K_\ell(Y)} +\end{aligned}$$ + +We can turn this result into something a bit nicer +by using the following identities: + +$$\begin{aligned} + J_\ell'(x) = -J_{\ell+1}(x) + \ell \frac{J_\ell(x)}{x} + \qquad \quad + K_\ell'(x) = -K_{\ell+1}(x) + \ell \frac{K_\ell(x)}{x} +\end{aligned}$$ + +With this, the transcendental equation for $\beta$ +takes this convenient form: + +$$\begin{aligned} + \boxed{ + X \frac{J_{\ell+1}(X)}{J_\ell(X)} = Y \frac{K_{\ell+1}(Y)}{K_\ell(Y)} + } +\end{aligned}$$ + +All $\beta$ that satisfy this indicate the existence +of a **linearly polarized** mode. +These modes are called $\mathrm{LP}_{\ell m}$, +where $\ell$ is the primary (azimuthal) mode index, +and $m$ the secondary (radial) mode index, +which is needed because multiple $\beta$ may exist for a single $\ell$. + +An example graphical solution of the transcendental equation +is illustrated below for a fiber with $V = 5$, +where red and blue respectively denote the left and right-hand side: + +<a href="modes.jpg"> +<img src="modes.jpg" style="width:100%"> +</a> + +This shows that each $\mathrm{LP}_{\ell m}$ has an associated cut-off $V_{\ell m}$, +so that if $V > V_{\ell m}$ then $\mathrm{LP}_{lm}$ exists, +as long as $\beta$ stays in the allowed range. +The cut-offs of the secondary modes for a given $\ell$ +are found as the $m$th roots of $J_{\ell-1}(V_{\ell m}) = 0$. +In the above figure, they are $V_{01} = 0$, $V_{11} = 2.405$, and $V_{02} = V_{21} = 3.832$. + +All differential equations have been linear, +so a linear combination of these solutions is also valid. +Therefore, the fiber modes represent independent "channels" of light. +However, in practice, they can interact nonlinearly, +and light can scatter between them, and between polarizations. + + + +## References +1. O. Bang, + *Applied mathematics for physicists: lecture notes*, 2019, + unpublished. +2. B.E.A. Saleh, M.C. Teich, + *Fundamentals of photonics*, 1st edition, 1991, + Wiley. diff --git a/source/know/concept/step-index-fiber/modes.jpg b/source/know/concept/step-index-fiber/modes.jpg Binary files differnew file mode 100644 index 0000000..85682d7 --- /dev/null +++ b/source/know/concept/step-index-fiber/modes.jpg diff --git a/source/know/concept/stochastic-process/index.md b/source/know/concept/stochastic-process/index.md new file mode 100644 index 0000000..512110a --- /dev/null +++ b/source/know/concept/stochastic-process/index.md @@ -0,0 +1,58 @@ +--- +title: "Stochastic process" +date: 2021-11-07 +categories: +- Mathematics +- Stochastic analysis +- Measure theory +layout: "concept" +--- + +A **stochastic process** $X_t$ is a time-indexed +[random variable](/know/concept/random-variable/), +$\{ X_t : t > 0 \}$, i.e. a set of (usually correlated) +random variables, each labelled with a unique timestamp $t$. + +Whereas "ordinary" random variables are defined on +a probability space $(\Omega, \mathcal{F}, P)$, +stochastic process are defined on +a **filtered probability space** $(\Omega, \mathcal{F}, \{ \mathcal{F}_t \}, P)$. +As before, $\Omega$ is the sample space, +$\mathcal{F}$ is the event space, +and $P$ is the probability measure. + +The **filtration** $\{ \mathcal{F}_t : t \ge 0 \}$ +is a time-indexed set of [$\sigma$-algebras](/know/concept/sigma-algebra/) on $\Omega$, +which contains at least all the information generated +by $X_t$ up to the current time $t$, +and is a subset of $\mathcal{F}_t$: + +$$\begin{aligned} + \mathcal{F} + \supseteq \mathcal{F}_t + \supseteq \sigma(X_s : 0 \le s \le t) +\end{aligned}$$ + +In other words, $\mathcal{F}_t$ is the "accumulated" $\sigma$-algebra +of all information extractable from $X_t$, +and hence grows with time: $\mathcal{F}_s \subseteq \mathcal{F}_t$ for $s < t$. +Given $\mathcal{F}_t$, all values $X_s$ for $s \le t$ can be computed, +i.e. if you know $\mathcal{F}_t$, then the present and past of $X_t$ can be reconstructed. + +Given any filtration $\mathcal{H}_t$, a stochastic process $X_t$ +is said to be *"$\mathcal{H}_t$-adapted"* +if $X_t$'s own filtration $\sigma(X_s : 0 \le s \le t) \subseteq \mathcal{H}_t$, +meaning $\mathcal{H}_t$ contains enough information +to determine the current and past values of $X_t$. +Clearly, $X_t$ is always adapted to its own filtration. + +Filtration and their adaptations are very useful +for working with stochastic processes, +most notably for calculating [conditional expectations](/know/concept/conditional-expectation/). + + + +## References +1. U.H. Thygesen, + *Lecture notes on diffusions and stochastic differential equations*, + 2021, Polyteknisk Kompendie. diff --git a/source/know/concept/stokes-law/index.md b/source/know/concept/stokes-law/index.md new file mode 100644 index 0000000..d52b0b4 --- /dev/null +++ b/source/know/concept/stokes-law/index.md @@ -0,0 +1,366 @@ +--- +title: "Stokes' law" +date: 2021-05-04 +categories: +- Physics +- Fluid mechanics +- Fluid dynamics +layout: "concept" +--- + +**Stokes' law** describes the size of the drag force $D$ +at low [Reynolds number](/know/concept/reynolds-number/) $\mathrm{Re} \ll 1$ +experienced by a spherical object in a steady, uniform flow at velocity $U$. + + +## Flow field + +Imagine a sphere with radius $a$ sinking in a viscous liquid. +To model this situation, let us pretend that the sphere is fixed instead, +and the fluid comes from infinity at velocity $U$ along the $z$-axis, +flows past the sphere, and continues to infinity at the same $U$. +The Reynolds number is: + +$$\begin{aligned} + \mathrm{Re} + = \frac{2 a U}{\nu} +\end{aligned}$$ + +We assume that $\mathrm{Re} \ll 1$, in which case +the incompressible [Navier-Stokes equations](/know/concept/navier-stokes-equations/) +are reduced to the **steady Stokes equations**: + +$$\begin{aligned} + \nabla p + = \eta \nabla^2 \va{v} + \qquad \quad + \nabla \cdot \va{v} + = 0 +\end{aligned}$$ + +The goal is to solve for $p$ and $\va{v}$. +We make the following ansatz in +[spherical coordinates](/know/concept/spherical-coordinates/) $(r, \theta, \phi)$, +where $q(r)$, $f(r)$ and $g(r)$ are unknown functions: + +$$\begin{gathered} + p + = \eta U q(r) \cos\theta + \\ + v_r + = U f(r) \cos\theta + \qquad + v_\theta + = - U g(r) \sin\theta + \qquad + v_\phi + = 0 +\end{gathered}$$ + +The fluid hits the sphere head on, +so the solution is taken to be $\phi$-independent due to symmetry. +Note that $\theta$ is the angle to the positive $z$-axis, +which is the direction of $\va{U} = U \vu{e}_z$. +Moreover, note that $\va{U} \cdot \vu{e}_r = U \cos\theta$ +and $\va{U} \cdot \vu{e}_\theta = - U \sin\theta$, +where $\vu{e}_r$ and $\vu{e}_\theta$ are basis vectors. + +To begin with, we insert this ansatz into the incompressibility condition, +yielding: + +$$\begin{aligned} + 0 + = \nabla \cdot \va{v} + &= \pdv{v_r}{r} + \frac{1}{r} \pdv{v_\theta}{\theta} + \frac{2 v_r}{r} + \frac{v_\theta}{r \tan \theta} + \\ + &= U \dv{f}{r} \cos\theta - \frac{U g}{r} \cos\theta + \frac{2 U f}{r} \cos\theta - \frac{U g}{r} \cos\theta + \\ + &= U \cos\theta \Big( \dv{f}{r} + \frac{2}{r} f - \frac{2}{r} g \Big) +\end{aligned}$$ + +The parenthesized expression must be zero for all $r$, +leading us to the following relation: + +$$\begin{aligned} + g(r) + = f + \frac{r}{2} \dv{f}{r} +\end{aligned}$$ + +Next, we take the divergence of the first Stokes equation, +and insert incompressibility: + +$$\begin{aligned} + \nabla^2 p + = \eta \nabla \cdot (\nabla^2 \va{v}) + = \eta \nabla^2 (\nabla \cdot \va{v}) + = 0 +\end{aligned}$$ + +This is simply the Laplace equation, +which is as follows for our ansatz $p(r, \theta)$: + +$$\begin{aligned} + 0 + = \nabla^2 p + &= \frac{1}{r^2} \pdv{}{r}\Big( r^2 \pdv{p}{r} \Big) + \frac{1}{r^2 \sin\theta} \pdv{}{\theta}\Big( \sin\theta \pdv{p}{\theta} \Big) + \\ + 0 + &= \frac{\eta U \cos\theta}{r^2} \dv{}{r}\Big( r^2 \dv{q}{r} \Big) + - \frac{\eta U q}{r^2 \sin\theta} \pdv{}{\theta}\Big( \sin^2\theta \Big) + \\ + &= \frac{\eta U \cos\theta}{r^2} \dv{}{r}\Big( r^2 \dv{q}{r} \Big) + - \frac{2 \eta U q}{r^2 \sin\theta} \sin\theta \cos\theta + \\ + &= \eta U \cos\theta \Big( \dvn{2}{q}{r} + \frac{2}{r} \dv{q}{r} - \frac{2}{r^2} q \Big) +\end{aligned}$$ + +Again, the parenthesized expression must be zero for all $r$, +meaning it is an ODE for $q(r)$, +whose solution is straightforwardly found to be: + +$$\begin{aligned} + q(r) + = \frac{C_3}{r^2} + C_4 r +\end{aligned}$$ + +Where $C_3$ and $C_4$ are linearity constants ($C_1$ and $C_2$ appear later). +The pressure is therefore: + +$$\begin{aligned} + p + = \eta U \cos\theta \Big( \frac{C_3}{r^2} + C_4 r \Big) +\end{aligned}$$ + +Consequently, its gradient $\nabla p$ in spherical coordinates is as follows: + +$$\begin{aligned} + \nabla p + = \vu{e}_r \pdv{p}{r} + \vu{e}_\theta \frac{1}{r} \pdv{p}{\theta} + = \vu{e}_r \Big( \eta U \cos\theta \dv{q}{r} \Big) - \vu{e}_\theta \Big( \eta U \sin\theta \frac{q}{r} \Big) +\end{aligned}$$ + +According to the Stokes equation, this equals $\eta \nabla^2 \va{v}$. +Let us look at the $r$-component of $\nabla^2 \va{v}$: + +$$\begin{aligned} + (\nabla^2 \va{v})_r + &= \pdvn{2}{v_r}{r} + \frac{1}{r^2} \pdvn{2}{v_r}{\theta} + \frac{2}{r} \pdv{v_r}{r} + + \frac{\cot\theta}{r^2} \pdv{v_r}{\theta} - \frac{2}{r^2} \pdv{v_\theta}{\theta} - \frac{2}{r^2} v_r - \frac{2 \cot\theta}{r^2} v_\theta + \\ + &= U \cos\theta \Big( \dvn{2}{f}{r} - \frac{1}{r^2} f + \frac{2}{r} \dv{f}{r} - \frac{1}{r^2} f + + \frac{2}{r^2} g - \frac{2}{r^2} f + \frac{2}{r^2} g \Big) + \\ + &= U \cos\theta \Big( \dvn{2}{f}{r} + \frac{2}{r} \dv{f}{r} - \frac{4}{r^2} f + \frac{4}{r^2} g \Big) +\end{aligned}$$ + +Substituting $g$ for the expression we found from incompressibility lets us simplify this: + +$$\begin{aligned} + \eta (\nabla^2 \va{v})_r + &= \eta U \cos\theta \Big( \dvn{2}{f}{r} + \frac{4}{r} \dv{f}{r} \Big) +\end{aligned}$$ + +The Stokes equation says that this must be equal to the $r$-component of $\nabla p$: + +$$\begin{aligned} + \eta U \cos\theta \Big( \dvn{2}{f}{r} + \frac{4}{r} \dv{f}{r} \Big) + = \eta U \cos\theta \Big( \!-\! \frac{2 C_3}{r^3} + C_4 \Big) +\end{aligned}$$ + +Where we have inserted $\idv{q}{r}$. +Dividing out $\eta U \cos\theta$ leaves an ODE for $f(r)$, +satisfied by: + +$$\begin{aligned} + f(r) + = C_1 + \frac{C_2}{r^3} + \frac{C_3}{r} + \frac{C_4 r^2}{10} +\end{aligned}$$ + +Then, thanks to our earlier relation again, +we know that $g(r)$ is as follows: + +$$\begin{aligned} + g(r) + = C_1 - \frac{C_2}{2 r^3} + \frac{C_3}{2 r} + \frac{C_4 r^2}{5} +\end{aligned}$$ + +So what about $C_1$, $C_2$, $C_3$ and $C_4$? +For $r\!\to\!\infty$, we expect that $\va{v}\!\to\!\va{U}$, +meaning that $f(r)\!\to\!1$ and $g(r)\!\to\!1$. +This implies that $C_4 = 0$ and $C_1 = 1$, leaving: + +$$\begin{aligned} + f(r) + = 1 + \frac{C_2}{r^3} + \frac{C_3}{r} + \qquad \quad + g(r) + = 1 - \frac{C_2}{2 r^3} + \frac{C_3}{2 r} +\end{aligned}$$ + +Furthermore, the viscous *no-slip* condition demands +that $\va{v} = 0$ at the sphere's surface $r = a$, so $f(a) = g(a) = 0$ there. +Inserting $a$ into $f$ and $g$, setting them to zero, +and solving the resulting system of equations +yields $C_2 = a^3 / 2$ and $C_3 = -3 a / 2$. +Therefore the full solution is: + +$$\begin{gathered} + \boxed{ + p + = - \frac{3 \eta U a}{2 r^2} \cos\theta + } + \\ + \boxed{ + v_r + = U \cos\theta \Big( 1 + \frac{a^3}{2 r^3} - \frac{3 a}{2 r} \Big) + \qquad + v_\theta + = - U \sin\theta \Big( 1 - \frac{a^3}{4 r^3} - \frac{3 a}{4 r} \Big) + } +\end{gathered}$$ + + +## Drag force + +From the definition of [viscosity](/know/concept/viscosity/), +we know that there must be shear stresses at the sphere surface, +described by the fluid's [Cauchy stress tensor](/know/concept/cauchy-stress-tensor/) $\hat{\sigma}$. +The drag force $\va{D}$ on the surface is: + +$$\begin{aligned} + \va{D} + = \oint \hat{\sigma} \cdot \dd{\va{S}} + = \int_0^{2\pi} \!\!\!\! \int_0^\pi \big( \hat{\sigma} \cdot \vu{e}_r \big) \:a^2 \sin\theta \dd{\theta} \dd{\phi} +\end{aligned}$$ + +Where $\vu{e}_r$ is the sphere's surface normal vector. +The integrand can be expanded as follows: + +$$\begin{aligned} + \hat{\sigma} \cdot \vu{e}_r + = \vu{e}_r \sigma_{rr} + \vu{e}_\theta \sigma_{\theta r} +\end{aligned}$$ + +To calculate this, we start by taking the gradient of the velocity field $\va{v}$: + +$$\begin{aligned} + \nabla\va{v} + &= \vu{e}_r \vu{e}_r \pdv{v_r}{r} + \vu{e}_r \vu{e}_\theta \pdv{v_\theta}{r} + + \vu{e}_\theta \vu{e}_r \Big( \frac{1}{r} \pdv{v_r}{\theta} - \frac{v_\theta}{r} \Big) + \\ + &\qquad + \vu{e}_\theta \vu{e}_\theta \Big( \frac{1}{r} \pdv{v_\theta}{\theta} - \frac{v_r}{r} \Big) + + \vu{e}_\phi \vu{e}_\phi \Big( \frac{v_\theta}{r \tan\theta} + \frac{v_r}{r} \Big) +\end{aligned}$$ + +Some of these terms are necessary to calculate the stress elements $\sigma_{rr}$ and $\sigma_{\theta r}$: + +$$\begin{aligned} + \sigma_{rr} + &= - p + 2 \eta (\nabla\va{v})_{rr} + = - p + 2 \eta \pdv{v_r}{r} + \\ + &= \frac{3 \eta U a}{2 r^2} \cos\theta + 2 \eta U \cos\theta \: \Big( \!-\! \frac{3 a^3}{2 r^4} + \frac{3 a}{2 r^2} \Big) + \\ + &= \frac{3 \eta U a}{2 r^2} \cos\theta \: \Big( 3 - 2 \frac{a^2}{r^2} \Big) +\end{aligned}$$ +$$\begin{aligned} + \sigma_{\theta r} + &= \eta \big( (\nabla\va{v})_{\theta r} + (\nabla\va{v})_{r \theta} \big) + = \eta \: \Big( \pdv{v_\theta}{r} + \frac{1}{r} \pdv{v_r}{\theta} - \frac{v_\theta}{r} \Big) + \\ + &= \eta U \sin\theta \: \Big( \!-\! \frac{3 a^3}{4 r^4} - \frac{3 a}{4 r^2} + - \frac{1}{r} - \frac{a^3}{2 r^4} + \frac{3 a}{2 r^2} + + \frac{1}{r} - \frac{a^3}{4 r^4} - \frac{3 a}{4 r^2} \Big) + \\ + &= - \frac{3 \eta U a^3}{2 r^4} \sin\theta +\end{aligned}$$ + +At the sphere's surface we set $r = a$, so these expressions reduce to the following: + +$$\begin{aligned} + \sigma_{rr} + = \frac{3 \eta U}{2 a} \cos\theta + \qquad \quad + \sigma_{\theta r} + = - \frac{3 \eta U}{2 a} \sin\theta +\end{aligned}$$ + +Now we can finally calculate the effective stress on the surface, +by converting the basis vectors $\vu{e}_r$ and $\vu{e}_\theta$ to Cartesian coordinates: + +$$\begin{aligned} + \hat{\sigma} \cdot \vu{e}_r + &= \vu{e}_r \frac{3 \eta U}{2 a} \cos\theta - \vu{e}_\theta \frac{3 \eta U}{2 a} \sin\theta + \\ + &= \Big( \vu{e}_x \sin\theta \cos\phi + \vu{e}_y \sin\theta \sin\phi + \vu{e}_z \cos\theta \Big) \frac{3 \eta U}{2 a} \cos\theta + \\ + &\qquad - \Big( \vu{e}_x \cos\theta \cos\phi + \vu{e}_y \cos\theta \sin\phi - \vu{e}_z \sin\theta \Big) \frac{3 \eta U}{2 a} \sin\theta + \\ + &= \Big( \vu{e}_z \cos^2\theta + \vu{e}_z \sin^2\theta \Big) \frac{3 \eta U}{2 a} + = \vu{e}_z \frac{3 \eta U}{2 a} +\end{aligned}$$ + +Remarkably, the stress at every point on the sphere is purely in the $z$-direction! +This is not entirely unexpected though: symmetry cancels out all other components. + +With this, we can do the integrals for $\va{D}$, +which reduce to a surface area factor $4 \pi a^2$: + +$$\begin{aligned} + \va{D} + = \vu{e}_z \frac{3 \eta U}{2 a} \int_0^{2\pi} \!\!\!\! \int_0^\pi a^2 \sin\theta \dd{\theta} \dd{\phi} + = \vu{e}_z \frac{3 \eta U}{2 a} 2 \pi a^2 \int_0^\pi \sin\theta \dd{\theta} + = \vu{e}_z \: 6 \pi \eta U a +\end{aligned}$$ + +At last, we arrive at Stokes' law, +which simply expresses the magnitude of $\va{D}$: + +$$\begin{aligned} + \boxed{ + D + = 6 \pi \eta U a + } +\end{aligned}$$ + +To arrive at this result, +we assumed that the sphere was fixed, and the fluid was flowing past it. +We can equally well let the fluid be at rest, +with the sphere falling through it at $U$. +The force of gravity then exerts the following force $G$ on it, +subtracting [buoyancy](/know/concept/archimedes-principle/): + +$$\begin{aligned} + G + = \frac{4 \pi a^3}{3} (\rho_s - \rho_f) g_0 +\end{aligned}$$ + +Where $\rho_s$ and $\rho_f$ are the sphere's and fluid's densities, +and $g_0$ is the gravitational acceleration. +Since $D$ acts in the opposite sense of $G$, +after some time, they cancel out: + +$$\begin{aligned} + 6 \pi \eta U a + = \frac{4 \pi a^3}{3} (\rho_s - \rho_f) g_0 +\end{aligned}$$ + +This is an equation for the **terminal velocity** $U_t$, +which we find to be as follows: + +$$\begin{aligned} + \boxed{ + U_t + = \frac{2 a^2 (\rho_s - \rho_f) g_0}{9 \eta} + } +\end{aligned}$$ + +The falling sphere will accelerate until $U_t$, +and then continue falling at constant speed. + + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/sturm-liouville-theory/index.md b/source/know/concept/sturm-liouville-theory/index.md new file mode 100644 index 0000000..f9cc6b2 --- /dev/null +++ b/source/know/concept/sturm-liouville-theory/index.md @@ -0,0 +1,345 @@ +--- +title: "Sturm-Liouville theory" +date: 2021-02-23 +categories: +- Mathematics +- Physics +layout: "concept" +--- + +**Sturm-Liouville theory** defines the analogue of Hermitian matrix +eigenvalue problems for linear second-order ODEs. + +It states that, given suitable boundary conditions, any linear +second-order ODE can be rewritten using the **Sturm-Liouville operator**, +and that the corresponding eigenvalue problem, known as a +**Sturm-Liouville problem**, will give real eigenvalues and a complete set +of eigenfunctions. + + +## General operator + +Consider the most general form of a second-order linear +differential operator $\hat{L}$, where $p_0(x)$, $p_1(x)$, and $p_2(x)$ +are real functions of $x \in [a,b]$ which are non-zero for all $x \in ]a, b[$: + +$$\begin{aligned} + \hat{L} \{u(x)\} = p_0(x) u''(x) + p_1(x) u'(x) + p_2(x) u(x) +\end{aligned}$$ + +We now define the **adjoint** or **Hermitian** operator +$\hat{L}^\dagger$ analogously to matrices: + +$$\begin{aligned} + \inprod{f}{\hat{L} g} + = \inprod{\hat{L}^\dagger f}{g} +\end{aligned}$$ + +What is $\hat{L}^\dagger$, given the above definition of $\hat{L}$? +We start from the inner product $\inprod{f}{\hat{L} g}$: + +$$\begin{aligned} + \inprod{f}{\hat{L} g} + &= \int_a^b f^*(x) \hat{L}\{g(x)\} \dd{x} + = \int_a^b (f^* p_0) g'' + (f^* p_1) g' + (f^* p_2) g \dd{x} + \\ + &= \big[ (f^* p_0) g' + (f^* p_1) g \big]_a^b - \int_a^b (f^* p_0)' g' + (f^* p_1)' g - (f^* p_2) g \dd{x} + \\ + &= \big[ f^* \big( p_0 g' \!+\! p_1 g \big) \!-\! (f^* p_0)' g \big]_a^b + \int_a^b \! \big( (f p_0)'' - (f p_1)' + (f p_2) \big)^* g \dd{x} + \\ + &= \big[ f^* \big( p_0 g' + (p_1 - p_0') g \big) - (f^*)' p_0 g \big]_a^b + \int_a^b \big( \hat{L}^\dagger\{f\} \big)^* g \dd{x} +\end{aligned}$$ + +We now have an expression for $\hat{L}^\dagger$, but are left with an +annoying boundary term: + +$$\begin{aligned} + \inprod{f}{\hat{L} g} + &= \big[ f^* \big( p_0 g' + (p_1 - p_0') g \big) - (f^*)' p_0 g \big]_a^b + \inprod{\hat{L}^\dagger f}{g} +\end{aligned}$$ + +To fix this, +let us demand that $p_1(x) = p_0'(x)$ and that +$[p_0(f^* g' - (f^*)' g)]_a^b = 0$, leaving: + +$$\begin{aligned} + \inprod{f}{\hat{L} g} + &= \big[ p_0 \big( f^* g' - (f^*)' g \big) \big]_a^b + \Inprod{\hat{L}^\dagger f}{g} + = \inprod{\hat{L}^\dagger f}{g} +\end{aligned}$$ + +Using the aforementioned restriction $p_1(x) = p_0'(x)$, +we then take a look at the definition of $\hat{L}^\dagger$: + +$$\begin{aligned} + \hat{L}^\dagger \{f\} + &= (p_0 f)'' - (p_1 f)' + (p_2 f) + \\ + &= p_0 f'' + (2 p_0' - p_1) f' + (p_0'' - p_1' + p_2) f + \\ + &= p_0 f'' + p_0' f' + p_2 f + \\ + &= (p_0 f')' + p_2 f +\end{aligned}$$ + +The original operator $\hat{L}$ reduces to the same form, +so it is **self-adjoint**: + +$$\begin{aligned} + \hat{L} \{f\} + &= p_0 f'' + p_0' f' + p_2 f + = (p_0 f')' + p_2 f + = \hat{L}^\dagger \{f\} +\end{aligned}$$ + +Consequently, every such second-order linear operator $\hat{L}$ is self-adjoint, +as long as it satisfies the constraints $p_1(x) = p_0'(x)$ and $[p_0 (f^* g' - (f^*)' g)]_a^b = 0$. + +Let us ignore the latter constraint for now (it will return later), +and focus on the former: what if $\hat{L}$ does not satisfy $p_0' \neq p_1$? +We multiply it by an unknown $p(x) \neq 0$, and divide by $p_0(x) \neq 0$: + +$$\begin{aligned} + \frac{p(x)}{p_0(x)} \hat{L} \{u\} = p(x) u'' + p(x) \frac{p_1(x)}{p_0(x)} u' + p(x) \frac{p_2(x)}{p_0(x)} u +\end{aligned}$$ + +We now define $q(x)$, +and demand that the derivative $p'(x)$ of the unknown $p(x)$ satisfies: + +$$\begin{aligned} + q(x) = p(x) \frac{p_2(x)}{p_0(x)} + \qquad + p'(x) = p(x) \frac{p_1(x)}{p_0(x)} +\end{aligned}$$ + +The latter is a differential equation for $p(x)$, which we solve by integration: + +$$\begin{gathered} + \frac{p_1(x)}{p_0(x)} = \frac{1}{p(x)} \dv{p}{x} + \quad \implies \quad + \frac{p_1(x)}{p_0(x)} \dd{x} = \frac{1}{p(x)} \dd{p} + \\ + \implies \quad + \int_a^x \frac{p_1(\xi)}{p_0(\xi)} \dd{\xi} = \int_{p(a)}^{p(x)} \frac{1}{f} \dd{f} + = \ln\!\Big( \frac{p(x)}{p(a)} \Big) + \\ + \implies \quad + p(x) = p(a) \exp\!\Big( \int_a^x \frac{p_1(\xi)}{p_0(\xi)} \dd{\xi} \Big) +\end{gathered}$$ + +Now that we have $p(x)$ and $q(x)$, we can define a new operator $\hat{L}_p$ as follows: + +$$\begin{aligned} + \hat{L}_p \{u\} + = \frac{p}{p_0} \hat{L} \{u\} + = p u'' + p' u' + q u + = (p u')' + q u +\end{aligned}$$ + +This is the self-adjoint form from earlier! +So even if $p_0' \neq p_1$, any second-order linear operator with $p_0(x) \neq 0$ +can easily be put in self-adjoint form. + +This general form is known as the **Sturm-Liouville operator** $\hat{L}_{SL}$, +where $p(x)$ and $q(x)$ are non-zero real functions of the variable $x \in [a,b]$: + +$$\begin{aligned} + \boxed{ + \hat{L}_{SL} \{u(x)\} + = \frac{d}{dx}\Big( p(x) \frac{du}{dx} \Big) + q(x) u(x) + = \hat{L}_{SL}^\dagger \{u(x)\} + } +\end{aligned}$$ + + +## Eigenvalue problem + +A **Sturm-Liouville problem** (SLP) is analogous to a matrix eigenvalue problem, +where $w(x)$ is a real weight function, $\lambda$ is the **eigenvalue**, +and $u(x)$ is the corresponding **eigenfunction**: + +$$\begin{aligned} + \boxed{ + \hat{L}_{SL}\{u(x)\} = - \lambda w(x) u(x) + } +\end{aligned}$$ + +Necessarily, $w(x) > 0$ except in isolated points, where $w(x) = 0$ is allowed; +the point is that any inner product $\Inprod{f}{w g}$ may never be zero due to $w$'s fault. +Furthermore, the convention is that $u(x)$ cannot be trivially zero. + +In our derivation of $\hat{L}_{SL}$, +we removed a boundary term to get self-adjointness. +Consequently, to have a valid SLP, the boundary conditions for +$u(x)$ must be as follows, otherwise the operator cannot be self-adjoint: + +$$\begin{aligned} + \Big[ p(x) \big( u^*(x) u'(x) - (u'(x))^* u(x) \big) \Big]_a^b = 0 +\end{aligned}$$ + +There are many boundary conditions (BCs) which satisfy this requirement. +Some notable ones are listed here non-exhaustively: + ++ **Dirichlet BCs**: $u(a) = u(b) = 0$ ++ **Neumann BCs**: $u'(a) = u'(b) = 0$ ++ **Robin BCs**: $\alpha_1 u(a) + \beta_1 u'(a) = \alpha_2 u(b) + \beta_2 u'(b) = 0$ with $\alpha_{1,2}, \beta_{1,2} \in \mathbb{R}$ ++ **Periodic BCs**: $p(a) = p(b)$, $u(a) = u(b)$, and $u'(a) = u'(b)$ ++ **Legendre "BCs"**: $p(a) = p(b) = 0$ + +Once this requirement is satisfied, Sturm-Liouville theory gives us +some very useful information about $\lambda$ and $u(x)$. +From the definition of an SLP, we know that, given two arbitrary (and possibly identical) +eigenfunctions $u_n$ and $u_m$, the following must be satisfied: + +$$\begin{aligned} + 0 = \hat{L}_{SL}\{u_n\} + \lambda_n w u_n = \hat{L}_{SL}\{u_m^*\} + \lambda_m^* w u_m^* +\end{aligned}$$ + +We subtract these expressions, multiply by the eigenfunctions, and integrate: + +$$\begin{aligned} + 0 + &= \int_a^b u_m^* \big(\hat{L}_{SL}\{u_n\} + \lambda_n w u_n\big) - u_n \big(\hat{L}_{SL}\{u_m^*\} + \lambda_m^* w u_m^*\big) \:dx + \\ + &= \int_a^b u_m^* \hat{L}_{SL}\{u_n\} - u_n \hat{L}_{SL}\{u_m^*\} + u_n u_m^* w (\lambda_n - \lambda_m^*) \:dx +\end{aligned}$$ + +Rearranging this a bit reveals that these are in fact three inner products: + +$$\begin{aligned} + \int_a^b u_m^* \hat{L}_{SL}\{u_n\} - u_n \hat{L}_{SL}\{u_m^*\} \:dx + &= (\lambda_m^* - \lambda_n) \int_a^b u_n u_m^* w \:dx + \\ + \inprod{u_m}{\hat{L}_{SL} u_n} - \inprod{\hat{L}_{SL} u_m}{u_n} + &= (\lambda_m^* - \lambda_n) \Inprod{u_m}{w u_n} +\end{aligned}$$ + +The operator $\hat{L}_{SL}$ is self-adjoint by definition, +so the left-hand side vanishes, leaving us with: + +$$\begin{aligned} + 0 + &= (\lambda_m^* - \lambda_n) \Inprod{u_m}{w u_n} +\end{aligned}$$ + +When $m = n$, the inner product $\Inprod{u_n}{w u_n}$ is real and positive +(assuming $u_n$ is not trivially zero, in which case it would be disqualified anyway). +In this case we thus know that $\lambda_n^* = \lambda_n$, +i.e. the eigenvalue $\lambda_n$ is real for any $n$. + +When $m \neq n$, then $\lambda_m^* - \lambda_n$ may or may not be zero, +depending on the degeneracy. If there is no degeneracy, we +see that $\Inprod{u_m}{w u_n} = 0$, i.e. the eigenfunctions are orthogonal. + +In case of degeneracy, manual orthogonalization is needed, but as it turns out, +this is guaranteed to be doable, using e.g. the [Gram-Schmidt method](/know/concept/gram-schmidt-method/). + +In conclusion, **a Sturm-Liouville problem has real eigenvalues $\lambda$, +and all the corresponding eigenfunctions $u(x)$ are mutually orthogonal**: + +$$\begin{aligned} + \boxed{ + \Inprod{u_m(x)}{w(x) u_n(x)} + = \Inprod{u_n}{w u_n} \delta_{nm} + = A_n \delta_{nm} + } +\end{aligned}$$ + +When you're solving a differential eigenvalue problem, +knowing that all eigenvalues are real is a *huge* simplification, +so it is always worth checking whether you are dealing with an SLP. + +Another useful fact of SLPs is that they always +have an infinite number of discrete eigenvalues. +Furthermore, the eigenvalues always ascend to $+\infty$; +in other words, there always exists a *lowest* eigenvalue $\lambda_0 > -\infty$, +known as the **ground state**. + + +## Completeness + +Not only are the eigenfunctions $u_n(x)$ of an SLP orthogonal, they +also form a **complete basis**, meaning that any well-behaved function $f(x)$ can be +expanded as a **generalized Fourier series** with coefficients $a_n$: + +$$\begin{aligned} + \boxed{ + f(x) + = \sum_{n = 0}^\infty a_n u_n(x) + \quad \mathrm{for}\: x \in ]a, b[ + } +\end{aligned}$$ + +This series will converge significantly faster if $f(x)$ +satisfies the same BCs as $u_n(x)$. In that case the +expansion will even be valid for the inclusive interval $x \in [a, b]$. + +To find an expression for the coefficients $a_n$, +we multiply the above generalized Fourier series by $w(x) u_m^*(x)$ for an arbitrary $m$: + +$$\begin{aligned} + f(x) w(x) u_m^*(x) + &= \sum_{n = 0}^\infty a_n u_n(x) w(x) u_m^*(x) +\end{aligned}$$ + +By integrating we get inner products on both the left and the right: + +$$\begin{aligned} + \int_a^b f(x) w(x) u_m^*(x) \dd{x} + &= \int_a^b \Big(\sum_{n = 0}^\infty a_n u_n(x) w(x) u_m^*(x)\Big) \dd{x} + \\ + \Inprod{u_m}{w f} + &= \sum_{n = 0}^\infty a_n \Inprod{u_m}{w u_n} +\end{aligned}$$ + +Because the eigenfunctions of an SLP are mutually orthogonal, +the summation disappears: + +$$\begin{aligned} + \Inprod{u_m}{w f} + &= \sum_{n = 0}^\infty a_n \Inprod{u_m}{w u_n} + = \sum_{n = 0}^\infty a_n A_n \delta_{nm} + = a_m A_m +\end{aligned}$$ + +After isolating this for $a_n$, we see that +the coefficients are given by the projection of the target +function $f(x)$ onto the normalized eigenfunctions $u_n(x) / A_n$: + +$$\begin{aligned} + \boxed{ + a_n + = \frac{\Inprod{u_n}{w f}}{A_n} + = \frac{\Inprod{u_n}{w f}}{\Inprod{u_n}{w u_n}} + } +\end{aligned}$$ + +As a final remark, we can see something interesting +by rearranging the generalized Fourier series +after inserting the expression for $a_n$: + +$$\begin{aligned} + f(x) + &= \sum_{n = 0}^\infty \frac{1}{A_n} \Inprod{u_n}{w f} u_n(x) + = \int_a^b \Big(\sum_{n = 0}^\infty \frac{1}{A_n} u_n^*(\xi) w(\xi) f(\xi) u_n(x) \Big) \dd{\xi} + \\ + &= \int_a^b f(\xi) \Big(\sum_{n = 0}^\infty \frac{1}{A_n} u_n^*(\xi) w(\xi) u_n(x) \Big) \dd{\xi} +\end{aligned}$$ + +Upon closer inspection, the parenthesized summation +must be the [Dirac delta function](/know/concept/dirac-delta-function/) $\delta(x)$ +for the integral to work out. +This is in fact the underlying requirement for completeness: + +$$\begin{aligned} + \boxed{ + \sum_{n = 0}^\infty \frac{1}{A_n} u_n^*(\xi) w(\xi) u_n(x) = \delta(x - \xi) + } +\end{aligned}$$ + + + +## References +1. O. Bang, + *Applied mathematics for physicists: lecture notes*, 2019, + unpublished. diff --git a/source/know/concept/superdense-coding/index.md b/source/know/concept/superdense-coding/index.md new file mode 100644 index 0000000..f9ffbc1 --- /dev/null +++ b/source/know/concept/superdense-coding/index.md @@ -0,0 +1,71 @@ +--- +title: "Superdense coding" +date: 2021-03-07 +categories: +- Quantum information +layout: "concept" +--- + +In quantum information, **(super)dense coding** +is a protocol to enhance classical communication. +It uses a quantum communication channel and +[entanglement](/know/concept/quantum-entanglement/) +to send two bits of classical data with just one qubit. +It is conceptually similar to [quantum teleportation](/know/concept/quantum-teleportation/). + +Suppose that Alice wants to send two bits of classical data to Bob, +but she can only communicate with him over a quantum channel. +She could send a qubit, which has a larger state space than a classical bit, +but it can only be measured once, thereby yielding only one bit of data. + +However, they are already sharing an entangled pair of qubits +in the [Bell state](/know/concept/bell-state/) $\ket{\Phi^{+}}_{AB}$, +where $A$ and $B$ are qubits belonging to Alice and Bob, respectively. + +Based on the values of the two classical bits $(a_1, a_2)$, +Alice performs the following operations on her side $A$ +of the Bell state: + +<table style="width:70%;margin:auto;text-align:center;"> + <tr> + <th>$(a_1, a_2)$</th> + <th>Operator</th> + <th>Result</th> + </tr> + <tr> + <td>$00$</td> + <td>$\hat{I}$</td> + <td>$\ket{\Phi^{+}} = \frac{1}{\sqrt{2}} \Big(\Ket{0}_A \Ket{0}_B + \Ket{1}_A \Ket{1}_B \Big)$</td> + </tr> + <tr> + <td>$01$</td> + <td>$\hat{\sigma}_z$</td> + <td>$\ket{\Phi^{-}} = \frac{1}{\sqrt{2}} \Big(\Ket{0}_A \Ket{0}_B - \Ket{1}_A \Ket{1}_B \Big)$</td> + </tr> + <tr> + <td>$10$</td> + <td>$\hat{\sigma}_x$</td> + <td>$\ket{\Psi^{+}} = \frac{1}{\sqrt{2}} \Big(\Ket{0}_A \Ket{1}_B + \Ket{1}_A \Ket{0}_B \Big)$</td> + </tr> + <tr> + <td>$11$</td> + <td>$\hat{\sigma}_x \hat{\sigma}_z$</td> + <td>$\ket{\Psi^{-}} = \frac{1}{\sqrt{2}} \Big(\Ket{0}_A \Ket{1}_B - \Ket{1}_A \Ket{0}_B \Big)$</td> + </tr> +</table> + +Her actions affect the state on Bob's side $B$ due to entanglement. +Alice then sends her qubit $A$ to Bob over the quantum channel, +so he has both sides of the entangled pair. + +Finally, Bob performs a measurement of his pair in the Bell basis, +which will yield a Bell state that he can then look up in the table above +to recover the values of the bits $(a_1, a_2)$. +In the end, Alice only sent a single qubit, +and the rest of the information transfer was via entanglement. + + +## References +1. J.B. Brask, + *Quantum information: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/thermodynamic-potential/index.md b/source/know/concept/thermodynamic-potential/index.md new file mode 100644 index 0000000..fe81731 --- /dev/null +++ b/source/know/concept/thermodynamic-potential/index.md @@ -0,0 +1,273 @@ +--- +title: "Thermodynamic potential" +date: 2021-07-07 +categories: +- Physics +- Thermodynamics +layout: "concept" +--- + +**Thermodynamic potentials** are state functions +whose minima or maxima represent equilibrium states of a system. +Such functions are either energies (hence *potential*) or entropies. + +Which potential (of many) decides the equilibrium states for a given system? +That depends which variables are assumed to already be in automatic equilibrium. +Such variables are known as the **natural variables** of that potential. +For example, if a system can freely exchange heat with its surroundings, +and is consequently assumed to be at the same temperature $T = T_{\mathrm{sur}}$, +then $T$ must be a natural variable. + +The link from natural variables to potentials +is established by [thermodynamic ensembles](/know/category/thermodynamic-ensembles/). + +Once enough natural variables have been found, +the appropriate potential can be selected from the list below. +All non-natural variables can then be calculated +by taking partial derivatives of the potential +with respect to the natural variables. + +Mathematically, the potentials are related to each other +by [Legendre transformation](/know/concept/legendre-transform/). + + +## Internal energy + +The **internal energy** $U$ represents +the capacity to do both mechanical and non-mechanical work, +and to release heat. +It is simply the integral +of the [fundamental thermodynamic relation](/know/concept/fundamental-thermodynamic-relation/): + +$$\begin{aligned} + \boxed{ + U(S, V, N) \equiv T S - P V + \mu N + } +\end{aligned}$$ + +It is a function of the entropy $S$, volume $V$, and particle count $N$: +these are its natural variables. +An infinitesimal change $\dd{U}$ is as follows: + +$$\begin{aligned} + \boxed{ + \dd{U} = T \dd{S} - P \dd{V} + \mu \dd{N} + } +\end{aligned}$$ + +The non-natural variables are +temperature $T$, pressure $P$, and chemical potential $\mu$. +They can be recovered by differentiating $U$ +with respect to the natural variables $S$, $V$, and $N$: + +$$\begin{aligned} + \boxed{ + T = \Big( \pdv{U}{S} \Big)_{V,N} + \qquad + P = - \Big( \pdv{U}{V} \Big)_{S,N} + \qquad + \mu = \Big( \pdv{U}{N} \Big)_{S,V} + } +\end{aligned}$$ + +It is convention to write those subscripts, +to help keep track of which function depends on which variables. +They are meaningless; these are normal partial derivatives. + + +## Enthalpy + +The **enthalpy** $H$ of a system, in units of energy, +represents its capacity to do non-mechanical work, +plus its capacity to release heat. +It is given by: + +$$\begin{aligned} + \boxed{ + H(S, P, N) \equiv U + P V + } +\end{aligned}$$ + +It is a function of the entropy $S$, pressure $P$, and particle count $N$: +these are its natural variables. +An infinitesimal change $\dd{H}$ is as follows: + +$$\begin{aligned} + \boxed{ + \dd{H} = T \dd{S} + V \dd{P} + \mu \dd{N} + } +\end{aligned}$$ + +The non-natural variables are +temperature $T$, volume $V$, and chemical potential $\mu$. +They can be recovered by differentiating $H$ +with respect to the natural variables $S$, $P$, and $N$: + +$$\begin{aligned} + \boxed{ + T = \Big( \pdv{H}{S} \Big)_{P,N} + \qquad + V = \Big( \pdv{H}{P} \Big)_{S,N} + \qquad + \mu = \Big( \pdv{H}{N} \Big)_{S,P} + } +\end{aligned}$$ + + +## Helmholtz free energy + +The **Helmholtz free energy** $F$ represents +the capacity of a system to +do both mechanical and non-mechanical work, +and is given by: + +$$\begin{aligned} + \boxed{ + F(T, V, N) \equiv U - T S + } +\end{aligned}$$ + +It depends on the temperature $T$, volume $V$, and particle count $N$: +these are natural variables. +An infinitesimal change $\dd{H}$ is as follows: + +$$\begin{aligned} + \boxed{ + \dd{F} = - P \dd{V} - S \dd{T} + \mu \dd{N} + } +\end{aligned}$$ + +The non-natural variables are +entropy $S$, pressure $P$, and chemical potential $\mu$. +They can be recovered by differentiating $F$ +with respect to the natural variables $T$, $V$, and $N$: + +$$\begin{aligned} + \boxed{ + S = - \Big( \pdv{F}{T} \Big)_{V,N} + \qquad + P = - \Big( \pdv{F}{V} \Big)_{T,N} + \qquad + \mu = \Big( \pdv{F}{N} \Big)_{T,V} + } +\end{aligned}$$ + + +## Gibbs free energy + +The **Gibbs free energy** $G$ represents +the capacity of a system to do non-mechanical work: + +$$\begin{aligned} + \boxed{ + G(T, P, N) + \equiv U + P V - T S + } +\end{aligned}$$ + +It depends on the temperature $T$, pressure $P$, and particle count $N$: +they are natural variables. +An infinitesimal change $\dd{G}$ is as follows: + +$$\begin{aligned} + \boxed{ + \dd{G} = V \dd{P} - S \dd{T} + \mu \dd{N} + } +\end{aligned}$$ + +The non-natural variables are +entropy $S$, volume $V$, and chemical potential $\mu$. +These can be recovered by differentiating $G$ +with respect to the natural variables $T$, $P$, and $N$: + +$$\begin{aligned} + \boxed{ + S = - \Big( \pdv{G}{T} \Big)_{P,N} + \qquad + V = \Big( \pdv{G}{P} \Big)_{T,N} + \qquad + \mu = \Big( \pdv{G}{N} \Big)_{T,P} + } +\end{aligned}$$ + + +## Landau potential + +The **Landau potential** or **grand potential** $\Omega$, in units of energy, +represents the capacity of a system to do mechanical work, +and is given by: + +$$\begin{aligned} + \boxed{ + \Omega(T, V, \mu) \equiv U - T S - \mu N + } +\end{aligned}$$ + +It depends on temperature $T$, volume $V$, and chemical potential $\mu$: +these are natural variables. +An infinitesimal change $\dd{\Omega}$ is as follows: + +$$\begin{aligned} + \boxed{ + \dd{\Omega} = - P \dd{V} - S \dd{T} - N \dd{\mu} + } +\end{aligned}$$ + +The non-natural variables are +entropy $S$, pressure $P$, and particle count $N$. +These can be recovered by differentiating $\Omega$ +with respect to the natural variables $T$, $V$, and $\mu$: + +$$\begin{aligned} + \boxed{ + S = - \Big( \pdv{\Omega}{T} \Big)_{V,\mu} + \qquad + P = - \Big( \pdv{\Omega}{V} \Big)_{T,\mu} + \qquad + N = - \Big( \pdv{\Omega}{\mu} \Big)_{T,V} + } +\end{aligned}$$ + + +## Entropy + +The **entropy** $S$, in units of energy over temperature, +is an odd duck, but nevertheless used as a thermodynamic potential. +It is given by: + +$$\begin{aligned} + \boxed{ + S(U, V, N) \equiv \frac{1}{T} U + \frac{P}{T} V - \frac{\mu}{T} N + } +\end{aligned}$$ + +It depends on the internal energy $U$, volume $V$, and particle count $N$: +they are natural variables. +An infinitesimal change $\dd{S}$ is as follows: + +$$\begin{aligned} + \boxed{ + \dd{S} = \frac{1}{T} \dd{U} + \frac{P}{T} \dd{V} - \frac{\mu}{T} \dd{N} + } +\end{aligned}$$ + +The non-natural variables are $1/T$, $P/T$, and $\mu/T$. +These can be recovered by differentiating $S$ +with respect to the natural variables $U$, $V$, and $N$: + +$$\begin{aligned} + \boxed{ + \frac{1}{T} = \Big( \pdv{S}{U} \Big)_{V,N} + \qquad + \frac{P}{T} = \Big( \pdv{S}{V} \Big)_{U,N} + \qquad + \frac{\mu}{T} = - \Big( \pdv{S}{N} \Big)_{U,V} + } +\end{aligned}$$ + + + +## References +1. H. Gould, J. Tobochnik, + *Statistical and thermal physics*, 2nd edition, + Princeton. diff --git a/source/know/concept/time-dependent-perturbation-theory/index.md b/source/know/concept/time-dependent-perturbation-theory/index.md new file mode 100644 index 0000000..2b80316 --- /dev/null +++ b/source/know/concept/time-dependent-perturbation-theory/index.md @@ -0,0 +1,202 @@ +--- +title: "Time-dependent perturbation theory" +date: 2021-03-07 +categories: +- Physics +- Quantum mechanics +- Perturbation +layout: "concept" +--- + +In quantum mechanics, **time-dependent perturbation theory** exists to deal +with time-varying perturbations to the Schrödinger equation. +This is in contrast to [time-independent perturbation theory](/know/concept/time-independent-perturbation-theory/), +where the perturbation is stationary. + +Let $\hat{H}_0$ be the base time-independent +Hamiltonian, and $\hat{H}_1$ be a time-varying perturbation, with +"bookkeeping" parameter $\lambda$: + +$$\begin{aligned} + \hat{H}(t) = \hat{H}_0 + \lambda \hat{H}_1(t) +\end{aligned}$$ + +We assume that the unperturbed time-independent problem +$\hat{H}_0 \Ket{n} = E_n \Ket{n}$ has already been solved, such that the +full solution is: + +$$\begin{aligned} + \Ket{\Psi_0(t)} = \sum_{n} c_n \Ket{n} \exp(- i E_n t / \hbar) +\end{aligned}$$ + +Since these $\Ket{n}$ form a complete basis, the perturbed wave function +can be written in the same form, but with time-dependent coefficients $c_n(t)$: + +$$\begin{aligned} + \Ket{\Psi(t)} = \sum_{n} c_n(t) \Ket{n} \exp(- i E_n t / \hbar) +\end{aligned}$$ + +We insert this ansatz in the time-dependent Schrödinger equation, and +reduce it using the known unperturbed time-independent problem: + +$$\begin{aligned} + 0 + &= \hat{H}_0 \Ket{\Psi(t)} + \lambda \hat{H}_1 \Ket{\Psi(t)} - i \hbar \dv{}{t}\Ket{\Psi(t)} + \\ + &= \sum_{n} + \Big( c_n \hat{H}_0 \Ket{n} + \lambda c_n \hat{H}_1 \Ket{n} - c_n E_n \Ket{n} - i \hbar \dv{c_n}{t} \Ket{n} \Big) \exp(- i E_n t / \hbar) + \\ + &= \sum_{n} \Big( \lambda c_n \hat{H}_1 \Ket{n} - i \hbar \dv{c_n}{t} \Ket{n} \Big) \exp(- i E_n t / \hbar) +\end{aligned}$$ + +We then take the inner product with an arbitrary stationary basis state $\Ket{m}$: + +$$\begin{aligned} + 0 + &= \sum_{n} \Big( \lambda c_n \matrixel{m}{\hat{H}_1}{n} - i \hbar \dv{c_n}{t} \Inprod{m}{n} \Big) \exp(- i E_n t / \hbar) +\end{aligned}$$ + +Thanks to orthonormality, this removes the latter term from the summation: + +$$\begin{aligned} + i \hbar \dv{c_m}{t} \exp(- i E_m t / \hbar) + &= \lambda \sum_{n} c_n \matrixel{m}{\hat{H}_1}{n} \exp(- i E_n t / \hbar) +\end{aligned}$$ + +We divide by the left-hand exponential and define +$\omega_{mn} \equiv (E_m - E_n) / \hbar$ to get: + +$$\begin{aligned} + \boxed{ + i \hbar \dv{c_m}{t} + = \lambda \sum_{n} c_n(t) \matrixel{m}{\hat{H}_1(t)}{n} \exp(i \omega_{mn} t) + } +\end{aligned}$$ + +So far, we have not invoked any approximation, +so we can analytically find $c_n(t)$ for some simple systems. +Furthermore, it is useful to write this equation in integral form instead: + +$$\begin{aligned} + c_m(t) + = c_m(0) - \lambda \frac{i}{\hbar} \sum_{n} \int_0^t c_n(\tau) \matrixel{m}{\hat{H}_1(\tau)}{n} \exp(i \omega_{mn} \tau) \dd{\tau} +\end{aligned}$$ + +If this cannot be solved exactly, we must approximate it. We expand +$c_m(t)$ in the usual way, with the initial condition $c_m^{(j)}(0) = 0$ +for $j > 0$: + +$$\begin{aligned} + c_m(t) = c_m^{(0)} + \lambda c_m^{(1)}(t) + \lambda^2 c_m^{(2)}(t) + ... +\end{aligned}$$ + +We then insert this into the integral and collect the non-zero orders of $\lambda$: + +$$\begin{aligned} + c_m^{(1)}(t) + &= - \frac{i}{\hbar} \sum_{n} \int_0^t c_n^{(0)} \matrixel{m}{\hat{H}_1(\tau)}{n} \exp(i \omega_{mn} \tau) \dd{\tau} + \\ + c_m^{(2)}(t) + &= - \frac{i}{\hbar} \sum_{n} + \int_0^t c_n^{(1)}(\tau) \matrixel{m}{\hat{H}_1(\tau)}{n} \exp(i \omega_{mn} \tau) \dd{\tau} + \\ + c_m^{(3)}(t) + &= - \frac{i}{\hbar} \sum_{n} + \int_0^t c_n^{(2)}(\tau) \matrixel{m}{\hat{H}_1(\tau)}{n} \exp(i \omega_{mn} \tau) \dd{\tau} +\end{aligned}$$ + +And so forth. The pattern here is clear: we can calculate the $(j\!+\!1)$th +correction using only our previous result for the $j$th correction. +We cannot go any further than this without considering a specific perturbation $\hat{H}_1(t)$. + + +## Sinusoidal perturbation + +Arguably the most important perturbation +is a sinusoidally-varying potential, which represents +e.g. incoming electromagnetic waves, +or an AC voltage being applied to the system. +In this case, $\hat{H}_1$ has the following form: + +$$\begin{aligned} + \hat{H}_1(\vec{r}, t) + \equiv V(\vec{r}) \sin(\omega t) + = \frac{1}{2 i} V(\vec{r}) \: \big( \exp(i \omega t) - \exp(-i \omega t) \big) +\end{aligned}$$ + +We abbreviate $V_{mn} = \matrixel{m}{V}{n}$, +and take the first-order correction formula: + +$$\begin{aligned} + c_m^{(1)}(t) + &= - \frac{1}{2 \hbar} \sum_{n} V_{mn} c_n^{(0)} + \int_0^t \exp\!\big(i \tau (\omega_{mn} \!+\! \omega)\big) - \exp\!\big(i \tau (\omega_{mn} \!-\! \omega)\big) \dd{\tau} + \\ + &= \frac{i}{2 \hbar} \sum_{n} V_{mn} c_n^{(0)} + \bigg( \frac{\exp\!\big(i t (\omega_{mn} \!+\! \omega) \big) - 1}{\omega_{mn} + \omega} + + \frac{\exp\!\big(i t (\omega_{mn} \!-\! \omega) \big) - 1}{\omega_{mn} - \omega} \bigg) +\end{aligned}$$ + +For simplicity, we let the system start in a known state $\Ket{a}$, +such that $c_n^{(0)} = \delta_{na}$, +and we assume that the driving frequency is close to resonance $\omega \approx \omega_{ma}$, +such that the second term dominates the first, which can then be neglected. +We thus get: + +$$\begin{aligned} + c_m^{(1)}(t) + &= i \frac{V_{ma}}{2 \hbar} \frac{\exp\!\big(i t (\omega_{ma} \!-\! \omega) \big) - 1}{\omega_{ma} - \omega} + \\ + &= i \frac{V_{ma}}{2 \hbar} + \frac{\exp\!\big(i t (\omega_{ma} \!-\! \omega) / 2 \big) - \exp\!\big(\!-\! i t (\omega_{ma} \!-\! \omega) / 2 \big)}{\omega_{ma} - \omega} + \: \exp\!\big(i t (\omega_{ma} \!-\! \omega) / 2 \big) + \\ + &= - \frac{V_{ma}}{\hbar} + \frac{\sin\!\big( t (\omega_{ma} \!-\! \omega) / 2 \big)}{\omega_{ma} - \omega} + \: \exp\!\big(i t (\omega_{ma} \!-\! \omega) / 2 \big) +\end{aligned}$$ + +Taking the norm squared yields the **transition probability**: +the probability that a particle that started in state $\Ket{a}$ +will be found in $\Ket{m}$ at time $t$: + +$$\begin{aligned} + \boxed{ + P_{a \to m} + = |c_m^{(1)}(t)|^2 + = \frac{|V_{ma}|^2}{\hbar^2} \frac{\sin^2\!\big( (\omega_{ma} - \omega) t / 2 \big)}{(\omega_{ma} - \omega)^2} + } +\end{aligned}$$ + +The result would be the same if $\hat{H}_1 \equiv V \cos(\omega t)$. +However, if instead $\hat{H}_1 \equiv V \exp(- i \omega t)$, +the result is larger by a factor of $4$, +which can cause confusion when comparing literature. + +In any case, the probability oscillates as a function of $t$ +with period $T = 2 \pi / (\omega_{ma} \!-\! \omega)$, +so after one period the particle is back in $\Ket{a}$, +and after $T/2$ the particle is in $\Ket{b}$. +See [Rabi oscillation](/know/concept/rabi-oscillation/) +for a more accurate treatment of this "flopping" behaviour. + +However, when regarded as a function of $\omega$, +the probability takes the form of +a sinc-function centred around $(\omega_{ma} \!-\! \omega)$, +so it is highest for transitions with energy $\hbar \omega = E_m \!-\! E_a$. + +Also note that the sinc-distribution becomes narrower over time, +which roughly means that it takes some time +for the system to "notice" that +it is being driven periodically. +In other words, there is some "inertia" to it. + + + +## References +1. D.J. Griffiths, D.F. Schroeter, + *Introduction to quantum mechanics*, 3rd edition, + Cambridge. +2. R. Shankar, + *Principles of quantum mechanics*, 2nd edition, + Springer. diff --git a/source/know/concept/time-independent-perturbation-theory/index.md b/source/know/concept/time-independent-perturbation-theory/index.md new file mode 100644 index 0000000..94aae4e --- /dev/null +++ b/source/know/concept/time-independent-perturbation-theory/index.md @@ -0,0 +1,331 @@ +--- +title: "Time-independent perturbation theory" +date: 2021-02-22 +categories: +- Quantum mechanics +- Perturbation +- Physics +layout: "concept" +--- + +**Time-independent perturbation theory**, also known as +**stationary state perturbation theory**, is a specific application of +perturbation theory to the time-independent Schrödinger +equation in quantum physics, for +Hamiltonians of the following form: + +$$\begin{aligned} + \hat{H} = \hat{H}_0 + \lambda \hat{H}_1 +\end{aligned}$$ + +Where $\hat{H}_0$ is a Hamiltonian for which the time-independent +Schrödinger equation has a known solution, and $\hat{H}_1$ is a small +perturbing Hamiltonian. The eigenenergies $E_n$ and eigenstates +$\Ket{\psi_n}$ of the composite problem are expanded in the +perturbation "bookkeeping" parameter $\lambda$: + +$$\begin{aligned} + \Ket{\psi_n} + &= \ket{\psi_n^{(0)}} + \lambda \ket{\psi_n^{(1)}} + \lambda^2 \ket{\psi_n^{(2)}} + ... + \\ + E_n + &= E_n^{(0)} + \lambda E_n^{(1)} + \lambda^2 E_n^{(2)} + ... +\end{aligned}$$ + +Where $E_n^{(1)}$ and $\ket{\psi_n^{(1)}}$ are called the **first-order +corrections**, and so on for higher orders. We insert this into the +Schrödinger equation: + +$$\begin{aligned} + \hat{H} \Ket{\psi_n} + &= \hat{H}_0 \ket{\psi_n^{(0)}} + + \lambda \big( \hat{H}_1 \ket{\psi_n^{(0)}} + \hat{H}_0 \ket{\psi_n^{(1)}} \big) \\ + &\qquad + \lambda^2 \big( \hat{H}_1 \ket{\psi_n^{(1)}} + \hat{H}_0 \ket{\psi_n^{(2)}} \big) + ... + \\ + E_n \Ket{\psi_n} + &= E_n^{(0)} \ket{\psi_n^{(0)}} + + \lambda \big( E_n^{(1)} \ket{\psi_n^{(0)}} + E_n^{(0)} \ket{\psi_n^{(1)}} \big) \\ + &\qquad + \lambda^2 \big( E_n^{(2)} \ket{\psi_n^{(0)}} + E_n^{(1)} \ket{\psi_n^{(1)}} + E_n^{(0)} \ket{\psi_n^{(2)}} \big) + ... +\end{aligned}$$ + +If we collect the terms according to the order of $\lambda$, we arrive +at the following endless series of equations, of which in practice only +the first three are typically used: + +$$\begin{aligned} + \hat{H}_0 \ket{\psi_n^{(0)}} + &= E_n^{(0)} \ket{\psi_n^{(0)}} + \\ + \hat{H}_1 \ket{\psi_n^{(0)}} + \hat{H}_0 \ket{\psi_n^{(1)}} + &= E_n^{(1)} \ket{\psi_n^{(0)}} + E_n^{(0)} \ket{\psi_n^{(1)}} + \\ + \hat{H}_1 \ket{\psi_n^{(1)}} + \hat{H}_0 \ket{\psi_n^{(2)}} + &= E_n^{(2)} \ket{\psi_n^{(0)}} + E_n^{(1)} \ket{\psi_n^{(1)}} + E_n^{(0)} \ket{\psi_n^{(2)}} + \\ + ... + &= ... +\end{aligned}$$ + +The first equation is the unperturbed problem, which we assume has +already been solved, with eigenvalues $E_n^{(0)} = \varepsilon_n$ and +eigenvectors $\ket{\psi_n^{(0)}} = \Ket{n}$: + +$$\begin{aligned} + \hat{H}_0 \Ket{n} = \varepsilon_n \Ket{n} +\end{aligned}$$ + +The approach to solving the other two equations varies depending on +whether this $\hat{H}_0$ has a degenerate spectrum or not. + + +## Without degeneracy + +We start by assuming that there is no degeneracy, in other words, each +$\varepsilon_n$ corresponds to one $\Ket{n}$. At order $\lambda^1$, we +rewrite the equation as follows: + +$$\begin{aligned} + (\hat{H}_1 - E_n^{(1)}) \Ket{n} + (\hat{H}_0 - \varepsilon_n) \ket{\psi_n^{(1)}} = 0 +\end{aligned}$$ + +Since $\Ket{n}$ form a complete basis, we can express +$\ket{\psi_n^{(1)}}$ in terms of them: + +$$\begin{aligned} + \ket{\psi_n^{(1)}} = \sum_{m \neq n} c_m \Ket{m} +\end{aligned}$$ + +Importantly, $n$ has been removed from the summation to prevent dividing +by zero later. We are allowed to do this, because +$\ket{\psi_n^{(1)}} - c_n \Ket{n}$ also satisfies the order-$\lambda^1$ +equation for any value of $c_n$, as demonstrated here: + +$$\begin{aligned} + (\hat{H}_1 - E_n^{(1)}) \Ket{n} + (\hat{H}_0 - \varepsilon_n) \ket{\psi_n^{(1)}} - (\varepsilon_n - \varepsilon_n) c_n \Ket{n} = 0 +\end{aligned}$$ + +Where we used $\hat{H}_0 \Ket{n} = \varepsilon_n \Ket{n}$. +We insert the series form of $\ket{\psi_n^{(1)}}$ into the $\lambda^1$-equation: + +$$\begin{aligned} + (\hat{H}_1 - E_n^{(1)}) \Ket{n} + \sum_{m \neq n} c_m (\varepsilon_m - \varepsilon_n) \Ket{m} = 0 +\end{aligned}$$ + +We then put an arbitrary basis vector $\Bra{k}$ in front of this +equation to get: + +$$\begin{aligned} + \matrixel{k}{\hat{H}_1}{n} - E_n^{(1)} \Inprod{k}{n} + \sum_{m \neq n} c_m (\varepsilon_m - \varepsilon_n) \Inprod{k}{m} = 0 +\end{aligned}$$ + +Suppose that $k = n$. Since $\Ket{n}$ form an orthonormal basis, we end +up with: + +$$\begin{aligned} + \boxed{ + E_n^{(1)} = \matrixel{n}{\hat{H}_1}{n} + } +\end{aligned}$$ + +In other words, the first-order energy correction $E_n^{(1)}$ is the +expectation value of the perturbation $\hat{H}_1$ for the unperturbed +state $\Ket{n}$. + +Suppose now that $k \neq n$, then only one term of the summation +survives, and we are left with the following equation, which tells us +$c_l$: + +$$\begin{aligned} + \matrixel{k}{\hat{H}_1}{n} + c_k (\varepsilon_k - \varepsilon_n) = 0 +\end{aligned}$$ + +We isolate this result for $c_k$ and insert it into the series form of +$\ket{\psi_n^{(1)}}$ to get the full first-order correction to the wave +function: + +$$\begin{aligned} + \boxed{ + \ket{\psi_n^{(1)}} + = \sum_{m \neq n} \frac{\matrixel{m}{\hat{H}_1}{n}}{\varepsilon_n - \varepsilon_m} \Ket{m} + } +\end{aligned}$$ + +Here it is clear why this is only valid in the non-degenerate case: +otherwise we would divide by zero in the denominator. + +Next, to find the second-order energy correction $E_n^{(2)}$, +we take the corresponding equation and put $\Bra{n}$ in front of it: + +$$\begin{aligned} + \matrixel{n}{\hat{H}_1}{\psi_n^{(1)}} + \matrixel{n}{\hat{H}_0}{\psi_n^{(2)}} + &= E_n^{(2)} \Inprod{n}{n} + E_n^{(1)} \inprod{n}{\psi_n^{(1)}} + \varepsilon_n \inprod{n}{\psi_n^{(2)}} +\end{aligned}$$ + +Because $\hat{H}_0$ is Hermitian, we know that +$\matrixel{n}{\hat{H}_0}{\psi_n^{(2)}} = \varepsilon_n \inprod{n}{\psi_n^{(2)}}$, +i.e. we apply it to the bra, which lets us eliminate two terms. Also, +since $\Ket{n}$ is normalized, we find: + +$$\begin{aligned} + E_n^{(2)} + = \matrixel{n}{\hat{H}_1}{\psi_n^{(1)}} - E_n^{(1)} \inprod{n}{\psi_n^{(1)}} +\end{aligned}$$ + +We explicitly removed the $\Ket{n}$-dependence of $\ket{\psi_n^{(1)}}$, +so the last term is zero. By simply inserting our result for +$\ket{\psi_n^{(1)}}$, we thus arrive at: + +$$\begin{aligned} + \boxed{ + E_n^{(2)} + = \sum_{m \neq n} \frac{\big| \matrixel{m}{\hat{H}_1}{n} \big|^2}{\varepsilon_n - \varepsilon_m} + } +\end{aligned}$$ + +In practice, it is not particulary useful to calculate more corrections. + + +## With degeneracy + +If $\varepsilon_n$ is $D$-fold degenerate, then its eigenstate could be +any vector $\Ket{n, d}$ from the corresponding $D$-dimensional +eigenspace: + +$$\begin{aligned} + \hat{H}_0 \Ket{n} = \varepsilon_n \Ket{n} + \quad \mathrm{where} \quad + \Ket{n} + = \sum_{d = 1}^{D} c_{d} \Ket{n, d} +\end{aligned}$$ + +In general, adding the perturbation $\hat{H}_1$ will *lift* the +degeneracy, meaning the perturbed states will be non-degenerate. In the +limit $\lambda \to 0$, these $D$ perturbed states change into $D$ +orthogonal states which are all valid $\Ket{n}$. + +However, the $\Ket{n}$ that they converge to are not arbitrary: only +certain unperturbed eigenstates are "good" states. Without $\hat{H}_1$, +this distinction is irrelevant, but in the perturbed case it will turn +out to be important. + +For now, we write $\Ket{n, d}$ to refer to any orthonormal set of +vectors in the eigenspace of $\varepsilon_n$ (not necessarily the "good" +ones), and $\Ket{n}$ to denote any linear combination of these. We then +take the equation at order $\lambda^1$ and prepend an arbitrary +eigenspace basis vector $\Bra{n, \delta}$: + +$$\begin{aligned} + \matrixel{n, \delta}{\hat{H}_1}{n} + \matrixel{n, \delta}{\hat{H}_0}{\psi_n^{(1)}} + &= E_n^{(1)} \Inprod{n, \delta}{n} + \varepsilon_n \inprod{n, \delta}{\psi_n^{(1)}} +\end{aligned}$$ + +Since $\hat{H}_0$ is Hermitian, we use the same trick as before to +reduce the problem to: + +$$\begin{aligned} + \matrixel{n, \delta}{\hat{H}_1}{n} + &= E_n^{(1)} \Inprod{n, \delta}{n} +\end{aligned}$$ + +We express $\Ket{n}$ as a linear combination of the eigenbasis vectors +$\Ket{n, d}$ to get: + +$$\begin{aligned} + \sum_{d = 1}^{D} c_d \matrixel{n, \delta}{\hat{H}_1}{n, d} + = E_n^{(1)} \sum_{d = 1}^{D} c_d \Inprod{n, \delta}{n, d} + = c_{\delta} E_n^{(1)} +\end{aligned}$$ + +Let us now interpret the summation terms as matrix elements +$M_{\delta, d}$: + +$$\begin{aligned} + M_{\delta, d} = \matrixel{n, \delta}{\hat{H}_1}{n, d} +\end{aligned}$$ + +By varying the value of $\delta$ from $1$ to $D$, we end up with +equations of the form: + +$$\begin{aligned} + \begin{bmatrix} + M_{1, 1} & \cdots & M_{1, D} \\ + \vdots & \ddots & \vdots \\ + M_{D, 1} & \cdots & M_{D, D} + \end{bmatrix} + \begin{bmatrix} + c_1 \\ \vdots \\ c_D + \end{bmatrix} + = E_n^{(1)} + \begin{bmatrix} + c_1 \\ \vdots \\ c_D + \end{bmatrix} +\end{aligned}$$ + +This is an eigenvalue problem for $E_n^{(1)}$, where $c_d$ are the +components of the eigenvectors which represent the "good" states. +After solving this, let $\Ket{n, g}$ be the resulting "good" states. +Then, as long as $E_n^{(1)}$ is a non-degenerate eigenvalue of $M$: + +$$\begin{aligned} + \boxed{ + E_{n, g}^{(1)} = \matrixel{n, g}{\hat{H}_1}{n, g} + } +\end{aligned}$$ + +Which is the same as in the non-degenerate case! Even better, the +first-order wave function correction is also unchanged: + +$$\begin{aligned} + \boxed{ + \ket{\psi_{n,g}^{(1)}} + = \sum_{m \neq (n, g)} \frac{\matrixel{m}{\hat{H}_1}{n, g}}{\varepsilon_n - \varepsilon_m} \Ket{m} + } +\end{aligned}$$ + +This works because the matrix $M$ is diagonal in the $\Ket{n, g}$-basis, +such that when $\Ket{m}$ is any vector $\Ket{n, \gamma}$ in the +$\Ket{n}$-eigenspace (except for $\Ket{n,g}$, which is +explicitly excluded), then the corresponding numerator +$\matrixel{n, \gamma}{\hat{H}_1}{n, g} = M_{\gamma, g} = 0$, so the term +does not contribute. + +If any of the eigenvalues $E_n^{(1)}$ of $M$ are degenerate, then there +is still information missing about the components $c_d$ of the +"good" states, in which case we must find them some other way. + +Such an alternative way of determining these "good" states is also of +interest even if there is no degeneracy in $M$, since such a shortcut would +allow us to use the formulae from non-degenerate perturbation theory +straight away. + +The trick is to find a Hermitian operator $\hat{L}$ (usually using +symmetries of the system) which commutes with both $\hat{H}_0$ and $\hat{H}_1$: + +$$\begin{aligned} + \comm{\hat{L}}{\hat{H}_0} = \comm{\hat{L}}{\hat{H}_1} = 0 +\end{aligned}$$ + +So that it shares its eigenstates with $\hat{H}_0$ (and $\hat{H}_1$), +meaning all the vectors of the $D$-dimensional +$\Ket{n}$-eigenspace are also eigenvectors of $\hat{L}$. + +The crucial part, however, is that $\hat{L}$ must be chosen such that +$\Ket{n, d_1}$ and $\Ket{n, d_2}$ have distinct eigenvalues +$\ell_1 \neq \ell_2$ for $d_1 \neq d_2$: + +$$\begin{aligned} + \hat{L} \Ket{n, d_1} = \ell_1 \Ket{n, d_1} + \qquad + \hat{L} \Ket{n, d_2} = \ell_2 \Ket{n, d_2} +\end{aligned}$$ + +When this condition holds for any orthogonal choice of $\Ket{n, d_1}$ and +$\Ket{n, d_2}$, then these specific eigenvectors of $\hat{L}$ are the +"good states", for any valid choice of $\hat{L}$. + + + +## References +1. D.J. Griffiths, D.F. Schroeter, + *Introduction to quantum mechanics*, 3rd edition, + Cambridge. diff --git a/source/know/concept/time-ordered-product/index.md b/source/know/concept/time-ordered-product/index.md new file mode 100644 index 0000000..37f47b7 --- /dev/null +++ b/source/know/concept/time-ordered-product/index.md @@ -0,0 +1,118 @@ +--- +title: "Time-ordered product" +date: 2021-09-13 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +In quantum mechanics, especially quantum field theory, +a **time-ordered product** is a product of +explicitly time-dependent operators, +subject to certain ordering constraints. + +Let us start with an unusual motivation. +Suppose that some time-dependent operator $\hat{A}(t)$ is defined like so, +as a product of $N$ time-dependent sub-operators $\hat{a}_n(t)$: + +$$\begin{aligned} + \hat{A}(t) + \equiv \int_0^{t} \hat{a}_1(t_1) \bigg( \int_0^{t_1} \hat{a}_2(t_2) \bigg( \int_0^{t_2} \hat{a}_3(t_3) \bigg( \cdots \bigg) + \dd{t_3} \bigg) \dd{t_2} \bigg) \dd{t_1} +\end{aligned}$$ + +Crucially, the upper limits of the inner integrals +depend on the surrounding variables, +meaning that these integrals cannot simply be reordered. + +An interpretation is that the rightmost $\hat{a}_N(t_N)$ is applied first, +and then $\hat{a}_{N-1}(t_{N-1})$ secondly with $t_{N-1} > t_N$, +and so on. +This suggests there is a form of "time-ordering" here: +the integrals sweep across all relative timings of $\hat{a}_n$, +but preserve the ordering. +Indeed, this could be rewritten as a time-ordered product +(see the [interaction picture](/know/concept/interaction-picture/) for an example). + +A more general and intuitive motivation goes as follows. +Suppose we have a product of $N$ time-dependent operators $\hat{a}_n(t)$, +each representing a certain event. +Clearly, we would want to apply them in chronological order: + +$$\begin{aligned} + \hat{a}_N(t_N) \: \hat{a}_{N-1}(t_{N-1}) \: \cdots \: \hat{a}_2(t_2) \: \hat{a}_1(t_1) + \qquad \mathrm{where} \qquad + t_N > t_{N-1} > ... > \: t_2 > t_1 +\end{aligned}$$ + +But what if the ordering of the arguments $t_N, ..., t_1$ +is not known in advance? +We thus define the **time-ordering meta-operator** $\mathcal{T}$, +which reorders the operators based on the $t$-values +such that they are always in chronological order. +For example: + +$$\begin{aligned} + \mathcal{T} \big\{ \hat{a}_1(t_1) \: \hat{a}_2(t_2) \big\} + \equiv + \begin{cases} + \hat{a}_1(t_1) \: \hat{a}_2(t_2) & \mathrm{if} \; t_2 < t_1 \\ + \hat{a}_2(t_2) \: \hat{a}_1(t_1) & \mathrm{if} \; t_1 < t_2 + \end{cases} +\end{aligned}$$ + +This example suggests a general algorithm for $\mathcal{T}$: +we need to consider every permutation of the operators $\hat{a}_n(t_n)$, +and leave only the single one that satisfies our demands. + +Mathematically, we do this by summing up all permutations, +and multiplying each term with a product of +[Heaviside step functions](/know/concept/heaviside-step-function/) $\Theta$, +which remove the term if the ordering is wrong: + +$$\begin{aligned} + \mathcal{T} \big\{ \hat{a}_1 \cdots \hat{a}_N \big\} + \equiv \sum_{p \in P_N}^{} + \Theta\big(t_{p_1} \!\!-\! t_{p_2}\big) \cdots \Theta\big(t_{p_{N-1}} \!\!-\! t_{p_N}\big) + \: \hat{a}_{p_1}(t_{p_1}) \: \cdots \: \hat{a}_{p_N}(t_{p_N}) +\end{aligned}$$ + +With this, our earlier example for two operators $\hat{a}_1$ and $\hat{a}_2$ +takes the following form: + +$$\begin{aligned} + \mathcal{T} \big\{ \hat{a}_1(t_1) \: \hat{a}_2(t_2) \big\} + = \Theta(t_1 - t_2) \: \hat{a}_1(t_1) \: \hat{a}_2(t_2) + \Theta(t_2 - t_1) \: \hat{a}_2(t_2) \: \hat{a}_1(t_1) +\end{aligned}$$ + +However, we are still missing an important detail: +so far, we have quietly been assuming that the operators are bosonic +(see [second quantization](/know/concept/second-quantization/)). +To include fermionic operators, +we must allow the sign of each term to change, +based on whether the permutation is even or odd: + +$$\begin{aligned} + \mathcal{T} \big\{ \hat{a}_1(t_1) \: \hat{a}_2(t_2) \big\} + = \Theta(t_1 - t_2) \: \hat{a}_1(t_1) \: \hat{a}_2(t_2) \pm \Theta(t_2 - t_1) \: \hat{a}_2(t_2) \: \hat{a}_1(t_1) +\end{aligned}$$ + +Where $\pm$ is $+$ for bosons, and $-$ for fermions in this case. +The general definition of $\mathcal{T}$ is: + +$$\begin{aligned} + \boxed{ + \mathcal{T} \big\{ \hat{a}_1 \cdots \hat{a}_N \big\} + \equiv \sum_{p \in P_N}^{} (\pm 1)^p + \bigg( \prod_{j = 1}^{N-1} \Theta\big(t_{p_j} \!-\! t_{p_{j+1}}\big) \bigg) + \bigg( \prod_{k = 1}^N \hat{a}_{p_k}(t_{p_k}) \bigg) + } +\end{aligned}$$ + + + +## References +1. H. Bruus, K. Flensberg, + *Many-body quantum theory in condensed matter physics*, + 2016, Oxford. diff --git a/source/know/concept/toffoli-gate/and.png b/source/know/concept/toffoli-gate/and.png Binary files differnew file mode 100644 index 0000000..2a25dc8 --- /dev/null +++ b/source/know/concept/toffoli-gate/and.png diff --git a/source/know/concept/toffoli-gate/index.md b/source/know/concept/toffoli-gate/index.md new file mode 100644 index 0000000..590a954 --- /dev/null +++ b/source/know/concept/toffoli-gate/index.md @@ -0,0 +1,94 @@ +--- +title: "Toffoli gate" +date: 2021-04-09 +categories: +- Quantum information +layout: "concept" +--- + +The **Toffoli gate** or **controlled-controlled-NOT (CCNOT) gate** +is a logic gate that is *reversible* (no information is lost) +and *universal* (all reversible logic circuits can be built using Toffoli gates). + +It takes three input bits $A$, $B$ and $C$, +of which it returns $A$ and $B$ unchanged, +and flips $C$ if both $A$ and $B$ are true. +In circuit diagrams, its representation is: + +<a href="toffoli.png"> +<img src="toffoli.png" style="width:19%"> +</a> + +This gate is reversible, because $A$ and $B$ are preserved, +and are all you need to reconstruct to $C$. +Moreover, this gate is universal, +because we can make a NAND gate from it: + +<a href="nand.png"> +<img src="nand.png" style="width:38%"> +</a> + +A NAND is enough to implement every conceivable circuit. +That said, we can efficiently implement NOT, AND, and XOR using a single Toffoli gate too. +Note that NOT is a special case of NAND: + +<a href="not.png"> +<img src="not.png" style="width:32%"> +</a> + +<a href="and.png"> +<img src="and.png" style="width:35%"> +</a> + +<a href="xor.png"> +<img src="xor.png" style="width:35%"> +</a> + +Using these, we can, as an example, make an OR gate +from three Toffoli gates, +thanks to the fact that $A \lor B = \neg (\neg A \land \neg B)$, +i.e. OR is NAND of NOT $A$ and NOT $B$: + +<a href="or.png"> +<img src="or.png" style="width:50%"> +</a> + +Thanks to its reversibility and universality, +the Toffoli gate is interesting for quantum computing. +Its [quantum gate](/know/concept/quantum-gate/) form is often called **CCNOT**. +In the basis $\Ket{A} \Ket{B} \Ket{C}$, its matrix is: + +$$\begin{aligned} + \boxed{ + \mathrm{CCNOT} = + \begin{bmatrix} + 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 + \end{bmatrix} + } +\end{aligned}$$ + +If we apply this gate to an arbitrary three-qubit state $\Ket{\psi}$, +it swaps the last two coefficients: + +$$\begin{aligned} + \mathrm{CCNOT} \Ket{\psi} + &= \mathrm{CCNOT} \big( c_{000} \Ket{000} + c_{001} \Ket{001} + c_{010} \Ket{010} + c_{011} \Ket{011} \\ + &\qquad\qquad\quad\:\; c_{100} \Ket{100} + c_{101} \Ket{101} + c_{110} \Ket{110} + c_{111} \Ket{111} \big) + \\ + &= c_{000} \Ket{000} + c_{001} \Ket{001} + c_{010} \Ket{010} + c_{011} \Ket{011} \\ + &\quad\,\, c_{100} \Ket{100} + c_{101} \Ket{101} + c_{111} \Ket{110} + c_{110} \Ket{111} +\end{aligned}$$ + + + +## References +1. J.S. Neergaard-Nielsen, + *Quantum information: lectures notes*, + 2021, unpublished. diff --git a/source/know/concept/toffoli-gate/nand.png b/source/know/concept/toffoli-gate/nand.png Binary files differnew file mode 100644 index 0000000..e9a10ca --- /dev/null +++ b/source/know/concept/toffoli-gate/nand.png diff --git a/source/know/concept/toffoli-gate/not.png b/source/know/concept/toffoli-gate/not.png Binary files differnew file mode 100644 index 0000000..5e33f3f --- /dev/null +++ b/source/know/concept/toffoli-gate/not.png diff --git a/source/know/concept/toffoli-gate/or.png b/source/know/concept/toffoli-gate/or.png Binary files differnew file mode 100644 index 0000000..147fc00 --- /dev/null +++ b/source/know/concept/toffoli-gate/or.png diff --git a/source/know/concept/toffoli-gate/toffoli.png b/source/know/concept/toffoli-gate/toffoli.png Binary files differnew file mode 100644 index 0000000..c9ba923 --- /dev/null +++ b/source/know/concept/toffoli-gate/toffoli.png diff --git a/source/know/concept/toffoli-gate/xor.png b/source/know/concept/toffoli-gate/xor.png Binary files differnew file mode 100644 index 0000000..8295466 --- /dev/null +++ b/source/know/concept/toffoli-gate/xor.png diff --git a/source/know/concept/two-fluid-equations/index.md b/source/know/concept/two-fluid-equations/index.md new file mode 100644 index 0000000..b9f1e94 --- /dev/null +++ b/source/know/concept/two-fluid-equations/index.md @@ -0,0 +1,273 @@ +--- +title: "Two-fluid equations" +date: 2021-10-19 +categories: +- Physics +- Plasma physics +layout: "concept" +--- + +The **two-fluid model** describes a plasma as two separate but overlapping fluids, +one for ions and one for electrons. +Instead of tracking individual particles, +it gives the dynamics of fluid elements $\dd{V}$ (i.e. small "blobs"). +These blobs are assumed to be much larger than +the [Debye length](/know/concept/debye-length/), +such that electromagnetic interactions between nearby blobs can be ignored. + +From Newton's second law, we know that the velocity $\vb{v}$ +of a particle with mass $m$ and charge $q$ is as follows, +when subjected only to the [Lorentz force](/know/concept/lorentz-force/): + +$$\begin{aligned} + m \dv{\vb{v}}{t} + = q (\vb{E} + \vb{v} \cross \vb{B}) +\end{aligned}$$ + +From here, the derivation is similar to that of the +[Navier-Stokes equations](/know/concept/navier-stokes-equations/). +We replace $\idv{}{t}$ with a +[material derivative](/know/concept/material-derivative/) $\mathrm{D}/\mathrm{D}t$, +and define $\vb{u}$ as the blob's center-of-mass velocity: + +$$\begin{aligned} + m n \frac{\mathrm{D} \vb{u}}{\mathrm{D} t} + = q n (\vb{E} + \vb{u} \cross \vb{B}) +\end{aligned}$$ + +Where we have multiplied by the number density $n$ of the particles. +Due to particle collisions in the fluid, +stresses become important. Therefore, we include +the [Cauchy stress tensor](/know/concept/cauchy-stress-tensor/) $\hat{P}$, +leading to the following two equations: + +$$\begin{aligned} + m_i n_i \frac{\mathrm{D} \vb{u}_i}{\mathrm{D} t} + &= q_i n_i (\vb{E} + \vb{u}_i \cross \vb{B}) + \nabla \cdot \hat{P}_i{}^\top + \\ + m_e n_e \frac{\mathrm{D} \vb{u}_e}{\mathrm{D} t} + &= q_e n_e (\vb{E} + \vb{u}_e \cross \vb{B}) + \nabla \cdot \hat{P}_e{}^\top +\end{aligned}$$ + +Where the subscripts $i$ and $e$ refer to ions and electrons, respectively. +Finally, we also account for momentum transfer between ions and electrons +due to [Rutherford scattering](/know/concept/rutherford-scattering/), +leading to these **two-fluid momentum equations**: + +$$\begin{aligned} + \boxed{ + \begin{aligned} + m_i n_i \frac{\mathrm{D} \vb{u}_i}{\mathrm{D} t} + &= q_i n_i (\vb{E} + \vb{u}_i \cross \vb{B}) + \nabla \cdot \hat{P}_i{}^\top - f_{ie} m_i n_i (\vb{u}_i - \vb{u}_e) + \\ + m_e n_e \frac{\mathrm{D} \vb{u}_e}{\mathrm{D} t} + &= q_e n_e (\vb{E} + \vb{u}_e \cross \vb{B}) + \nabla \cdot \hat{P}_e{}^\top - f_{ei} m_e n_e (\vb{u}_e - \vb{u}_i) + \end{aligned} + } +\end{aligned}$$ + +Where $f_{ie}$ is the mean frequency at which an ion collides with electrons, +and vice versa for $f_{ei}$. +For simplicity, we assume that the plasma is isotropic +and that shear stresses are negligible, +in which case the stress term can be replaced +by the gradient $- \nabla p$ of a scalar pressure $p$: + +$$\begin{aligned} + m_i n_i \frac{\mathrm{D} \vb{u}_i}{\mathrm{D} t} + &= q_i n_i (\vb{E} + \vb{u}_i \cross \vb{B}) - \nabla p_i - f_{ie} m_i n_i (\vb{u}_i - \vb{u}_e) + \\ + m_e n_e \frac{\mathrm{D} \vb{u}_e}{\mathrm{D} t} + &= q_e n_e (\vb{E} + \vb{u}_e \cross \vb{B}) - \nabla p_e - f_{ei} m_e n_e (\vb{u}_e - \vb{u}_i) +\end{aligned}$$ + +Next, we demand that matter is conserved. +In other words, the rate at which particles enter/leave a volume $V$ +must be equal to the flux through the enclosing surface $S$: + +$$\begin{aligned} + 0 + &= \pdv{}{t}\int_V n \dd{V} + \oint_S n \vb{u} \cdot \dd{\vb{S}} + = \int_V \Big( \pdv{n}{t} + \nabla \cdot (n \vb{u}) \Big) \dd{V} +\end{aligned}$$ + +Where we have used the divergence theorem. +Since $V$ is arbitrary, we can remove the integrals, +leading to the following **continuity equations**: + +$$\begin{aligned} + \boxed{ + \pdv{n_i}{t} + \nabla \cdot (n_i \vb{u}_i) + = 0 + \qquad \quad + \pdv{n_e}{t} + \nabla \cdot (n_e \vb{u}_e) + = 0 + } +\end{aligned}$$ + +These are 8 equations (2 scalar continuity, 2 vector momentum), +but 16 unknowns $\vb{u}_i$, $\vb{u}_e$, $\vb{E}$, $\vb{B}$, $n_i$, $n_e$, $p_i$ and $p_e$. +We would like to close this system, so we need 8 more. +An obvious choice is [Maxwell's equations](/know/concept/maxwells-equations/), +in particular Faraday's and Ampère's law +(since Gauss' laws are redundant; see the article on Maxwell's equations): + +$$\begin{aligned} + \boxed{ + \nabla \cross \vb{E} = - \pdv{\vb{B}}{t} + \qquad \quad + \nabla \cross \vb{B} = \mu_0 \Big( n_i q_i \vb{u}_i + n_e q_e \vb{u}_e + \varepsilon_0 \pdv{\vb{E}}{t} \Big) + } +\end{aligned}$$ + +Now we have 14 equations, so we need 2 more, for the pressures $p_i$ and $p_e$. +This turns out to be the thermodynamic **equation of state**: +for quasistatic, reversible, adiabatic compression +of a gas with constant heat capacity (i.e. a *calorically perfect* gas), +it turns out that: + +$$\begin{aligned} + \frac{\mathrm{D}}{\mathrm{D} t} \big( p V^\gamma \big) = 0 + \qquad \quad + \gamma + \equiv \frac{C_P}{C_V} + = \frac{N + 2}{N} +\end{aligned}$$ + +Where $\gamma$ is the *heat capacity ratio*, +and can be calculated from the number of degrees of freedom $N$ +of each particle in the gas. +In a fully ionized plasma, $N = 3$. + +The density $n \propto 1/V$, +so since $p V^\gamma$ is constant in time, +for some constant $C$: + +$$\begin{aligned} + \frac{\mathrm{D}}{\mathrm{D} t} \Big( \frac{p}{n^\gamma} \Big) = 0 + \quad \implies \quad + p = C n^\gamma +\end{aligned}$$ + +In the two-fluid model, we thus have the following two equations of state, +giving us a set of 16 equations for 16 unknowns: + +$$\begin{aligned} + \boxed{ + \frac{\mathrm{D}}{\mathrm{D} t} \Big( \frac{p_i}{n_i^\gamma} \Big) + = 0 + \qquad \quad + \frac{\mathrm{D}}{\mathrm{D} t} \Big( \frac{p_e}{n_e^\gamma} \Big) + = 0 + } +\end{aligned}$$ + +Note that from the relation $p = C n^\gamma$, +we can calculate the $\nabla p$ term in the momentum equation, +using simple differentiation and the ideal gas law: + +$$\begin{aligned} + p = C n^\gamma + \quad \implies \quad + \nabla p + = \gamma \frac{C n^{\gamma}}{n} \nabla n + = \gamma p \frac{\nabla n}{n} + = \gamma k_B T \nabla n +\end{aligned}$$ + +Note that the ideal gas law was not used immediately, +to allow for $\gamma \neq 1$. + + +## Fluid drifts + +The momentum equations reduce to the following +if we assume the flow is steady $\ipdv{\vb{u}}{t} = 0$, +and neglect electron-ion momentum transfer on the right: + +$$\begin{aligned} + m_i n_i (\vb{u}_i \cdot \nabla) \vb{u}_i + &\approx q_i n_i (\vb{E} + \vb{u}_i \cross \vb{B}) - \nabla p_i + \\ + m_e n_e (\vb{u}_e \cdot \nabla) \vb{u}_e + &\approx q_e n_e (\vb{E} + \vb{u}_e \cross \vb{B}) - \nabla p_e +\end{aligned}$$ + +We take the cross product with $\vb{B}$, +which leaves only the component $\vb{u}_\perp$ of $\vb{u}$ +perpendicular to $\vb{B}$ in the Lorentz term: + +$$\begin{aligned} + 0 + &= q n (\vb{E} + \vb{u}_\perp \cross \vb{B}) \cross \vb{B} - \nabla p \cross \vb{B} - m n \big( (\vb{u} \cdot \nabla) \vb{u} \big) \cross \vb{B} + \\ + &= q n (\vb{E} \cross \vb{B} - \vb{u}_\perp B^2) - \nabla p \cross \vb{B} - m n \big( (\vb{u} \cdot \nabla) \vb{u} \big) \cross \vb{B} +\end{aligned}$$ + +Isolating for $\vb{u}_\perp$ tells us +that the fluids drifts perpendicularly to $\vb{B}$, +with velocity $\vb{u}_\perp$: + +$$\begin{aligned} + \vb{u}_\perp + = \frac{\vb{E} \cross \vb{B}}{B^2} - \frac{\nabla p \cross \vb{B}}{q n B^2} + - \frac{m \big( (\vb{u} \cdot \nabla) \vb{u} \big) \cross \vb{B}}{q B^2} +\end{aligned}$$ + +The last term is often neglected, +which turns out to be a valid approximation if $\vb{E} = 0$, +or if $\vb{E}$ is parallel to $\nabla p$. +The first term is the familiar $\vb{E} \cross \vb{B}$ drift $\vb{v}_E$ +from [guiding center theory](/know/concept/guiding-center-theory/), +and the second term is called the **diamagnetic drift** $\vb{v}_D$: + +$$\begin{aligned} + \boxed{ + \vb{v}_E + = \frac{\vb{E} \cross \vb{B}}{B^2} + } + \qquad \quad + \boxed{ + \vb{v}_D + = - \frac{\nabla p \cross \vb{B}}{q n B^2} + } +\end{aligned}$$ + +It is called *diamagnetic* because +it creates a current that induces +a magnetic field opposite to the original $\vb{B}$. +In a quasi-neutral plasma $q_e n_e = - q_i n_i$, +the current density $\vb{J}$ is given by: + +$$\begin{aligned} + \vb{J} + = q_e n_e (\vb{v}_{De} - \vb{v}_{Di}) + = q_e n_e \Big( \frac{\nabla p_i \cross \vb{B}}{q_i n_i B^2} - \frac{\nabla p_e \cross \vb{B}}{q_e n_e B^2} \Big) + = \frac{\vb{B} \cross \nabla (p_i + p_e)}{B^2} +\end{aligned}$$ + +Using the ideal gas law $p = k_B T n$, +this can be rewritten as follows: + +$$\begin{aligned} + \vb{J} + = k_B \frac{\vb{B} \cross \nabla (T_i n_i + T_e n_e)}{B^2} +\end{aligned}$$ + +Curiously, $\vb{v}_D$ does not involve any net movement of particles, +because a pressure gradient does not necessarily cause particles to move. +Instead, there is a higher density of gyration paths +in the high-pressure region, +so that the particle flux through a reference plane is higher. +This causes the fluid elements to drift, +but not the guiding centers. + + + +## References +1. F.F. Chen, + *Introduction to plasma physics and controlled fusion*, + 3rd edition, Springer. +2. M. Salewski, A.H. Nielsen, + *Plasma physics: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/viscosity/index.md b/source/know/concept/viscosity/index.md new file mode 100644 index 0000000..026fc8f --- /dev/null +++ b/source/know/concept/viscosity/index.md @@ -0,0 +1,94 @@ +--- +title: "Viscosity" +date: 2021-04-12 +categories: +- Physics +- Fluid mechanics +- Fluid dynamics +layout: "concept" +--- + +The **viscosity** of a fluid describes how +"sticky" its constituent molecules are; +when one part of the fluid moves, it "drags" +neighbouring parts by an amount proportional to the viscosity. + +Imagine a liquid in a canal, +flowing in the $x$-direction at a velocity $v(z)$ +as a function of depth $z$. +Due to the liquid's viscosity, +its molecules are "stuck" to the bottom of the canal $z = 0$, +such that it is stationary there $v(0) = 0$. +However, at the surface $z = z_s$, there is a flow at $v(z_s) = v_s$. + +This difference in $v$ means that there is a velocity gradient across $z$. +Each infinitesimal layer of the liquid +is dragging on the layers above and below it, +meaning there is a nonzero shear stress $\sigma_{xz}$ +(see [Cauchy stress tensor](/know/concept/cauchy-stress-tensor/)). +Formally, the **dynamic viscosity** $\eta$ is defined as follows: + +$$\begin{aligned} + \boxed{ + \sigma_{xz} + = \eta \dv{v}{z} + } +\end{aligned}$$ + +This is **Newton's law of viscosity**, +and fluids obeying it are known as **Newtonian**. +In a Newtonian fluid *at rest*, there are no such shear stresses, +and the Cauchy stress tensor $\hat{\sigma}$ is diagonal: + +$$\begin{aligned} + \sigma_{ij} = - p \delta_{ij} +\end{aligned}$$ + +Where $p$ is the pressure, and $\delta_{ij}$ is the Kronecker delta. +If the fluid flows according to a velocity field $\va{v}$, +then a more general definition of $\eta$ is as follows, +in index notation with $\nabla_i \!=\! \ipdv{}{x_i}$: + +$$\begin{aligned} + \boxed{ + \sigma_{ij} + = - p \delta_{ij} + \eta (\nabla_i v_j + \nabla_j v_i) + } +\end{aligned}$$ + +The double term $\nabla_i v_j + \nabla_j v_i$ comes from the fact that +the stress tensor of a Newtonian fluid is always symmetric; +this definition of $\sigma_{ij}$ enforces that. + +Another quantity is the **kinematic viscosity** $\nu$, +which is simply $\eta$ divided by the density $\rho$: + +$$\begin{aligned} + \boxed{ + \nu + \equiv \frac{\eta}{\rho} + } +\end{aligned}$$ + +With this, Newton's law of viscosity is written +using the momentum density $P = \rho v$: + +$$\begin{aligned} + \sigma_{xz} + = \nu \dv{P}{z} +\end{aligned}$$ + +Because momentum is "more fundamental" than velocity, +is $\nu$ often more useful than $\eta$. +However, this comes at the cost of our intuition: +for example, as you would expect, $\eta_\mathrm{water} > \eta_\mathrm{air}$, +but you may be surprised that $\nu_\mathrm{water} < \nu_\mathrm{air}$. +Since air is less dense, it is easier to set in motion, +hence we expect it to be less viscous than water, +but in fact air's molecules are stickier than water's. + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/von-neumann-extractor/index.md b/source/know/concept/von-neumann-extractor/index.md new file mode 100644 index 0000000..5cc13a6 --- /dev/null +++ b/source/know/concept/von-neumann-extractor/index.md @@ -0,0 +1,79 @@ +--- +title: "Von Neumann extractor" +date: 2021-04-09 +categories: +- Cryptography +layout: "concept" +--- + +The **Von Neumann extractor** is a simple example of a **randomness extractor**: +given a stream of "imperfectly random" bits, +it extracts the entropy, and outputs a "perfectly random" stream. + +As input, the Von Neumann extractor expects +a stream of independent (uncorrelated) bits, +i.e. the result of a [Bernoulli process](/know/concept/binomial-distribution/), +where each bit is $0$ with probability $p$, +and $1$ with probability $1 \!-\! p$. +Crucially, $p$ does not need to be $1/2$; +there may be a bias. + +The extractor will output a uniformly random stream with $p = 1/2$. +Given input bits $a_1, a_2, ...$, it achieves this +by looking at the bits in pairs $(a_1, a_2)$, $(a_3, a_4)$, etc. +Then: + ++ If $a_n = a_{n+1}$, it discards both bits. ++ If $a_n \neq a_{n+1}$, it keeps the first bit $a_n$, and discards $a_{n+1}$. + +Evidently, the first case $a_n = a_{n+1}$ occurs with the following probabilities: + +$$\begin{aligned} + P(0, 0) + = p^2 + \qquad \qquad + P(1, 1) + = (1 - p)^2 +\end{aligned}$$ + +Meanwhile, the second case $a_n \neq a_{n+1}$ occurs with probabilities given by: + +$$\begin{aligned} + P(0, 1) + = p (p - 1) + \qquad \qquad + P(1, 0) + = (p - 1) p +\end{aligned}$$ + +Crucially, they are equal; $P(0, 1) = P(1, 0)$. +Therefore, if the extractor encounters an input pair satisfying $a_n \neq a_{n+1}$, +the first bit $a_n$ is $0$ or $1$ with a 50-50 probability, +regardless of $p$. +Since the extractor only keeps those bits, +its output is guaranteed to be "perfectly random". + +Clearly, because it discards many of the bits, +the output stream will have a length $N_\mathrm{out} < N_\mathrm{in}$. +The exact value of $N_\mathrm{out}$ is as follows, +where $P(0, 1) + P(1, 0)$ is the probability that we keep a bit, +and the factor $1/2$ is due to us discarding half of the pair even in that case: + +$$\begin{aligned} + N_\mathrm{out} + = \frac{1}{2} N_\mathrm{in} \Big( P(0, 1) + P(1, 0) \Big) + = \frac{1}{2} N_\mathrm{in} \Big( 2 p (p - 1) \Big) + = N_\mathrm{in} p (p - 1) +\end{aligned}$$ + +The key assumption that allows the Von Neumann extractor to work +is that there is no correlation at all between the bits. +In practice, this may be difficult to achieve, +in which case a more complex randomness extraction scheme is needed. + + + +## References +1. J.B. Brask, + *Quantum information: lecture notes*, + 2021, unpublished. diff --git a/source/know/concept/vorticity/index.md b/source/know/concept/vorticity/index.md new file mode 100644 index 0000000..518025c --- /dev/null +++ b/source/know/concept/vorticity/index.md @@ -0,0 +1,159 @@ +--- +title: "Vorticity" +date: 2021-04-03 +categories: +- Physics +- Fluid mechanics +- Fluid dynamics +layout: "concept" +--- + +In fluid mechanics, the **vorticity** $\va{\omega}$ +is a measure of the local circulation in a fluid. +It is defined as the curl of the flow velocity field $\va{v}$: + +$$\begin{aligned} + \boxed{ + \va{\omega} + \equiv \nabla \cross \va{v} + } +\end{aligned}$$ + +Just as curves tangent to $\va{v}$ are called *streamlines*, +curves tangent to $\va{\omega}$ are **vortex lines**, +which are to be interpreted as the "axes" that $\va{v}$ is circulating around. + +The vorticity is a local quantity, +and the corresponding global quantity is the **circulation** $\Gamma$, +which is defined as the projection of $\va{v}$ onto a close curve $C$. +Then, by Stokes' theorem: + +$$\begin{aligned} + \boxed{ + \Gamma(C, t) + \equiv \oint_C \va{v} \cdot \dd{\va{l}} + = \int_S \va{\omega} \cdot \dd{\va{S}} + } +\end{aligned}$$ + + +## Ideal fluids + +For an inviscid, incompressible fluid, +consider the *Bernoulli field* $H$, which is defined as: + +$$\begin{aligned} + H + \equiv \frac{1}{2} \va{v}^2 + \Phi + \frac{p}{\rho} +\end{aligned}$$ + +Where $\Phi$ is the gravitational potential, +$p$ is the pressure, and $\rho$ is the (constant) density. +We then take the gradient of this scalar field: + +$$\begin{aligned} + \nabla H + &= \frac{1}{2} \nabla \va{v}^2 + \nabla \Phi + \frac{\nabla p}{\rho} + \\ + &= \va{v} \cdot (\nabla \va{v}) - \Big( \!-\! \nabla \Phi - \frac{\nabla p}{\rho} \Big) +\end{aligned}$$ + +Since $-\nabla \Phi = \va{g}$, +the rightmost term is the right-hand side of +the [Euler equation](/know/concept/euler-equations/). +We substitute the other side of said equation, yielding: + +$$\begin{aligned} + \nabla H + &= \va{v} \cdot (\nabla \va{v}) - \frac{\mathrm{D} \va{v}}{\mathrm{D} t} + = \va{v} \cdot (\nabla \va{v}) - \pdv{\va{v}}{t} - (\va{v} \cdot \nabla) \va{v} +\end{aligned}$$ + +We isolate this equation for $\ipdv{\va{v}}{t}$, +and apply a vector identity to reduce it to the following: + +$$\begin{aligned} + \pdv{\va{v}}{t} + = \va{v} \cdot (\nabla \va{v}) - (\va{v} \cdot \nabla) \va{v} - \nabla H + = \va{v} \cross (\nabla \cross \va{v}) - \nabla H +\end{aligned}$$ + +Here, the definition of the vorticity $\va{\omega}$ is clear to see, +leading us to an equation of motion for $\va{v}$: + +$$\begin{aligned} + \boxed{ + \pdv{\va{v}}{t} + = \va{v} \cross \va{\omega} - \nabla H + } +\end{aligned}$$ + +More about this later. +Now, we take the curl of both sides of this equation, giving us: + +$$\begin{aligned} + \nabla \cross \pdv{\va{v}}{t} + = \nabla \cross (\va{v} \cross \va{\omega}) - \nabla \cross (\nabla H) +\end{aligned}$$ + +On the left, we swap $\nabla$ with $\ipdv{}{t}$, +and on the right, the curl of a gradient is always zero. +We are thus left with the equation of motion of the vorticity $\va{\omega}$: + +$$\begin{aligned} + \boxed{ + \pdv{\va{\omega}}{t} + = \nabla \cross (\va{v} \cross \va{\omega}) + } +\end{aligned}$$ + +Let us now return to the equation of motion for $\va{v}$. +For *steady* flows where $\ipdv{\va{v}}{t} = 0$, in which case +[Bernoulli's theorem](/know/concept/bernoullis-theorem/) applies, +it reduces to: + +$$\begin{aligned} + \nabla H + = \va{v} \cross \va{\omega} +\end{aligned}$$ + +If a fluid has $\va{\omega} = 0$ in some regions, it is known as **irrotational**. +From this equation, we see that, in that case, $\nabla H = 0$, +meaning that $H$ is a constant in those regions, +a fact sometimes referred to as **Bernoulli's stronger theorem**. + +Furthermore, irrotationality $\va{\omega} = 0$ +implies that $\va{v}$ is the gradient of a potential $\Psi$: + +$$\begin{aligned} + \va{v} + = \nabla \Psi +\end{aligned}$$ + +This fact allows us to rewrite the Euler equations in a particularly simple way. +Firstly, the condition of incompressibility becomes the well-known Laplace equation: + +$$\begin{aligned} + 0 + = \nabla \cdot \va{v} + = \nabla^2 \Psi +\end{aligned}$$ + +And second, the main equation of motion for $\va{v}$ states +that the quantity $H + \ipdv{\Psi}{t}$ is spatially constant +in the irrotational region: + +$$\begin{aligned} + \pdv{\va{v}}{t} + = \nabla \pdv{\Psi}{t} + = - \nabla H + \quad \implies \quad + \nabla \Big( H + \pdv{\Psi}{t} \Big) + = 0 +\end{aligned}$$ + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/wetting/index.md b/source/know/concept/wetting/index.md new file mode 100644 index 0000000..61f31ad --- /dev/null +++ b/source/know/concept/wetting/index.md @@ -0,0 +1,127 @@ +--- +title: "Wetting" +date: 2021-03-29 +categories: +- Physics +- Fluid mechanics +- Fluid statics +- Surface tension +layout: "concept" +--- + +In fluid statics, **wetting** is the ability +of a given liquid to touch a given surface. +When a droplet of the liquid is placed on the surface, +the **wettability** determines the contact angle $\theta$. + +If $\theta = 0$, we have **perfect** or **complete wetting**: +the droplet spreads out over the entire surface. +The other extreme is **dewetting** or **non-wetting**, +where $\theta = \pi$, such that the droplet "floats" on the surface, +which in the specific case of water is called **hydrophobia**. +Furthermore, $\theta < \pi/2$ is **high wettability**, +and $\pi/2 < \theta < \pi$ is **low wettability**. + +For a perfectly smooth homogeneous surface, +$\theta$ is determined by +the [Young-Dupré relation](/know/concept/young-dupre-relation/): + +$$\begin{aligned} + \alpha_{sg} - \alpha_{sl} + = \alpha_{gl} \cos\theta +\end{aligned}$$ + +In practice, however, surfaces can be rough and/or inhomogeneous. +We start with the former. + +A rough surface has some structure, which may contain "gaps". +There are two options: +either the droplet fills those gaps (a **Wenzel state**), +or it floats over them (a **Cassie-Baxter state**). + +For a Wenzel state, we define the **roughness ratio** $r$ +as the relative increase of the surface's area due to its rough structure, +where $A_{real}$ and $A_{app}$ are the real and apparent areas: + +$$\begin{aligned} + r = \frac{A_{real}}{A_{app}} +\end{aligned}$$ + +The net energy cost $E$ of spreading the droplet over the surface is then given by: + +$$\begin{aligned} + E_{sl} + &= (\alpha_{sg} - \alpha_{sl}) A_{real} + = \alpha_{gl} A_{real} \cos\theta + \\ + &= \alpha_{gl} A_{app} r \cos\theta + = \alpha_{gl} A_{app} \cos\theta^* +\end{aligned}$$ + +Where we have defined the **apparent contact angle** $\theta^*$ +as the correction to $\theta$ to account for the roughness. +It is expressed as follows: + +$$\begin{aligned} + \boxed{ + \cos\theta^* + = r \cos\theta + } +\end{aligned}$$ + +For Cassie-Baxter states, where the gaps remain air-filled, +we define $f$ as the "non-gap" fraction of the apparent surface, such that: + +$$\begin{aligned} + E + &= A_{app} \big( f (\alpha_{sg} - \alpha_{sl}) - (1 - f) \alpha_{gl} \big) + \\ + &= A_{app} \alpha_{gl} \big( f \cos\theta + f - 1 \big) +\end{aligned}$$ + +Note the signs: for the solid-liquid interface, +we "spend" $\alpha_{sg}$ and "get back" $\alpha_{sl}$, +while for the gas-liquid interface, we spend nothing, +but get $\alpha_{gl}$. +The apparent angle $\theta^*$ is therefore: + +$$\begin{aligned} + \boxed{ + \cos\theta^* + = f (\cos\theta + 1) - 1 + } +\end{aligned}$$ + +We generalize this equation to inhomogeneous surfaces +consisting of two materials with contact angles $\theta_1$ and $\theta_2$. +The energy cost of the interface is then given by: + +$$\begin{aligned} + E + &= A \big( f_1 (\alpha_{s1g} - \alpha_{s1l}) + (1 - f_1) (\alpha_{s2g} - \alpha_{s2l}) \big) + \\ + &= A \alpha_{gl} \big( f_1 \cos\theta_1 + (1 - f_1) \cos\theta_2 \big) +\end{aligned}$$ + +Such that $\theta^*$ for an inhomogeneous surface is given by this equation, +called **Cassie's law**: + +$$\begin{aligned} + \boxed{ + \cos\theta^* + = f_1 \cos\theta_1 + (1 - f_1) \cos\theta_2 + } +\end{aligned}$$ + +Note that the materials need not be solids, +for example, if one is air, we recover the previous case for rough surfaces. +Cassie's law can also easily be generalized to three or more materials, +and to include Wenzel-style roughness ratios $r_1$, $r_2$, etc. + + + +## References +1. T. Bohr, + *Continuum physics: lecture notes*, 2021, + unpublished. + diff --git a/source/know/concept/wicks-theorem/index.md b/source/know/concept/wicks-theorem/index.md new file mode 100644 index 0000000..f1a7357 --- /dev/null +++ b/source/know/concept/wicks-theorem/index.md @@ -0,0 +1,188 @@ +--- +title: "Wick's theorem" +date: 2021-05-29 +categories: +- Physics +- Quantum mechanics +layout: "concept" +--- + +In the [second quantization](/know/concept/second-quantization/) formalism, +**Wick's theorem** helps to evaluate products +of creation and annihilation operators by +breaking them down into smaller products. + +Firstly, let us define the **normal product** or **normal order** as +a product of second quantization operators +reordered such that +all creation operators are on the left of +all annihilation operators. +For two operators this is written as follows, +at least in the case of bosons: + +$$\begin{aligned} + \underline{\hat{b}_\alpha \hat{b}_\beta^\dagger} + \equiv \hat{b}_\beta^\dagger \hat{b}_\alpha +\end{aligned}$$ + +For fermions, the result must be negated for each swapping of adjacent operators +(and every reordering of operators can be treated as a sequence of such swaps): + +$$\begin{aligned} + \underline{\hat{f}_\alpha \hat{f}_\beta^\dagger} + \equiv - \hat{f}_\beta^\dagger \hat{f}_\alpha +\end{aligned}$$ + +The normal product of three or more operators works in the same way, +but might not be unique depending, +on how many of each type there are. + +Next, the **contraction** of the operators $A$ and $B$ +is defined as the vacuum matrix element, +i.e. the expectation value of $\Ket{0}$: + +$$\begin{aligned} + \Expval{A B}_0 + \equiv \matrixel{0}{A B}{0} +\end{aligned}$$ + +Unsurprisingly, a contraction can only be nonzero if +$A = \hat{c}_\alpha$ is an annihilation and $B = \hat{c}_\alpha^\dagger$ +a creation for the same state $\alpha$. + +Wick's theorem states: +**any product of second quantization operators can be +rewritten as a sum of normal products, +from which 0, 1, 2, etc. contractions have been removed +in every possible way.** +For fermions, the sign of a term must also be swapped +every time two adjacent operators are swapped. +As an example, for four operators: + +$$\begin{aligned} + A B C D + = \underline{A B C D} + &+ \underline{A B} \Expval{C D}_0 \pm \underline{A C} \Expval{B D}_0 + \underline{A D} \Expval{B C}_0 + \\ + &+ \underline{B C} \Expval{A D}_0 \pm \underline{B D} \Expval{A C}_0 + \underline{C D} \Expval{A B}_0 + \\ + &+ \Expval{A B}_0 \Expval{C D}_0 \pm \Expval{A C}_0 \Expval{B D}_0 + \Expval{A D}_0 \Expval{B C}_0 +\end{aligned}$$ + +Where the negative signs apply to fermions only. +We take the normal product with 0 contractions removed ($\underline{ABCD}$), +then with 1 contraction removed in every possible way (first two lines), +then with 2 contractions removed in every possible way (last line), and so on. + + +## Proof + +We will prove this by induction, with the base case being two operators, +where Wick's theorem becomes as follows: + +$$\begin{aligned} + A B + = \underline{AB} + \Expval{A B}_0 +\end{aligned}$$ + +This must be proven separately for fermions and bosons. +For fermions, a general consequence of the definition of the anticommutator is: + +$$\begin{aligned} + \hat{f}_\alpha \hat{f}_\beta^\dagger + = - \hat{f}_\beta^\dagger \hat{f}_\alpha + \{\hat{f}_\alpha, \hat{f}_\beta^\dagger\} +\end{aligned}$$ + +This anticommutator is known to be $\delta_{\alpha\beta}$, +so we can inconsequentially take +its inner product with the vacuum state $\Ket{0}$: + +$$\begin{aligned} + \hat{f}_\alpha \hat{f}_\beta^\dagger + &= - \hat{f}_\beta^\dagger \hat{f}_\alpha + \matrixel{0}{\{\hat{f}_\alpha, \hat{f}_\beta^\dagger\}}{0} + = - \hat{f}_\beta^\dagger \hat{f}_\alpha + \matrixel{0}{\hat{f}_\alpha \hat{f}_\beta^\dagger + \hat{f}_\beta^\dagger \hat{f}_\alpha}{0} + \\ + &= - \hat{f}_\beta^\dagger \hat{f}_\alpha + \matrixel{0}{\hat{f}_\alpha \hat{f}_\beta^\dagger}{0} + = \underline{\hat{f}_\alpha \hat{f}_\beta^\dagger} + \expval{\hat{f}_\alpha \hat{f}_\beta^\dagger}_0 +\end{aligned}$$ + +Which agrees with Wick's theorem. For bosons, we use the commutator: + +$$\begin{aligned} + \hat{b}_\alpha \hat{b}_\beta^\dagger + = \hat{b}_\beta^\dagger \hat{b}_\alpha + [\hat{b}_\alpha, \hat{b}_\beta^\dagger] +\end{aligned}$$ + +This commutator is known to be $\delta_{\alpha\beta}$, +so we take the inner product with $\Ket{0}$, like before: + +$$\begin{aligned} + \hat{b}_\alpha \hat{b}_\beta^\dagger + &= \hat{b}_\beta^\dagger \hat{b}_\alpha + \matrixel{0}{[\hat{b}_\alpha, \hat{b}_\beta^\dagger]}{0} + = \hat{b}_\beta^\dagger \hat{b}_\alpha + \matrixel{0}{\hat{b}_\alpha \hat{b}_\beta^\dagger - \hat{b}_\beta^\dagger \hat{b}_\alpha}{0} + \\ + &= \hat{b}_\beta^\dagger \hat{b}_\alpha + \matrixel{0}{\hat{b}_\alpha \hat{b}_\beta^\dagger}{0} + = \underline{\hat{b}_\alpha \hat{b}_\beta^\dagger} + \expval{\hat{b}_\alpha \hat{b}_\beta^\dagger}_0 +\end{aligned}$$ + +Which again agrees with Wick's theorem. +Next, we prove that if it holds for $N$ operators, then it also holds for $N + 1$. +To begin with, consider the following statement about right-multiplying +by an extra $A_{N+1}$, with $s = 1$ for bosons and $s = -1$ for fermions: + +$$\begin{aligned} + \underline{A_1 ... A_N} A_{N+1} + = \underline{A_1 ... A_N A_{N+1}} + + \sum_{n = 1}^N s^{n + N} \Expval{A_n A_{N+1}}_0 \underline{A_1 ... A_{n-1} A_{n+1} ... A_N} +\end{aligned}$$ + +If $A_{N + 1}$ is an annihilation operator, then this is trivial: +appending it does not break the existing normal order, +and $\Expval{A_n A_{N+1}}_0 = 0$ for all $A_n$. + +However, if $A_{N + 1}$ is a creation operator, +then to restore the normal order, +we move it to the front by swapping, +which introduces a bunch of (anti)commutators: + +$$\begin{aligned} + \underline{A_1 ... A_N} A_{N+1} + &= s^N A_{N+1} \underline{A_1 ... A_N} + + \sum_{n} s^{n + N} \{[A_n, A_{N+1}]\} \underline{A_1 ... A_{n-1} A_{n+1} ... A_N} + \\ + &= \underline{A_1 ... A_N A_{N+1}} + + \sum_{n} s^{n + N} \Expval{A_n A_{N+1}}_0 \underline{A_1 ... A_{n-1} A_{n+1} ... A_N} +\end{aligned}$$ + +Where $\{[]\}$ is the anticommutator or commutator, +respectively for fermions or bosons. + +If we take Wick's theorem for $N$ operators $A_1 ... A_N$, +and right-multiply it by $A_{N + 1}$, +then each term will contain a product of the form $\underline{A_{v} ... A_{w}} A_{N+1}$. +Using the relation that we just proved, +each such product can be rewritten as follows: + +$$\begin{aligned} + \underline{A_v ... A_w} A_{N+1} + &= \underline{A_v ... A_w A_{N+1}} + + \sum_{n} s^{n + N} \Expval{A_n A_{N+1}}_0 \underline{A_v ... A_{n-1} A_{n+1} ... A_w} +\end{aligned}$$ + +Inserting this back into Wick's theorem, +we get new terms with contractions of $A_{N+1}$. +After a lot of rearranging, +the result turns out to just be Wick's theorem for $N\!+\!1$ operators. +Therefore, +if Wick's theorem holds for $N$ operators, +it also holds for $N\!+\!1$. + +We showed that Wick's theorem holds for $N = 2$, +so, by induction, it holds for all $N \ge 2$. + + + +## References +1. L.E. Ballentine, + *Quantum mechanics: a modern development*, 2nd edition, + World Scientific. diff --git a/source/know/concept/wiener-process/index.md b/source/know/concept/wiener-process/index.md new file mode 100644 index 0000000..09d82e7 --- /dev/null +++ b/source/know/concept/wiener-process/index.md @@ -0,0 +1,186 @@ +--- +title: "Wiener process" +date: 2021-10-29 +categories: +- Physics +- Mathematics +- Stochastic analysis +layout: "concept" +--- + +The **Wiener process** is a [stochastic process](/know/concept/stochastic-process/) +that provides a pure mathematical definition +of the physical phenomenon of **Brownian motion**, +and hence is also called *Brownian motion*. + +A Wiener process $B_t$ is defined as any +stochastic process $\{B_t: t \ge 0\}$ that satisfies: + +1. Initial condition $B_0 = 0$. +2. Each **increment** of $B_t$ is independent of the past: + given $0 \le s < t \le u < v$, then + $B_t \!-\! B_s$ and $B_v \!-\! B_u$ are independent random variables. +3. The increments of $B_t$ are Gaussian with mean $0$ + and variance $h$, where $h$ is the time step, + such that $B_{t+h} \!-\! B_t \sim \mathcal{N}(0, h)$. +4. $B_t$ is a continuous function of $t$. + +There exist stochastic processes that satisfy these requirements, +infinitely many in fact. +In other words, Brownian motion exists, +and can be constructed in various ways. + +Since the variance of an increment is expressed in units of time $t$, +the physical unit of the Wiener process is the square root of time $\sqrt{t}$. + +Brownian motion is **self-similar**: +if we define a rescaled $W_t = \sqrt{\alpha} B_{t/\alpha}$ for some $\alpha$, +then $W_t$ is also a valid Wiener process, +meaning that there are no fundemental scales. +A consequence of this is that: +$\mathbf{E}|B_t|^p = \mathbf{E}|\sqrt{t} B_1|^p = t^{p/2} \mathbf{E}|B_1|^p$. +Another consequence is invariance under "time inversion", +by defining $\sqrt{\alpha} = t$, such that $W_t = t B_{1/t}$. + +Despite being continuous by definition, +the Wiener process is not differentiable in general, +not even in the mean square, because: + +$$\begin{aligned} + \frac{B_{t+h} - B_t}{h} + \sim \frac{1}{h} \mathcal{N}(0, h) + \sim \mathcal{N}\Big(0, \frac{1}{h}\Big) + \qquad \quad + \lim_{h \to 0} \mathbf{E} \bigg|\mathcal{N}\Big(0, \frac{1}{h}\Big) \bigg|^2 + = \infty +\end{aligned}$$ + +Furthermore, the Wiener process is a good example +of both a [martingale](/know/concept/martingale/) +and a [Markov process](/know/concept/markov-process/), +since each increment has mean zero (so it is a martingale), +and all increments are independent (so it is a Markov process). + + +## Recurrence + +An important question about the Wiener process +is whether it is **recurrent** or **transient**: +given a hypersphere (interval in 1D, circle in 2D, sphere in 3D) +away from the origin, will $B_t$ visit it after a finite time $\tau\!<\!\infty$? +It is *recurrent* if yes, i.e. $P(\tau \!<\! \infty) = 1$, or *transient* otherwise. +The answer to this question turns out to depend on the number of dimenions. + +To demonstrate this, we model the $d$-dimensional Wiener process +as an [Itō diffusion](/know/concept/ito-calculus/) $X_t$, +which also allows us to shift the initial condition $X_0$ +(or resume a "paused" process): + +$$\begin{aligned} + X_t + = X_0 + \int_0^t \dd{B_s} +\end{aligned}$$ + +Consider two hyperspheres, the inner with radius $R_i$, +and the outer with $R_o > R_i$. +Let the initial condition $|X_0| \in \: ]R_i, R_o[$, +then we define the stopping times $\tau_i$, $\tau_o$ and $\tau$ like so: + +$$\begin{aligned} + \tau_i + \equiv \inf\{ t : |X_t| \le R_i \} + \qquad + \tau_o + \equiv \inf\{ t : |X_t| \ge R_o \} + \qquad + \tau + \equiv \min\{\tau_i, \tau_o\} +\end{aligned}$$ + +We stop when the inner or outer hypersphere is touched by $X_t$, +whichever happens first. + +[Dynkin's formula](/know/concept/dynkins-formula/) +is applicable to this situation, if we define $h(x)$ as follows, +where the *terminal reward* $\Gamma$ equals $1$ for $|X_\tau| = R_i$, +and $0$ for $|X_\tau| = R_o$, +such that $h(X_0)$ equals the probability +that we touch $R_i$ before $R_o$ for a given $X_0$: + +$$\begin{aligned} + h(X_0) + = \mathbf{E}\Big[ \Gamma(X_\tau) \Big| X_0 \Big] + = P\Big[|X_\tau| \!=\! R_i \:\Big|\: X_0\Big] +\end{aligned}$$ + +Dynkin's formula then tells us that $h(x)$ is given by the following equation, +with the boundary conditions $h(R_i) = 1$ and $h(R_o) = 0$: + +$$\begin{aligned} + 0 + = \hat{L}\{h(x)\} + = \frac{1}{2} \nabla^2 h(x) +\end{aligned}$$ + +Thanks to this problem's spherical symmetry, +$h$ only depends on the radial coodinate $r$, +so the Laplacian $\nabla^2$ can be written as follows +in $d$-dimensional [spherical coordinates](/know/concept/spherical-coordinates/): + +$$\begin{aligned} + 0 + = \nabla^2 h(r) + = \pdvn{2}{h}{r} + \frac{d - 1}{r} \pdv{h}{r} +\end{aligned}$$ + +For $d = 1$, the solution $h_1(r)$ is as follows, +of which we take the limit for $R_o \to \infty$: + +$$\begin{aligned} + h_1(r) + = \frac{r - R_o}{R_i - R_o} + \quad\underset{R_o \to \infty}{\longrightarrow}\quad + 1 +\end{aligned}$$ + +The outer hypersphere becomes harder to reach for larger $R_o$, +and for $R_o \to \infty$ we are left with +the probability of hitting $R_i$ only. +This turns out to be $1$, so in 1D the Wiener process is recurrent: +it always comes close to the origin in finite time. + +For $d = 2$, the solution $h_2(r)$ is as follows, +whose limit turns out to be $1$, +so the Wiener process is also recurrent in 2D: + +$$\begin{aligned} + h_2(r) + = 1 - \frac{\log(r/R_i)}{\log(R_o/R_i)} + \quad\underset{R_o \to \infty}{\longrightarrow}\quad + 1 +\end{aligned}$$ + +However, for $d \ge 3$, the solution $h_d(r)$ +does not converge to $1$ for $R_o \to \infty$, +meaning the Wiener process is transient in 3D or higher: + +$$\begin{aligned} + h_d(r) + = \frac{R_o^{2 - d} - r^{2 - d}}{R_o^{2 - d} - R_i^{2 - d}} + \quad\underset{R_o \to \infty}{\longrightarrow}\quad + \frac{R_i^{d - 2}}{r^{d - 2}} + < 1 +\end{aligned}$$ + +This is a major qualitative difference. For example, consider a situation +where some substance is diffusing from a localized infinite source: +in 3D, the substance can escape and therefore a steady state can exist, +while in 2D, the substance never strays far from the source, +so no steady state is ever reached as long as the source continues to emit. + + + +## References +1. U.H. Thygesen, + *Lecture notes on diffusions and stochastic differential equations*, + 2021, Polyteknisk Kompendie. diff --git a/source/know/concept/wkb-approximation/index.md b/source/know/concept/wkb-approximation/index.md new file mode 100644 index 0000000..ad9b8e0 --- /dev/null +++ b/source/know/concept/wkb-approximation/index.md @@ -0,0 +1,200 @@ +--- +title: "WKB approximation" +date: 2021-02-22 +categories: +- Quantum mechanics +- Physics +layout: "concept" +--- + +In quantum mechanics, the **Wentzel-Kramers-Brillouin** or simply the **WKB +approximation** is a technique to approximate the wave function $\psi(x)$ of +the one-dimensional time-independent Schrödinger equation. It is an example +of a **semiclassical approximation**, because it tries to find a +balance between classical and quantum physics. + +In classical mechanics, a particle travelling in a potential $V(x)$ +along a path $x(t)$ has a total energy $E$ as follows, which we +rearrange: + +$$\begin{aligned} + E = \frac{1}{2} m \dot{x}^2 + V(x) + \quad \implies \quad + m^2 (x')^2 = 2 m (E - V(x)) +\end{aligned}$$ + +The left-hand side of the rearranged version is simply the momentum squared, +so we define the magnitude of the momentum $p(x)$ accordingly: + +$$\begin{aligned} + p(x) = \sqrt{2 m (E - V(x))} +\end{aligned}$$ + +Note that this is under the assumption that $E > V$, +which is always true in classical mechanics, +but not necessarily in quantum mechanics. +We rewrite the Schrödinger equation: + +$$\begin{aligned} + 0 + = \dvn{2}{\psi}{x} + \frac{2 m}{\hbar^2} (E - V) \psi + = \dvn{2}{\psi}{x} + \frac{p^2}{\hbar^2} \psi +\end{aligned}$$ + +If $V(x)$ were constant, and by extension $p(x)$ too, then the solution +is easy: + +$$\begin{aligned} + \psi(x) + = \psi(0) \exp(\pm i p x / \hbar) +\end{aligned}$$ + +This form is reminiscent of the generator of translations. In practice, +$V(x)$ and $p(x)$ vary with $x$, but we can still salvage this solution +by assuming that $V(x)$ varies slowly compared to the wavelength +$\lambda(x) = 2 \pi / k(x)$, where $k(x) = p(x) / \hbar$ is the +wavenumber. The solution then takes the following form: + +$$\begin{aligned} + \psi(x) + = \psi(0) \exp\!\Big(\!\pm\! \frac{i}{\hbar} \int_0^x \chi(\xi) \dd{\xi} \Big) +\end{aligned}$$ + +$\chi(\xi)$ is an unknown function, which intuitively should be related +to $p(x)$. The purpose of the integral is to accumulate the change of +$\chi$ from the initial point $0$ to the current position $x$. +Let us write this as an indefinite integral for convenience: + +$$\begin{aligned} + \psi(x) + = \psi(0) \exp\!\bigg( \!\pm\! \frac{i}{\hbar} \Big( \int \chi(x) \dd{x} - C \Big) \bigg) +\end{aligned}$$ + +Where $C = \int \chi(x) \dd{x} |_{x = 0}$ is the initial point of the definite integral. +For simplicity, we absorb the constant $C$ into $\psi(0)$. +We can now clearly see that: + +$$\begin{aligned} + \psi'(x) = \pm \frac{i}{\hbar} \chi(x) \psi(x) + \quad \implies \quad + \chi(x) = \pm \frac{\hbar}{i} \frac{\psi'(x)}{\psi(x)} +\end{aligned}$$ + +Next, we insert this ansatz for $\psi(x)$ into the Schrödinger equation +to get: + +$$\begin{aligned} + 0 + &= \pm \frac{i}{\hbar} \dv{(\chi \psi)}{x} + \frac{p^2}{\hbar^2} \psi + = \pm \frac{i}{\hbar} \chi' \psi \pm \frac{i}{\hbar} \chi \psi' + \frac{p^2}{\hbar^2} \psi + = \pm \frac{i}{\hbar} \chi' \psi - \frac{1}{\hbar^2} \chi^2 \psi + \frac{p^2}{\hbar^2} \psi +\end{aligned}$$ + +Dividing out $\psi$ and rearranging gives us the following, which is +still exact: + +$$\begin{aligned} + \pm \frac{\hbar}{i} \chi' + = p^2 - \chi^2 +\end{aligned}$$ + +Next, we expand this as a power series of $\hbar$. This is why it is +called *semiclassical*: so far we have been using full quantum mechanics, +but now we are treating $\hbar$ as a parameter which controls the +strength of quantum effects: + +$$\begin{aligned} + \chi(x) = \chi_0(x) + \frac{\hbar}{i} \chi_1(x) + \frac{\hbar^2}{i^2} \chi_2(x) + ... +\end{aligned}$$ + +The heart of the WKB approximation is its assumption that quantum effects are +sufficiently weak (i.e. $\hbar$ is small enough) that we only need to +consider the first two terms, or, more specifically, that we only go up to +$\hbar$, not $\hbar^2$ or higher. Inserting the first two terms of this +expansion into the equation: + +$$\begin{aligned} + \pm \frac{\hbar}{i} \chi_0' + &= p^2 - \chi_0^2 - 2 \frac{\hbar}{i} \chi_0 \chi_1 +\end{aligned}$$ + +Where we have discarded all terms containing $\hbar^2$. At order +$\hbar^0$, we then get the expected classical result for $\chi_0(x)$: + +$$\begin{aligned} + 0 = p^2 - \chi_0^2 + \quad \implies \quad + \chi_0(x) = p(x) +\end{aligned}$$ + +While at order $\hbar$, we get the following quantum-mechanical +correction: + +$$\begin{aligned} + \pm \frac{\hbar}{i} \chi_0' + = - 2 \frac{\hbar}{i} \chi_0 \chi_1 + \quad \implies \quad + \chi_1(x) = \mp \frac{1}{2} \frac{\chi_0'(x)}{\chi_0(x)} +\end{aligned}$$ + +Therefore, our approximated wave function $\psi(x)$ currently looks like +this: + +$$\begin{aligned} + \psi(x) + &\approx \psi(0) \exp\!\Big( \!\pm\! \frac{i}{\hbar} \int \chi_0(x) \dd{x} \Big) \exp\!\Big( \!\pm\! \int \chi_1(x) \dd{x} \Big) +\end{aligned}$$ + +We can reduce the latter exponential using integration by substitution: + +$$\begin{aligned} + \exp\!\Big( \!\pm\! \int \chi_1(x) \dd{x} \Big) + &= \exp\!\Big( \!-\! \frac{1}{2} \int \frac{\chi_0'(x)}{\chi_0(x)} \dd{x} \Big) + = \exp\!\Big( \!-\! \frac{1}{2} \int \frac{1}{\chi_0}\:d\chi_0 \Big) + \\ + &= \exp\!\Big( \!-\! \frac{1}{2} \ln\!\big(\chi_0(x)\big) \Big) + = \frac{1}{\sqrt{\chi_0(x)}} + = \frac{1}{\sqrt{p(x)}} +\end{aligned}$$ + +In the WKB approximation for $E > V$, the solution $\psi(x)$ is thus +given by: + +$$\begin{aligned} + \boxed{ + \psi(x) \approx \frac{A}{\sqrt{p(x)}} \exp\!\Big( \!\pm\! \frac{i}{\hbar} \int p(x) \dd{x} \Big) + } +\end{aligned}$$ + +What if $E < V$? In classical mechanics, this is just not allowed; a ball +cannot simply go through a potential bump without the necessary energy. +On the other hand, in quantum physics, particles can **tunnel** through barriers. + +Luckily, the only thing we need to change for the WKB approximation +is to let the momentum take imaginary values: + +$$\begin{aligned} + p(x) = \sqrt{2 m (E - V(x))} = i \sqrt{2 m (V(x) - E)} +\end{aligned}$$ + +And then take the absolute value in the appropriate place in front of $\psi(x)$: + +$$\begin{aligned} + \boxed{ + \psi(x) \approx \frac{A}{\sqrt{|p(x)|}} \exp\!\Big( \!\pm\! \frac{i}{\hbar} \int p(x) \dd{x} \Big) + } +\end{aligned}$$ + +In the classical region ($E > V$), the wave function oscillates, and +in the quantum-physical region ($E < V$) it is exponential. +Note that for $E \approx V$ the approximation breaks down, +because of the appearance of $p(x)$ in the denominator. + + +## References +1. D.J. Griffiths, D.F. Schroeter, + *Introduction to quantum mechanics*, 3rd edition, + Cambridge. +2. R. Shankar, + *Principles of quantum mechanics*, 2nd edition, + Springer. diff --git a/source/know/concept/young-dupre-relation/index.md b/source/know/concept/young-dupre-relation/index.md new file mode 100644 index 0000000..b87e19b --- /dev/null +++ b/source/know/concept/young-dupre-relation/index.md @@ -0,0 +1,98 @@ +--- +title: "Young-Dupré relation" +date: 2021-03-07 +categories: +- Physics +- Fluid mechanics +- Fluid statics +- Surface tension +layout: "concept" +--- + +In fluid mechanics, the **Young-Dupré relation** relates the contact +angle of a droplet at rest on a surface to the surface tensions of the interfaces. +Let $\alpha_{gl}$, $\alpha_{sl}$ and $\alpha_{sg}$ respectively be +the energy costs of the liquid-gas, solid-liquid and solid-gas interfaces: + +$$\begin{aligned} + \boxed{ + \alpha_{sg} - \alpha_{sl} + = \alpha_{gl} \cos\theta + } +\end{aligned}$$ + +The derivation is simple: +this is the only expression that maintains the droplet's boundaries +when you account for the surface tension force pulling along each interface. + +A more general derivation is possible by using the +[calculus of variations](/know/concept/calculus-of-variations/). +In 2D, the upper surface of the droplet is denoted by $y(x)$. +Consider the following Lagrangian $\mathcal{L}$, +with the two first terms respectively being the energy costs +of the top and bottom surfaces: + +$$\begin{aligned} + \mathcal{L} + = \alpha_{gl} \sqrt{1 + (y')^2} + (\alpha_{sl} - \alpha_{sg}) + \lambda y +\end{aligned}$$ + +And the last term comes from the constraint +that the volume $V$ of the droplet must be constant: + +$$\begin{aligned} + V = \int_0^L y \dd{x} +\end{aligned}$$ + +The total energy to be minimized is thus given by the following functional, +where the endpoints of the droplet are $x = 0$ and $x = L$: + +$$\begin{aligned} + E[y(x)] + = \int_0^L \Big( \alpha_{gl} \sqrt{1 + (y')^2} + (\alpha_{sl} - \alpha_{sg}) + \lambda y \Big) \dd{x} +\end{aligned}$$ + +In this optimization problem, the endpoint $L$ is a free parameter, +i.e. the $L$-value of the optimum is unknown and must be found. +In such cases, the optimum $y(x)$ needs to satisfy the so-called *transversality condition* +at the variable endpoint, in this case $x = L$: + +$$\begin{aligned} + 0 + &= \Big( \mathcal{L} - y' \pdv{\mathcal{L}}{y'} \Big)_{x = L} + \\ + &= \bigg( \alpha_{gl} \sqrt{1 + (y')^2} + (\alpha_{sl} - \alpha_{sg}) + \lambda y - \frac{(y')^2}{\sqrt{1 + (y')^2}} \bigg)_{x = L} + \\ + &= \bigg( \alpha_{gl} \frac{1}{\sqrt{1 + (y')^2}} + (\alpha_{sl} - \alpha_{sg}) + \lambda y \bigg)_{x = L} +\end{aligned}$$ + +Due to the droplet's shape, we have the boundary condition $y(L) = 0$, +so the last term vanishes. +We are thus left with the following equation: + +$$\begin{aligned} + \alpha_{gl} \frac{1}{\sqrt{1 + (y'(L))^2}} + = \alpha_{sg} - \alpha_{sl} +\end{aligned}$$ + +At the edge of the droplet, imagine a small right-angled triangle +with one side $\dd{x}$ on the $x$-axis, +the hypotenuse on $y(x)$ having length $\dd{x} \sqrt{1 + (y')^2}$, +and the corner between them being the contact point with angle $\theta$. +Then, from the definition of the cosine: + +$$\begin{aligned} + \cos\theta + = \frac{\dd{x}}{\dd{x} \sqrt{1 + (y'(L))^2}} + = \frac{1}{\sqrt{1 + (y'(L))^2}} +\end{aligned}$$ + +When inserted into the above transversality condition, +this yields the Young-Dupré relation. + + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. diff --git a/source/know/concept/young-laplace-law/index.md b/source/know/concept/young-laplace-law/index.md new file mode 100644 index 0000000..445700e --- /dev/null +++ b/source/know/concept/young-laplace-law/index.md @@ -0,0 +1,94 @@ +--- +title: "Young-Laplace law" +date: 2021-03-11 +categories: +- Physics +- Fluid mechanics +- Surface tension +layout: "concept" +--- + +In liquids, the **Young-Laplace law** governs surface tension: +it describes the tension forces on a surface +as a pressure difference between the two sides of the liquid. + +Consider a small rectangle on the surface with sides $\dd{\ell_1}$ and $\dd{\ell_2}$, +orientated such that the sides are parallel to the (orthogonal) +principal directions of the surface' [curvature](/know/concept/curvature/). + +Surface tension then pulls at the sides with a force +of magnitude $\alpha \dd{\ell_2}$ and $\alpha \dd{\ell_2}$, +where $\alpha$ is the energy cost per unit of area, +which is the same as the force per unit of distance. +However, due to the surface' curvature, +those forces are not quite in the same plane as the rectangle. + +Along both principal directions, +if we treat this portion of the surface as a small arc of a circle +with a radius equal to the principal radius of curvature $R_1$ or $R_2$, +then the tension forces are at angles $\theta_1$ and $\theta_2$ +calculated from the arc length: + +$$\begin{aligned} + \theta_1 R_1 + = \frac{1}{2} \dd{\ell_2} + \qquad \qquad + \theta_2 R_2 + = \frac{1}{2} \dd{\ell_1} +\end{aligned}$$ + +Pay attention to the indices $1$ and $2$: +to get the angle of the force pulling at $\dd{\ell_1}$, +we need to treat $\dd{\ell_2} / 2$ as an arc, +and vice versa. + +Since the forces are not quite in the plane, +they have a small component acting *perpendicular* to the surface, +with the following magnitudes $\dd{F_1}$ and $\dd{F_2}$ +along the principal axes: + +$$\begin{aligned} + \dd{F_1} + &= 2 \alpha \dd{\ell_1} \sin\theta_1 + \approx 2 \alpha \dd{\ell_1} \theta_1 + = \alpha \dd{\ell_1} \frac{\dd{\ell_2}}{R_1} + = \frac{\alpha}{R_1} \dd{A} + \\ + \dd{F_2} + &= 2 \alpha \dd{\ell_2} \sin\theta_2 + \approx 2 \alpha \dd{\ell_2} \theta_2 + = \alpha \dd{\ell_2} \frac{\dd{\ell_1}}{R_2} + = \frac{\alpha}{R_2} \dd{A} +\end{aligned}$$ + +The initial factor of $2$ is there since +the same force is pulling at opposide sides of the rectangle. +We end up with $\alpha / R_{1,2}$ multiplied by +the surface area $\dd{A} = \dd{\ell_1} \dd{\ell_2}$ of the rectangle. + +Adding together $\dd{F_1}$ and $\dd{F_2}$ and +dividing out $\dd{A}$ gives us the force-per-area (i.e. the pressure) +added by surface tension, +which is given by the **Young-Laplace law**: + +$$\begin{aligned} + \boxed{ + \Delta p + = \alpha \Big( \frac{1}{R_1} + \frac{1}{R_2} \Big) + } +\end{aligned}$$ + +The total excess pressure $\Delta p$ is called the **Laplace pressure**, +and fully determines the effects of surface tension: +a certain interface shape leads to a certain $\Delta p$, +and the liquid will flow (i.e. the surface will move) +to try to reach an equilibrium. + + +## References +1. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. +2. T. Bohr, + *Surface tension and Laplace pressure*, 2021, + unpublished. diff --git a/source/know/index.md b/source/know/index.md new file mode 100644 index 0000000..f1b2c51 --- /dev/null +++ b/source/know/index.md @@ -0,0 +1,48 @@ +--- +title: "Knowledge base" +date: 2021-02-22 +layout: "default" +--- + +# Knowledge base + +Welcome to my knowledge base! + +Over the years, I've learned a lot of physics, mathematics, and computing. +These are vast, difficult subjects, and I've spent many hours of my life +trying to make sense of obscure, poorly explained concepts. +To help me remember what I learn, I write notes in LaTeX. + +This knowledge base is based on my notes, and +is freely available to anyone who needs it. +I hope it helps you in your studies or work. + +Keep in mind that I'm only human, so there are probably mistakes here. +I take no responsibility for any injuries. +If you're doing something important, +you should check things yourself! + +{% assign concepts = site.pages + | where_exp: "item", "item.layout == 'concept'" +%} +{% assign categories = site.pages + | where_exp: "item", "item.layout == 'category'" +%} + +There are currently +<a href="/know/concept/">{{ concepts.size }} articles</a> +in this knowledge base, in +<a href="/know/category/">{{ categories.size }} categories</a>. + +<p>Most recent articles: +<ol> +{% assign newest = concepts + | sort: "date" + | reverse + | slice: 0, 10 +%} +{% for page in newest %} + <li><a href="{{ page.url }}">{{ page.title }}</a></li> +{% endfor %} +</ol> +</p> diff --git a/source/robots.txt b/source/robots.txt new file mode 100644 index 0000000..4738d6a --- /dev/null +++ b/source/robots.txt @@ -0,0 +1,3 @@ +User-agent: * +Disallow: + |
