150 karma · joined May 8, 2019
There are some rough edges around using `script` templates[2], for example it doesn't allow you to pass `this` and `arguments` from HTML event handlers[3]. This is not a show-stopper though, because you can always fall back to just defining your event handler in an HTML <script></script> block, albeit without type checking of the arguments and deduping the scripts. Also it hurts Locality of Behaviour which I'm a fan of.
That being said, I think it has some great potential. I can completely imagine people building fully-fledged UI libraries in this once component reusability is improved.
But the best part of using templ for me was that I could completely get rid of Node and NPM from my stack.
How was your experience?
[1]: https://templ.guide/syntax-and-usage/template-composition
[2]: https://templ.guide/syntax-and-usage/script-templates#script...
Funnily, the website seems to be crashing due to the API issues while the web server is at <1% CPU utilization.
Absolutely! I thought I could get away with just in-memory caching for the MVP but it looks like I can't.
eBay only allows 5000 API calls per day for most APIs useful to me which is very easy to hit: https://developer.ebay.com/develop/apis/api-call-limits
My infinite scrolling implementation probably didn't help either but I couldn't help myself, it was so easy to implement with HTMX.
I'm considering trying this with SQLite but I'm a bit worried about maintenance.
Which one of the basis states we end up measuring depends on the squared of the complex amplitude of that state (Born rule). Therefore, if you were to simulate a quantum computer, in the general case you would need to keep track of these complex amplitudes belonging to the states, every 2^n of them. Because of the real and imaginary parts this amounts to 2*2^n=2^(n+1) numbers.
To quote Nielsen & Chuang (section 1.4.2 on page 30):
> Quantum parallelism is a fundamental feature of many quantum algorithms. Heuristically, and at the risk of over-simplifying, quantum parallelism allows quantum computers to evaluate a function f(x) for many different values of x simultaneously. In this section we explain how quantum parallelism works, and some of its limitations.
Then they go on and explain how e.g. the Deutsch–Jozsa algorithm is a good example of this. But I think it's a key component in Shor's algorithm as well when it comes to the period-finding step.
Let's consider the execution of an algorithm. In the classical case you start with _one_ of 2^n states and keep evolving that single state. In the case of a quantum computer you can start with a superposition of all of the 2^n states and evolve them simultaneously. This is called quantum parallelism.
This sounds very powerful but comes with a caveat: at the end of the algorithm you will end up with some other superposition of the 2^n states but you can only read one of them. Which one it is going to be will be decided by the square of the complex amplitudes associated with those states. The greater the squared amplitude, the more likely it is that you will end up measuring the state associated with it. A key requirement when a quantum algorithm is designed is that it should yield a useful state at the time of measurement with high probability. This is in general difficult to do.
Can you elaborate on what grounds did your advisor disadvise you to follow academic schooling?
1. Nothing, which leaves the combined state unchanged: |00>+|11>.
2. Flip the sign of the base state |11>, thereby changing the combined state to |00>-|11>.
3. Flip the first bit which changes the combined state to |10>+|01>.
4. Perform choice 3 and flip the sign of base state |10>, which changes the combined state to -|10>+|01>.
Now notice that all 4 possible combined states are orthogonal to each other. But we reached each orthogonal state by manipulating only Alice's qubit. When Bob receives Alice's qubit he can put the 2 qubits together and see which state the combined system is in. You wouldn't be able to do this by sending a classical bit as that can't participate in entanglement. And entanglement is needed to access 4 different orthogonal states via manipulating just one qubit.