HN user

bollu

1,541 karma

https://pixel-druid.com/ https://github.com/bollu/ siddharth.bhat@cl.cam.ac.uk

Posts27
Comments242
View on HN
github.com 27d ago

Show HN: Formally Verified FPSan

bollu
2pts0
pixel-druid.com 1y ago

Stuff I Learnt in 2024

bollu
2pts1
pixel-druid.com 3y ago

Stuff I Learnt in 2022

bollu
1pts0
scg.unibe.ch 4y ago

Identify the Champion: An Organisational Pattern for Programme Commitees

bollu
9pts0
pixel-druid.com 4y ago

Stuff I Learnt in 2021

bollu
2pts0
bollu.github.io 5y ago

The Jacobian, Geometrically

bollu
2pts1
bollu.github.io 5y ago

Hacker's Guide to Numerical Analysis

bollu
356pts64
bollu.github.io 5y ago

Readable Pointers

bollu
9pts4
news.ycombinator.com 6y ago

Ask HN: easist way to build digital logic on civilization collapse?

bollu
2pts2
bollu.github.io 6y ago

The unreasonable effectiveness of declarative programming

bollu
417pts122
bollu.github.io 6y ago

Best Practices for Array Indexing

bollu
9pts2
bollu.github.io 6y ago

Fast Math Rendering on the Web

bollu
46pts20
bollu.github.io 6y ago

Incunabulum for the 21st century: Making the J interpreter compile in 2020

bollu
2pts0
bollu.github.io 6y ago

Stuff I learnt in 2019: Papers, math and code

bollu
5pts0
news.ycombinator.com 6y ago

Ask HN: How does someone in India access the internet when taken down?

bollu
29pts9
bollu.github.io 6y ago

What's a Grober basis? An explanation using circuit equivalence

bollu
3pts0
github.com 7y ago

Show HN: A weekend replication of STOKE, a stochastic superoptimiser

bollu
58pts4
github.com 7y ago

Differences between the word2vec paper and its implementation

bollu
351pts147
journalofastrobiology.com 7y ago

Is there life on Mars? Paper answers “maybe”

bollu
1pts2
github.com 7y ago

The ideas I picked up in 2018

bollu
2pts0
pixel-druid.com 8y ago

Making GHC an order of magnitude faster with one neat trick

bollu
59pts18
pixel-druid.com 8y ago

Show HN: Papers I read and loved in 2017 (compilers and programming languages)

bollu
1pts0
pixel-druid.com 8y ago

Show HN: Simplexhc, a Haskell to LLVM compiler

bollu
5pts1
pixel-druid.com 9y ago

Show HN: Simplexhc – Haskell to LLVM compiler (design phase)

bollu
55pts14
github.com 9y ago

Show HN: TIMi-Visual Interpreter for lazy functional language in Rust

bollu
2pts0
bollu.github.io 9y ago

Show HN: Teleport: Simple command line app tutorial written in Haskell

bollu
76pts28
github.com 9y ago

Show HN: RealityCheck: Proof of concept ST plugin to live edit Python code

bollu
2pts0

yes, Lean is executable, and the proof of natural numbers runs with arbitrary width integers. they're stored as tagged pointers, with upto 63bit numbers being normal numbers, and larger numbers become GMP encoded.

How does one formally define a spinor? I've seen the definition of a spinor field as "things that transform like a spinor", and a spinor as a "representation of the spin group" (which representation), but I would like to know a canonical mathsy definition of what the heck a "spinor" is! May I please have one? :)

How'd you recommend I learnt to paint? I've not really done much painting in my life at all, and I'd love a breakdown.

I've written about [this explanation of tensors](https://pixel-druid.com/articles/tensor-is-a-thing-that-tran...) before, and it seems worthwhile to write it down again:

There are two ways of using linear maps in the context of physics. One is as a thing that acts on the space . The other is a thing that acts on the coordinates . So when we talk about transformations in tensor analysis, we're talking about coordinate transformatios , not space transformations . Suppose I implement a double ended queue using two pointers:

