TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

87 pointsby Waltherover 5 years ago

6 comments

reikonomushaover 5 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.<p>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.<p>(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.)<p>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.<p>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.<p>[0] “Someone shouts |01000&gt;! Who’s excited?” <a href="https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;1711.02086" rel="nofollow">https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;1711.02086</a>
评论 #21378141 未加载
评论 #21379459 未加载
评论 #21380399 未加载
评论 #21378098 未加载
评论 #21377958 未加载
ivanbakelover 5 years ago
`assert_eq(A == B, true)`? `assert_eq(A, B)`, or even `assert(A == B)` by all means.<p>And this does not really explain what a `Ket` is, rather unfortunately. I now know it&#x27;s a pair of complex numbers, but that&#x27;s not very handy - and the `is_valid` definition is not explained, so I don&#x27;t even get told what subset of pairs of complex numbers make up valid kets without reading code.
评论 #21382924 未加载
评论 #21377883 未加载
Waltherover 5 years ago
Thank you all for the feedback! I&#x27;ll continue to make improvements to this post, as well as build more in the next parts.<p>My current understanding is mostly based on this wonderful website: <a href="https:&#x2F;&#x2F;quantum.country&#x2F;qcvc" rel="nofollow">https:&#x2F;&#x2F;quantum.country&#x2F;qcvc</a> - if you can recommend more good resources, I&#x27;m all ears!
评论 #21383077 未加载
philzookover 5 years ago
Really interesting. Rust is on my radar. You might be interested in a post in Haskell that I made that has a similar feel.<p><a href="http:&#x2F;&#x2F;www.philipzucker.com&#x2F;functors-and-vectors&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.philipzucker.com&#x2F;functors-and-vectors&#x2F;</a>
Gonzihover 5 years ago
Oh thats pretty cool, wanted to subscribe to rss&#x2F;atom feed for a followup blog posts, but cant find any feed link. I hope i wont miss future posts in series.
reallydontaskover 5 years ago
<a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Bra%E2%80%93ket_notation" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Bra%E2%80%93ket_notation</a><p>I remember learning about this at uni in one of the more advanced QM modules.<p>I remember thinking: Seriously, couldn&#x27;t they&#x27;ve come up with a better name?
评论 #21378112 未加载
评论 #21383990 未加载