Readit News logoReadit News
Walther commented on Understanding Rust futures by going way too deep   fasterthanli.me/articles/... · Posted by u/tempodox
Walther · 5 years ago
Thank you once again for writing such an excellent article <3

In contrast to some other comments here, I love the narrative style. After all, these are half tutorials half entertainment - and the entertainment keeps it enticing. I would not have spent nearly two hours reading about the nitty-gritty of futures implementation details today if it weren't for the way you write about things.

To put it the other way - if I wanted to read a super condensed, concise reference of how these things work, I would, you know, read a reference. The narrative style of building things on your own, solving problems as you face them, picking tools and libraries on the way, feels relatable as the everyday lived experience of software development. It feels appropriate for the medium - it's a blog after all!

Besides, blogs are the perfect place to mention the tiny useful tools and libraries people might not have heard of. References and books might err on the side of being "neutral" and not making opinionated recommendations, but this can also lead to unknown unknowns. People don't know what they are missing out on! Luckily, blogs have more freedom here. Mentioning things like `cargo-edit`, `serde` and others can probably make some readers feel like "one of today's lucky ten thousand" - enjoying the newly-gained quality of life improvements.

Walther commented on What is a ket? How do traits work? Quantum computing in Rust, part 1   walther.guru/blog/impl-qu... · Posted by u/Walther
Walther · 6 years ago
Thank you all for the feedback! I'll continue to make improvements to this post, as well as build more in the next parts.

My current understanding is mostly based on this wonderful website: https://quantum.country/qcvc - if you can recommend more good resources, I'm all ears!

Walther · 6 years ago
Forgot to mention, I'm also getting the book "Quantum Computing Since Democritus" by Scott Aaronson soon.
Walther commented on What is a ket? How do traits work? Quantum computing in Rust, part 1   walther.guru/blog/impl-qu... · Posted by u/Walther
Walther · 6 years ago
Thank you all for the feedback! I'll continue to make improvements to this post, as well as build more in the next parts.

My current understanding is mostly based on this wonderful website: https://quantum.country/qcvc - if you can recommend more good resources, I'm all ears!

Walther commented on What is a ket? How do traits work? Quantum computing in Rust, part 1   walther.guru/blog/impl-qu... · Posted by u/Walther
eigenloss · 6 years ago
Having "quantum computing" in the title makes this genuine clickbait when the body lacks any explanation of what a state is or what a ket is. Energy or momentum or spin states are rarely (never, in reality) just numbers.

You made no attempt to explain what the two different states in a single ket mean: hint, it's superposition. Never provided even a trivial justification for why normalization is important; where is the actual physics?

Using Rust here is also quite pointless when you're just doing linear algebra... where is the actual benefit over Python or even Haskell?

You've written a very cute and inefficient math library, but calling this QC is just false advertising.

Walther · 6 years ago
Thank you for your feedback!

You're right, the essay needs a better explanation on what a ket and a quantum state is. I'll figure something out.

Excellent point with the superposition, I'll add that in! Same with the normalization - while adding the `is_valid` method to the struct makes sense programming story -wise, it'd be great to justify its origins and implications.

As for using Rust being pointless - I am writing this blog post series for three reasons: learning more Rust by doing, learning more quantum computing by doing, and sharing my journey as a tutorial. Using Rust for the sake of learning (and hopefully helping others learn) Rust is in my opinion a perfect reason to use Rust.

As for calling this QC - I'd clarify that this code does not intend to be a production-grade QC library, and the blog post series does not intend to be an exact, axioms-and-proofs type of an university level course that prepares you for the industry in one go. I'd think of it more as a Todo MVC app building journey with a quantum flavor - or something. That being said, I do plan to add more QC features in the next posts of the series, and incrementally add to the accuracy as much as I feasibly can. All this feedback here and links to more materials are helping me immensely, I want to learn more about this stuff!

Thank you for calling it very cute - I really appreciate that! ️

Walther commented on What is a ket? How do traits work? Quantum computing in Rust, part 1   walther.guru/blog/impl-qu... · Posted by u/Walther
ivanbakel · 6 years 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.

Walther · 6 years ago
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!

Walther commented on What is a ket? How do traits work? Quantum computing in Rust, part 1   walther.guru/blog/impl-qu... · Posted by u/Walther
reikonomusha · 6 years ago
This does not present the correct definition of a ket. More specifically, it doesn’t present a reasonably general definition of a ket. It would be like asking “What is a list?” and implementing a data structure that can store only one element.

In quantum computation, a ket is a vector in a Hilbert space. A Hilbert space is just a fancy way to describe a typical space you find in linear algebra, where the space allows you to compute lengths and angles. When discussing kets, the usual vector space is the set of complex-element vectors with unit length (or “norm”). The vectors can have any number of elements (or “dimension”), but when discussing qubits, they are 2^n-dimensional for n qubits.

(It’s important to note that a ket is not distinguishable from a vector. It’s actually called so because of a notational convention, not because it has deeper underlying meaning. However, physicists will still use the word “ket” instead of “vector” or “quantum state” even if they’re not emphasizing notation.)

More interesting, though, is how kets combine with other kets via tensor products. This ingredient is as essential to QC as flour is to cake.

This article [0] informally presents a fully general definition of a ket along with the tensor product with an emphasis on why a representation and notation was chosen. But it does require a good understanding of linear algebra already.

[0] “Someone shouts |01000>! Who’s excited?” https://arxiv.org/abs/1711.02086

Walther · 6 years ago
Thank you for feedback! Going to read the paper to improve my understanding. I'm writing this blog series in part to learn more - both about quantum computing as well as Rust. As some people say, teaching is a great way to learn (or at least check your knowledge).

What do you think would be a good correction or disclaimer to add? Would it be sufficient to e.g. say that in this first part, we only implement a two-component ket? Generalizing the ket type to an arbitrary-size vector while keeping type constraints, perhaps briefly mentioning const generics (an upcoming language feature), etc could easily make for another part in this series. Making the ket into an actual vector could then give way to doing proper linear algebra on them, cleaning up some of the manually implemented operations here, as their teaching purpose has been fulfilled already.

Thoughts?

Walther commented on How Rust optimizes async/await   tmandry.gitlab.io/blog/po... · Posted by u/tmandry
Walther · 7 years ago
Thank you for the great writeup <3 Eagerly waiting for the upcoming parts - please keep it up!

u/Walther

KarmaCake day150June 21, 2016
About
Developer, photographer, cheerful optimist <3

https://walther.guru/

View Original