Live data from Hacker News

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

walther.guru

1–10 of 31 posts

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

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

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

#5

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

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.

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

#6
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

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

#7
post #5

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

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.

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

#8

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…

[deleted]

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

#9

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…

[deleted]

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

#10

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?

It's basically a 90-year-old pun involving splitting the word "bracket" into "bra" and "ket".
Post reply on HN