-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add single-head-attention.typ converted from single-head-attention.tex
add critical-temperature.typ converted from critical-temperature.tex add gas-pressure-on-wall.typ converted from gas-pressure-on-wall.tex (prev wall.tex) rename propagators to qft-propagators
- Loading branch information
Showing
17 changed files
with
431 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#import "@preview/cetz:0.3.2": canvas, draw | ||
#import "@preview/cetz-plot:0.1.1": plot | ||
|
||
#set page(width: auto, height: auto, margin: 8pt) | ||
|
||
#let tc = 1 | ||
|
||
// Define the three functions | ||
#let f1(x) = { | ||
if x == tc { return 0 } | ||
calc.sqrt(3) * calc.pow(tc / x - 1, 1 / 2) | ||
} | ||
|
||
#let f2(x) = calc.sqrt(3) * calc.pow(x / tc, 3 / 2) | ||
|
||
#let f3(x) = { | ||
if x == tc { return 0 } | ||
calc.sqrt(3) * calc.pow(x / tc, 3 / 2) * calc.pow(tc / x - 1, 1 / 2) | ||
} | ||
|
||
#canvas({ | ||
draw.set-style( | ||
axes: ( | ||
y: (label: (anchor: "north-west", offset: -0.2), mark: (end: "stealth", fill: black)), | ||
x: (label: (anchor: "north", offset: 0.2), mark: (end: "stealth", fill: black)), | ||
), | ||
) | ||
|
||
plot.plot( | ||
size: (10, 8), | ||
x-label: $T$, | ||
x-min: 0, | ||
x-max: 1.1, | ||
y-min: 0, | ||
y-max: 2.8, | ||
axis-style: "left", | ||
x-tick-step: 0.2, | ||
y-tick-step: 0.5, | ||
legend: (6.5, 8.5), | ||
legend-style: (item: (spacing: 0.15), padding: 0.25, stroke: .5pt), | ||
{ | ||
// First function (blue) | ||
plot.add( | ||
style: (stroke: blue + 1.5pt), | ||
samples: 100, | ||
domain: (0.01, 1), | ||
f1, | ||
label: $sqrt(3)(T_c \/ T - 1)^(1 / 2)$, | ||
) | ||
|
||
// Second function (red) | ||
plot.add( | ||
style: (stroke: red + 1.5pt), | ||
samples: 50, | ||
domain: (0, 1.1), | ||
f2, | ||
label: $sqrt(3)(T \/ T_c)^(3 / 2)$, | ||
) | ||
|
||
// Third function (orange) | ||
plot.add( | ||
style: (stroke: orange + 1.5pt), | ||
samples: 125, | ||
domain: (0.01, 1), | ||
f3, | ||
label: $m_c(T)$, | ||
) | ||
}, | ||
) | ||
}) |
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#import "@preview/cetz:0.3.2": canvas, draw | ||
#import "@preview/modpattern:0.1.0": modpattern | ||
|
||
#set page(width: auto, height: auto, margin: 8pt) | ||
|
||
#let hatched = modpattern( | ||
(.2cm, .2cm), | ||
std.line(start: (0%, 100%), end: (100%, 0%), stroke: 0.5pt), | ||
) | ||
|
||
#let lennard-jones(x, A, B, alpha) = { | ||
-A * calc.exp(-alpha * x) + B * calc.exp(-2 * alpha * x) | ||
} | ||
|
||
#canvas({ | ||
import draw: line, content, rect, on-layer | ||
|
||
let arrow-style = (mark: (end: ">", fill: black, scale: 0.7)) | ||
let wall-width = 0.5 | ||
|
||
// Draw axes | ||
line((-0.1, 0), (6.2, 0), ..arrow-style, name: "x-axis") | ||
line((0, -0.7), (0, 4), ..arrow-style, name: "y-axis") | ||
|
||
// Add axis labels | ||
content((rel: (-0.2, 0.3), to: "x-axis.end"), $x$, name: "x-label") | ||
content((rel: (0.5, 0), to: "y-axis.end"), $U(x)$, name: "y-label") | ||
|
||
// Draw wall with hatching | ||
on-layer( | ||
1, // draw wall above pressure lines | ||
rect( | ||
(0, 0), | ||
(wall-width, 3.6), | ||
fill: hatched, | ||
pattern: "north-east-lines", | ||
stroke: 0.75pt, | ||
), | ||
) | ||
|
||
// Draw potential curves | ||
let samples = 100 | ||
let dx = (6 - wall-width) / samples | ||
|
||
// First curve (blue) | ||
let (A1, B1, alpha1) = (10, 25, 1) | ||
|
||
for ii in range(samples - 1) { | ||
let x1 = wall-width + ii * dx | ||
let x2 = x1 + dx | ||
let y1 = lennard-jones(x1, A1, B1, alpha1) | ||
let y2 = lennard-jones(x2, A1, B1, alpha1) | ||
line( | ||
(x1, y1), | ||
(x2, y2), | ||
stroke: blue, | ||
) | ||
} | ||
content((4.2, -0.6), text(fill: blue)[$1 / alpha << ell$], name: "alpha-label") | ||
|
||
// Second curve (orange) | ||
let (A2, B2, alpha2) = (15, 120, 3) | ||
|
||
for ii in range(samples - 1) { | ||
let x1 = wall-width + ii * dx | ||
let x2 = x1 + dx | ||
let y1 = lennard-jones(x1, A2, B2, alpha2) | ||
let y2 = lennard-jones(x2, A2, B2, alpha2) | ||
line( | ||
(x1, y1), | ||
(x2, y2), | ||
stroke: orange, | ||
name: "orange-line-" + str(ii), | ||
) | ||
} | ||
content((4.2, 0.4), text(fill: orange)[$1 / alpha << ell$], name: "alpha-label") | ||
}) |
2 changes: 1 addition & 1 deletion
2
assets/wall/wall.yml → ...pressure-on-wall/gas-pressure-on-wall.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
title: Wall | ||
title: Gas Pressure on Wall | ||
tags: | ||
- physics | ||
- thermodynamics | ||
|
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
#import "@preview/cetz:0.3.2": canvas, draw, decorations | ||
#import draw: line, content, circle | ||
|
||
#set page(width: auto, height: auto, margin: 5pt) | ||
|
||
#let re-range = 5 | ||
#let im-range = 4 | ||
#let arrow-style = (end: "stealth", fill: black, scale: 0.5) | ||
|
||
#canvas({ | ||
// Axes | ||
// Real axis with zigzag decoration | ||
// TODO: add arrow at the end, requireshttps://github.com/cetz-package/cetz/issues/446 | ||
decorations.zigzag( | ||
line( | ||
(-re-range, 0), | ||
(re-range, 0), | ||
), | ||
amplitude: 0.1, | ||
segment-length: 0.2, | ||
name: "x-axis", | ||
mark: arrow-style, | ||
) | ||
content( | ||
"x-axis.end", | ||
$"Re"(omega)$, | ||
anchor: "north-east", | ||
padding: (top: 5pt), | ||
) | ||
|
||
// Imaginary axis | ||
line( | ||
(0, -im-range + 1), | ||
(0, im-range - 1), | ||
mark: arrow-style, | ||
name: "y-axis", | ||
) | ||
content( | ||
"y-axis.end", | ||
$"Im"(omega)$, | ||
anchor: "north-west", | ||
padding: (left: 5pt), | ||
) | ||
|
||
// Matsubara frequencies | ||
for n in range(-im-range, im-range + 1) { | ||
circle( | ||
(0, 2 / 3 * n), | ||
radius: 0.05, | ||
fill: black, | ||
name: "omega" + str(n), | ||
) | ||
} | ||
content( | ||
(-1.1, 2), | ||
align(right)[Matsubara\ frequencies], | ||
) | ||
|
||
// Propagators | ||
// Advanced propagator (red) | ||
line( | ||
(-re-range, -1), | ||
(re-range, -1), | ||
stroke: (paint: red, dash: "dashed"), | ||
name: "advanced", | ||
) | ||
content( | ||
(rel: (0, -0.4), to: "advanced.start"), | ||
text(red)[advanced], | ||
anchor: "south-west", | ||
padding: (left: 5pt), | ||
) | ||
|
||
// Retarded propagator (blue) | ||
line( | ||
(-re-range, 1), | ||
(re-range, 1), | ||
stroke: (paint: blue, dash: "dashed"), | ||
name: "retarded", | ||
) | ||
content( | ||
"retarded.start", | ||
text(blue)[retarded], | ||
anchor: "south-west", | ||
padding: 2pt, | ||
) | ||
|
||
// Feynman propagator (orange) | ||
line( | ||
(-re-range, -1), | ||
(re-range, 1), | ||
stroke: (paint: orange, dash: "dashed"), | ||
name: "feynman", | ||
) | ||
content( | ||
(rel: (-0.7, -0.55), to: "feynman.end"), | ||
text(orange)[Feynman], | ||
padding: 2pt, | ||
) | ||
}) |
5 changes: 4 additions & 1 deletion
5
assets/propagators/propagators.yml → assets/qft-propagators/qft-propagators.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
title: Propagators | ||
title: QFT Propagators | ||
tags: | ||
- physics | ||
- quantum field theory | ||
- Matsubara | ||
- causality | ||
- Green's function | ||
- Feynman | ||
description: null |
Oops, something went wrong.