``` struct Queue {int memory, start, end; } void queue_init(int size) { memory = malloc(sizeof(int) size); start = end = memory + (size - 1) / 2; } void queue_push_start(int x) { start = x; start--; } void queue_push_end(int x) { end++; end = x; } int queue_head() { return start; } int queue_tail() { return end; } void queue_deque_head() { start++; } void queue_deque_tail() { tail--; } ```

See that the state of the queue is technically three numbers, { memory, start, end } (Pointers are just numbers after all). But this is coordinate dependent , as start and end are relative to the location of memory. Now suppose I have a procedure to reallocate the queue size:

``` void queue_realloc(Queue q, int new_size) { int start_offset = q->memory - q->start; int end_offset = q->memory - q->end; int oldmem = q->memory; q->memory = realloc(q->memory, new_size); memcpy(q->memory, oldmem + q->start, sizeof(int) * (end_offset - start_offset); q->start = q->memory + start_offset; q->end = q->memory - end_offset; }

```

Notice that when I do this, the values of start and end can be completely different! However, see that the length of the queue, given by (end - start) is invariant : It hasn't changed!

---

In the exact same way, a "tensor" is a collection of numbers that describes something physical with respect to a particular coordinate system (the pointers start and end with respect to the memory coordinate system). "tensor calculus" is a bunch of rules that tell you how the numbers change when one changes coordinate systems (ie, how the pointers start and end change when the pointer memory changes). Some quantities that are computed from tensors are "physical", like the length of the queue, as they are invariant under transformations. Tensor calculus gives a principled way to make sure that the final answers we calculate are "invariant" / "physical" / "real". The actual locations of start and end don't matter, as (end - start) will always be the length of the list!

---

Physicists (and people who write memory allocators) need such elaborate tracking, to keep track of what is "real" and what is "coordinate dependent", since a lot of physics involves crazy coordinate systems , and having ways to know what things are real and what are artefacts of one's coordinate system is invaluable. For a real example, consider the case of singularities of the Schwarzschild solution to GR, where we initially thought there were two singularities, but it later turned out there was only one "real" singularity, and the other singularity was due to a poor choice of coordinate system:

Although there was general consensus that the singularity at r = 0 was a 'genuine' physical singularity, the nature of the singularity at r = rs remained unclear. In 1921 Paul Painlevé and in 1922 Allvar Gullstrand independently produced a metric, a spherically symmetric solution of Einstein's equations, which we now know is coordinate transformation of the Schwarzschild metric, Gullstrand–Painlevé coordinates, in which there was no singularity at r = rs. They, however, did not recognize that their solutions were just coordinate transform

Rete algorithm 2 years ago

I have a very well documented implementation of rete, that also produces nice looking SVGs of the state of the rete algorithm here: https://github.com/bollu/rete

It's a really interesting algorithm, and allows one to get O(1) incremental pattern matching (ie, when one adds a pattern, one is told of a matching pattern in O(1) time) at the cost of O(npattern * nitems) memory usage. I was trying to use it in the context of pattern matching within a compiler, but I never went anywhere since I had COVID, then a PhD to get to :)

You're right on one count: no library implements forward mode. Hence, you're correct that no autodiff library (including pytorch) implement autodiff this way.

However, *you're wrong* that forward mode cannot be written in terms of dual numbers. The point is that the addition and multiplication operation for dual numbers correspond exactly to rules of the derivative of addition and the derivative of the product.

You are very wrong.

Many of the key results of theoretical CS is to prove impossibility. There is no code to be written when you show that something is not possible.

- Halting problem: impossibility of TM to determine if other TMs halt. - crypto: impossibility for a Turing machine to break a cryposystem in polytime - sorting lower bounds: impossibility to sort objects given only a less_than operator on them in time less than O(n log n)

and so on. There is no code to be written for these, because they are mathematical theorems.

computer science is about computers as much as astronomy is about telescopes ~Dikjstra.

Surely you’re joking. Polya pioneered so much combinatorics I don’t even know where to begin. Heck, a lot of counting problems reduces to polya’s enumeration theorem. The page of “references” to stuff named after him should be a clue to you.

I do not believe this. What will one do about intermetidate computations which can have complex coefficients? In general, you'd need some way to change the gates/ unitary matrices themselves to be purely real. So you'd need to find an isomorpism from U(n) into a subgroup of SO(poly(n)) for this claim to work. Why does such an isomorphism exist?