Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add qft-propagator-poles.typ, harmonic-oscillator-energy-vs-frequency…
Browse files Browse the repository at this point in the history
….typ, harmonic-oscillator-energy-vs-inv-temperature.TYP

rename vae to variational-autoencoder
rename poles to qft-propagator-poles

rename harm-osc-energy-freq to harmonic-oscillator-energy-vs-frequency
rename harm-osc-energy-inv-temp to harmonic-oscillator-energy-vs-inv-temperature
janosh committed Jan 23, 2025
1 parent 5f7f4b9 commit 8ba591f
Showing 30 changed files with 300 additions and 117 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#import "@preview/cetz:0.3.1": canvas, draw
#import "@preview/cetz-plot:0.1.0": plot

#set page(width: auto, height: auto, margin: 8pt)

#let size = (8, 5)

#canvas({
draw.set-style(
axes: (
y: (label: (anchor: "north-west", offset: -0.2), mark: (end: "stealth", fill: black)),
x: (label: (anchor: "north", offset: 0.1), mark: (end: "stealth", fill: black)),
),
)

plot.plot(
size: size,
x-min: 0,
x-max: 11,
y-min: 0,
x-label: $omega = sqrt(k/m)$,
y-label: $angle.l E angle.r \/ k_"B" T$,
x-tick-step: 2,
y-tick-step: 2,
axis-style: "left",
{
// Define constants from original
let h = 1
let b = 1

// Add the energy expectation value curve
plot.add(
style: (stroke: blue + 1.5pt),
domain: (0.01, 11), // Avoid x=0 due to division
samples: 200, // More samples for smoother curve
x => {
// E = (1/2)hω(1 + 4/(exp(βhω) - 1))
let hw = h * x
let exp_term = calc.exp(b * hw)
(1 / 2) * hw * (1 + 4 / (exp_term - 1))
},
)
},
)
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#import "@preview/cetz:0.3.1": canvas, draw
#import "@preview/cetz-plot:0.1.0": plot

#set page(width: auto, height: auto, margin: 8pt)

#let size = (8, 5)

#canvas({
draw.set-style(
axes: (
y: (label: (anchor: "north-west", offset: -0.2), mark: (end: "stealth", fill: black)),
x: (label: (anchor: "north", offset: 0.1), mark: (end: "stealth", fill: black)),
),
)

plot.plot(
size: size,
x-min: 0,
x-max: 11,
y-min: 0,
y-max: 2.3,
x-label: $beta$,
y-label: $angle.l E angle.r \/ planck.reduce omega$,
x-tick-step: 2,
y-tick-step: 0.5,
axis-style: "left",
{
// Define constants from original
let (h, w) = (1, 1)

// Add the energy expectation value curve
plot.add(
style: (stroke: blue + 1.5pt),
domain: (1e-5, 11),
samples: 200, // More samples for smoother curve
x => {
// E = (1/2)hω(1 + 4/(exp(xhω) - 1))
let hw = h * w
let exp_term = calc.exp(x * hw)
(1 / 2) * hw * (1 + 4 / (exp_term - 1))
},
)
},
)
})
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
81 changes: 81 additions & 0 deletions assets/qft-propagator-poles/qft-propagator-poles.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#import "@preview/cetz:0.3.1": canvas, draw, decorations

#set page(width: auto, height: auto, margin: 8pt)

#canvas({
import draw: line, content, circle

let xrange = 6
let yrange = 4

// Axes styles
let arrow-style = (mark: (end: "stealth", fill: black))
let line-style = (stroke: black + .75pt)
let zigzag-style = (amplitude: 0.1, segment-length: 0.2)

// Main axes
line((-1, 0), (2, 0), ..line-style, name: "x-axis-left")
decorations.zigzag(
line((2, 0), (xrange, 0)),
..zigzag-style,
..line-style,
name: "x-axis-right",
)
content((rel: (-0.3, 0.3), to: "x-axis-right.end"), $"Re"(p_0)$, name: "x-label")

decorations.zigzag(
line((2, -3), (xrange, -3), name: "lower-zigzag"),
..zigzag-style,
..line-style,
)

line((0, -yrange - 1), (0, 2), ..arrow-style, ..line-style, name: "y-axis")
content((rel: (0.8, -0.2), to: "y-axis.end"), $"Im"(p_0)$, name: "y-label")

// Brace for q_0
content(
(2, -1.5),
[#math.underbrace(box(width: 7.5em))],
name: "q0-brace",
angle: -90deg,
)
content((rel: (-0.5, 0), to: "q0-brace"), $q_0$, name: "q0-label")

// Matsubara frequencies
for n in range(-yrange, 2) {
if n != 0 {
circle((0, n), radius: 0.04, fill: black, name: "matsubara-" + str(n))
content("matsubara-" + str(n), $i omega_#n$, anchor: "west", padding: 0.2)
}
}
circle((0, 0), radius: 0.03, fill: black, name: "origin")
content((0.2, 0.1), $0$, name: "origin-label")

// Poles
let pole(x, y, label) = {
circle((x, y), radius: 0.06, fill: black, name: "pole-" + str(x) + "-" + str(y))
content("pole-" + str(x) + "-" + str(y), label, anchor: "south", padding: 0.1)
}

// First row of poles
pole(3, 1, $alpha_2^1$)
pole(5, 1, $alpha_1^1$)

// Second row
pole(3, -1, $alpha_2^1$)
pole(5, -1, $alpha_1^1$)

// Third row
pole(3, -2, $alpha_2^2$)
pole(5, -2, $alpha_1^2$)

// Fourth row
pole(3, -4, $alpha_2^2$)
pole(5, -4, $alpha_1^2$)

// Region labels
let blue = rgb("#00008B") // DarkBlue equivalent
content((4, 1.5), text(fill: blue)[(I)], name: "region-1")
content((4, -1.5), text(fill: blue)[(II)], name: "region-2")
content((4, -4.5), text(fill: blue)[(III)], name: "region-3")
})
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
228 changes: 114 additions & 114 deletions readme.md

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions site/src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -93,13 +93,19 @@
{diagrams.length} diagrams about
{#each [`physics`, `chemistry`, `machine learning`] as tag, idx}
{#if idx > 0},{/if}
<button class="link" on:click={() => ($filter_tags = [{ label: tag, count: 0 }])}>
<button on:click={() => ($filter_tags = [{ label: tag, count: 0 }])}>
{tag}
</button>{/each},<br />
{diagrams.filter((diagram) => diagram.code.typst).length} of which in
<button on:click={() => ($filter_tags = [{ label: `cetz`, count: 0 }])}>
{diagrams.filter((diagram) => diagram.code.typst).length}
</button>
of which in
<a href="https://cetz-package.github.io/docs/">Cetz</a>
(Typst) and
{diagrams.filter((diagram) => diagram.code.tex).length} in
<button on:click={() => ($filter_tags = [{ label: `tikz`, count: 0 }])}>
{diagrams.filter((diagram) => diagram.code.tex).length}
</button>
in
<a href="https://tikz.dev">TikZ</a> (LaTeX) diagrams.
</p>
<p>
@@ -157,6 +163,7 @@
}
p {
font-size: 2.2ex;
line-height: 1.5;
}
ul {
list-style: none;
@@ -197,4 +204,9 @@
--sms-border: 0.5px solid gray;
--sms-li-active-bg: rgba(255, 255, 255, 0.15);
}
button {
padding: 1pt 3pt;
background-color: rgba(255, 255, 255, 0.15);
font-size: inherit;
}
</style>

0 comments on commit 8ba591f

Please sign in to comment.