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.

Qusim.py – A toy multi-qubit quantum computer simulator written in Python

242 pointsby adamisntdeadabout 7 years ago

5 comments

ahelwerabout 7 years ago
For the uninitiated - to simulate a basic quantum computer, all you need is the following:<p>* A product state vector, which is a vector of size 2^n filled with complex numbers where n is the number of qbits you&#x27;re using. You derive the product state from a series of individual qbits by taking their tensor product; this exponential term is why simulating quantum computers takes exponential space.<p>* A set of common quantum logic gates, which are (2^n)x(2^n) matrices you multiply against the product state vector to derive the new product state vector; these matrices must be <i>unitary</i> (their conjugate-transpose is their inverse) (edited, see [0]) and therefore reversible (quantum computers are reversible computers). The full (2^n)x(2^n) matrices are derived by taking the tensor products of several 2x2 and 4x4 matrices.<p>* The measurement logic, where you calculate how the product state collapses by taking the square of the absolute value of each entry in the product state (these entries are called amplitudes).<p>This project is an implementation of those three things in Python. There is nothing special about the above mathematical constructs save that they match the observed semantics of a quantum system. This is good! Quantum computing is accessible to anyone who has taken a basic undergraduate course in linear algebra.<p>[0] I previously believed all quantum operators were their own inverses (Unitary and Hermitian) but apparently that is not the case; see comments below.
评论 #16800002 未加载
评论 #16797451 未加载
评论 #16797680 未加载
评论 #16797493 未加载
评论 #16797612 未加载
评论 #16797746 未加载
评论 #16800506 未加载
da-baconabout 7 years ago
Cool! My April fools day joke this year was a quantum programming language made up entirely of &quot;entanglement&quot; and &quot;superposition&quot;: <a href="https:&#x2F;&#x2F;github.com&#x2F;dabacon&#x2F;qsel" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dabacon&#x2F;qsel</a> The simulator takes about 150 lines of python as well.
评论 #16798147 未加载
laughingman2about 7 years ago
There is this quote by Jürgen Schmidhuber, director at the Swiss AI Lab IDSIA , creator of LSTM Neural Nets that power many of our current machine learning applications.<p>&quot; General purpose quantum computation won’t work (my prediction of 15 years ago is still standing). Related: The universe is deterministic, and the most efficient program that computes its entire history is short and fast, which means there is little room for true randomness, which is very expensive to compute. What looks random must be pseudorandom, like the decimal expansion of Pi, which is computable by a short program. Many physicists disagree, but Einstein was right: no dice. There is no physical evidence to the contrary randomness.html[<a href="http:&#x2F;&#x2F;people.idsia.ch&#x2F;~juergen&#x2F;randomness.html" rel="nofollow">http:&#x2F;&#x2F;people.idsia.ch&#x2F;~juergen&#x2F;randomness.html</a>].<p>For example, Bell’s theorem does not contradict this. And any efficient search in program space for the solution to a sufficiently complex problem will create many deterministic universes like ours as a by-product. Think about this. More here computeruniverse.html [<a href="http:&#x2F;&#x2F;people.idsia.ch&#x2F;~juergen&#x2F;computeruniverse.html" rel="nofollow">http:&#x2F;&#x2F;people.idsia.ch&#x2F;~juergen&#x2F;computeruniverse.html</a>] and here.<p>&quot;<p>I am out of depth with regards to quantum theory and quantum computation. If anyone with better knowledge with regards to quantum computation can clarify it would be great.<p>Is there any rationale to support Schmidhuber&#x27;s argument, and has any advance in making actual quantum computers disprove his theory?
评论 #16799419 未加载
评论 #16799064 未加载
评论 #16799759 未加载
评论 #16799917 未加载
评论 #16798937 未加载
mentosabout 7 years ago
Is it possible that a massive array of GPUs might be more economical than a few real quantum chips that need to be cooled to absolute zero?
评论 #16798032 未加载
评论 #16799729 未加载
评论 #16798006 未加载
nathanshammahabout 7 years ago
If you’re interested in quantum tech, here is my newsletter <a href="https:&#x2F;&#x2F;medium.com&#x2F;quantum-tech" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;quantum-tech</a><p>You can subscribe here <a href="http:&#x2F;&#x2F;eepurl.com&#x2F;c10FJz" rel="nofollow">http:&#x2F;&#x2F;eepurl.com&#x2F;c10FJz</a>