Hacker News new | ask | show | jobs
by ivanbakel 2426 days ago
`assert_eq(A == B, true)`? `assert_eq(A, B)`, or even `assert(A == B)` by all means.

And this does not really explain what a `Ket` is, rather unfortunately. I now know it's a pair of complex numbers, but that's not very handy - and the `is_valid` definition is not explained, so I don't even get told what subset of pairs of complex numbers make up valid kets without reading code.

2 comments

Heh, what a silly little mistake to make with the asserts. I've now improved their readability. Thank you!

You're right, I need to add a better explanation for what a ket is. Same applies to the validity, should explain a bit about normalization.

Thanks for the feedback!

The title of the article is "Quantum Computing fin Rust, part 1", so the implication is that it is there to teach you about Rust, not to teach Quantum Mechanics which you already know.
It's not too much to expect an article entitled "What is a ket?" to explain what a Ket is.

Your point is arguable if it was instead "How to implement a Ket in Rust", and even then it's a bit vague. I left with the same feeling that it was a bit barebones in terms of definition.