Technically I didn't make a static site generator from scratch, but
took some available pieces out there and put em together. The main
component is Tera. This is Jinja2-like
templating engine, which allows me to generate pages using blocks and
variables. For example, I first make a `base.html`

file, which has all
the usual HTML stuff, like

<!doctype html> <head lang="en"> ...

etc. Then inside this `base.html`

, I can put blocks such as

<main> {% block main %}{% endblock main %} </main>

Now instead of copy-pasting this template, to make a page with `main`

filled in, I can do

{% extends "base.html" %} {% block main %} Content {% endblock main %}

This is kind of similar to the templating I did before with Racket, but I find this a lot easier to maintain.

On top of this, I decided to make my own blog engine of sorts, and this
post is from that. Using
pulldown-cmark,
I can pass in markdown files and have them parsed to HTML, and put in
the `main`

block using Tera templates. Then I added a tag system, which
allows posts to be placed in categories/tags (note that
a post can have more than one tag). This post is in the
site tag.

Some todos might be to add syntax highlighting to code blocks (edit: did a bit of this) and maybe an RSS and/or Atom feed (edit: added an RSS feed, available here).

I also moved the blog site (with redirects) from `blog.ryankeleti.com`

to `ryankeleti.com/blog/`

, as I currently prefer that a bit. I might
put out the source for this sometime, although I can't claim much
originality. That's pretty much it for now!

I'm a little burned out right now, so I might write about this more later. I'll give a brief summary here, so please forgive any errors.

In classical computer/information science, data can be represented using *bits*,
which are either $0$ or $1$.
We can consider a quantum analogue to this binary system, called a *quantum bit*, or *qubit*.
Like a classical bit, a qubit can have the states $0$ or $1$, usually denoted by the ket notations
$| 0 \rangle$ and $| 1 \rangle$.
Unlike a classical bit, a qubit $q$ can exist in a *superposition* of $| 0 \rangle$ and $| 1 \rangle$,
that is, a general state $| \psi \rangle$ of $q$ is linear combination
$\alpha | 0 \rangle + \beta | 1 \rangle$, where are $\alpha$ and $\beta$
are complex numbers such that $|\alpha|^2 + |\beta|^2 = 1$.
This gives that $| \psi \rangle$ is a unit vector is a two-dimensional $\mathbb{C}$-vector space $V$,
called the state space of $q$.
Another caveat: while the state of a qubit is
a superposition of $| 0 \rangle$ and $| 1 \rangle$, when we "observe" it, the state
collapses to either $| 0 \rangle$ and $| 1 \rangle$, and the state is lost
(the probability of collapsing to $| 0 \rangle$ is $|\alpha|^2$ and the probability
of collapsing to $| 1 \rangle$ is $|\beta|^2$).

Now suppose we have $n$ qubits $q_1, \dots, q_n$, with state spaces $V_1, \dots, V_n$. A naive approach to an $n$-qubit system might be to take the product of the $V_i$. But due to quantum entanglement, this is not the right notion. Instead, we take the tensor product $V = V_1 \otimes \cdots \otimes V_n$. Then entanglement is expressed as the fact that an arbitrary element of $V$ is not an elementary tensor $u \otimes v$, but instead a linear combination of the basis vectors. These basis vectors ($2^n$ of them) are precisely

$$ | b_1 \cdots b_n \rangle := | b_1 \rangle \otimes \cdots \otimes | b_n \rangle, $$

where $b_i \in \{0, 1\}$ (this is a bit of an abuse of notation).

Now one might like to ask the question: *can we copy a qubit's state?*
In the classical setting, this is as easy as inspecting the state of the bit and copying the value.
Well, not so in the quantum case.
This is due to the *no-cloning theorem*, which gives that there does not exist
an operator which can clone an *arbitrary* quantum state.

What's the next thing we can try?
There is a concept called *perfect state transfer*.
We might want to consider the problem of moving a qubit's state in some kind of network
(usually something which is called a *quantum spin network*).
Suppose this network has $n$ qubits.
We can model the network as an undirected graph $G$ with $n$ vertices.
The state of $G$ at a given time $t$ can be expressed as a vector $| \Psi(t) \rangle$ with $n$ components,
one for each vertex in $G$.
The axioms of quantum mechanics give that the state $| \Psi(t) \rangle$ of $G$
evolves over time according to SchrÃ¶dinger's equation,

