Live data from Hacker News

What is a ket? How do traits work? Quantum computing in Rust, part 1

walther.guru

21–30 of 31 posts

Re: What is a ket? How do traits work? Quantum computing in Rust, part 1

#21
post #20

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…

> In quantum computation, a ket is a vector in a Hilbert space The blog implements kets as 2-dimensional complex vectors, so I don't see any problem there. A 2-dimensional space is a Hilbert space.

It’s woefully under-representing what a ket can be, and the data structure isn’t amenable to extension to a broader set of states. A one qubit state lives in a Hilbert space just as a one element list is still a list.

Re: What is a ket? How do traits work? Quantum computing in Rust, part 1

#22

`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.

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!

Re: What is a ket? How do traits work? Quantum computing in Rust, part 1

#23

Earlier quoted context omitted.

Sometimes I don't know whether to be proud of or disappointed in our species.

Yeah, it's not like any programmers have ever come up with bizzare and useless names for abstractions.

Clearly OT but the excessive reliance on foo and bar in many of my early C lang learning examples really slowed down my ability to transfer said techniques into something meaningful. Eventually one of my friends working in the Visual C++ team (I'm dating myself here) explained the connection of foo and bar to fubar and kind of felt like this!

Re: What is a ket? How do traits work? Quantum computing in Rust, part 1

#24
post #11

Earlier quoted context omitted.

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-comp…

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 t…

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! ️

Re: What is a ket? How do traits work? Quantum computing in Rust, part 1

#25
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!

Re: What is a ket? How do traits work? Quantum computing in Rust, part 1

#26
post #25

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!

Forgot to mention, I'm also getting the book "Quantum Computing Since Democritus" by Scott Aaronson soon.

Re: What is a ket? How do traits work? Quantum computing in Rust, part 1

#28

https://en.wikipedia.org/wiki/Bra%E2%80%93ket_notation I remember learning about this at uni in one of the more advanced QM modules. I remember thinking: Seriously, couldn't they've come up with a better name?

The word "quark" is kind of whimsical, but the names of the types of quark seem arbitrary and unhelpful.

Re: What is a ket? How do traits work? Quantum computing in Rust, part 1

#29
post #23

Earlier quoted context omitted.

Yeah, it's not like any programmers have ever come up with bizzare and useless names for abstractions.

Clearly OT but the excessive reliance on foo and bar in many of my early C lang learning examples really slowed down my ability to transfer said techniques into something meaningful. Eventually one of my friends working in the Visual C++ team (I'm dating myself here) explained the connection of foo and bar to fubar and kind of felt like this!

I had the same experience; that's mostly what I'm referencing. Trying to use things like The Hacker's Dictionary (largely in-jokes, bad jargon, and obnoxious circular definitions) to clear it up made the problem worse. I get that it's just a humor book, but still.

Re: What is a ket? How do traits work? Quantum computing in Rust, part 1

#30
post #24

Earlier quoted context omitted.

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 t…

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 writi…

McIntyre or Griffiths' QM might be useful.
Post reply on HN