Math · Physics · AI · Quant finance — built from scratch

Play with real simulations,
not screenshots.

Five interactive demos run entirely in your browser, plus three Python flagships including a tax-loss harvester, a neural net with hand-written backprop, and a TSP solver with a published benchmark paper.

8 projects
5 live demos
1 research paper

Live demos

Click any card — no install, no setup.

Flagship code

Deeper Python builds — source in the repo.

HRVSTLab Tax-loss harvesting scanner on real Yahoo Finance data
Source ↗
def get_price_at(ticker: str, timestamp: datetime.datetime):
    """Fetch the historical price near `timestamp`.
    Tries 5-minute intraday data, falls back to daily."""
    key = None
    try:
        day = timestamp.date() if isinstance(timestamp, datetime.datetime) else timestamp
        key = f"PX|{(ticker or '').strip().upper()}|{day.isoformat()}"
Engine.py L393–402 ↗
HRVSTTsp + paper Euclidean TSP solver, 0.00–0.07% optimality gap, 400-trial benchmark
Site ↗ Paper (PDF)
def construct_initial(coords, cand, K, eu, ev, E, parent, psize, deg, ea, eb,
                      work, tour, pos, n):
    """Multi-fragment greedy construction: sorted union, candidate
    patching, provable-closure patching, then assembly."""
    if n == 1:
        tour[0] = 0
        pos[0] = 0
        deg[0] = 2
        return
TSP.py L250–259 ↗
HRVSTNeural 8-layer MLP in pure Python, manual backprop, He init
Site ↗
def train_step(self, x, target, lr=0.01):
    pred = self.forward(x)
    loss = mse(pred, target)
    n = len(pred)
    dout = [2.0 * (p - t) / n for p, t in zip(pred, target)]
    for idx in reversed(range(len(self.layers))):
        layer = self.layers[idx]
        x_in = self.cache_xs[idx]
        z = self.cache_zs[idx]
network.py L29–38 ↗