I wanted to work on something using rust to mostly learn more about Rust because of peer pressure. I feel like most of the code was a lot of math, and because
rust does not have the support for math libraries like python does, it was pretty hard.
If I had numpy, most of the code wouldn't have to be written. (But I wouldn't learn about Rust either so I guess everything has a silver lining)
I am not a physicist. I might be wrong on the assumptions I make.
But, from what I can understand, a qubit from a software perspective is a more complex bit and quantum registers can just be represented as a matrix.
So at its core, to simulate the actions of a quantum computer from a classical computer, all that it likely required is to use linear algebra to manipulate the Matrices properly
The basic design of the code is this :
First of all, I guarantee that the most of the code I wrote for my linear algebra is likely ineffcient. To be fair I didn't write this program for performance. That should be fixed, I'll probably never come back to it.
I first had to figure out how to implement a quantum register. Should I do it as a vector of Qubits, or as a Vector of floats?
This one I had to choose a vector of floats because to get the vector, you eventually have to get the kronecker product and the conversion to a kronecker product can't be reversed.
From a OOP perspective, it would have been better to try to use a vector of qubits but, to implement the changes of a quantum gate on the register would require the kronecker product and this conversion cannot be undone.
I guess this is more of a TODO, but I have implemented the tools I would need to implement Shor's Algorithm, but I haven't actually implemented the code at all. At this point the code is mostly a matrix multiplcation library with a few tweaks for quantum computing simulation.
If I haven't implemented an algorithm, why would I write this Blog post?
One, I would like some help if possible. Here's the git repository
Two, I feel like writing this blog post will make me work through this final hump.
That is all for this month. Goodbye.