$$i\hbar\frac{d}{dt} | \Psi(t) \rangle = \mathcal{H} | \Psi(t) \rangle,$$

where $\hbar$ is the reduced Planck constant (in mathematical fashion, we can take $\hbar = 1$), and $\mathcal{H}$ is the Hamiltonian of the system. The Hamiltonian can be expressed in different ways depending on the context, but it involves the adjacency matrix $A$ of $G$. Solving SchrÃ¶dinger's equation gives

$$ | \Psi(t) \rangle = e^{-it\mathcal{H}/\hbar} | \Psi(0) \rangle.$$

Now we are interested in the case where one qubit is "excited" and the others are $| 0 \rangle$. Through some math involving the Hamiltonian, we get that the evolution of this system is given by

$$ U(t) := e^{-itA}.$$
This operator is called the *quantum walk operator*.

Now say we have two qubits $q_i$ and $q_j$ in $G$. We say that perfect state transfer occurs at time $t$ from $q_i$ to $q_j$ if $| U(t)_{ij} | = 1$, where $U(t)_{ij}$ is the $q_i,q_j$-entry of $U(t)$ (we're indexing the vertices by the qubits). This represents the idea that at time $t$, the quantum state at $q_i$ was transfered to $q_j$ with probability $1$.

We can use various methods from spectral graph theory and algebraic graph theory to find out properties of the graph $G$ via the eigenvalues and eigenvectors of its adjacency matrix $A$, and more.

Our project examined conditions for a more general version of perfect state transfer, where instead of
transfering between two qubits, we consider a transfer to a superposition over a subset of ther vertex set.
This is called *fractional revival*, and comes up in entanglement generation (although I know little about this).

We found examples of graphs which exhibit a certain property called *fractional cospectrality*, which
can be used sometimes to rule out fractional revival.

We might also try to figure out which graphs have *pretty good fractional revival*, which is an $\epsilon$-close
version of fractional revival which is a bit less strict.

Okay I think that's enough for right now, I might talk about this later.

Thanks for reading! :)

]]>I used nanopass.github.io's
templates.rkt
as the basis for my redesign. I made a `templates.rkt`

file, following the format below (some stuff omitted).

; in templates.rkt #lang scribble/html @(provide (all-defined-out)) @(define (header t) @head{ @meta[charset: "utf-8"] @link[rel: "stylesheet" href: "/css/style.css"] @title{@t}}) @(define (scripts) @list{ @script[src: "/js/katex.min.js"] @script[src: "/js/auto-render.min.js" onload: "renderMathInElement(document.body);"]}) @(define (page #:title t . content) @list{ @doctype{html} @html[lang: "en"]{ @header{@t} @body[class: "text-center"]{ @div[class: "center-box"]{@content} @scripts{}}}})

Now whenever I want to make a page, say `hello.html`

, I make a file

; in hello.rkt #lang scribble/html @require["templates.rkt"] @page[#:title "Hello"]{ @h1{Hello page} @p{Hey!}}

Then I would run `racket hello.rkt > hello.html`

, and get the page
with the header and scripts I defined in `templates.rkt`

.

The `scribble/html`

language also makes it easy to define custom shortcuts.
I use Font Awesome icons, and instead of writing

<i class="fas fa-book"></i>

for a book icon, I can write

```
@icon{fas fa-book}
```

after having defined `@icon`

by

; in templates.rkt @(define (icon name) @i[class: name])

I also use the `summary`

tag, so I rolled my own with

; in templates.rkt @(define (summary . s) (make-element 'summary '() s))

While the process is not completely streamlined, it's now easier to create pages and avoid some HTML errors. It was also a fun exercise in learning about templates and Racket.

Thanks for reading :).

]]>I liked the layout of the Racket blog, so I modified it a little and used it here. It's powered by the awesome Frog.

Edit: decided to modify the Frog example with some custom CSS.

]]>