Renmusxd / RustQIP

Quantum computing using rust. Efficient and a borrow-checked no cloning theorem!
https://docs.rs/qip/
MIT License
223 stars 18 forks source link

Add bell inequality example #31

Closed oxarbitrage closed 2 years ago

oxarbitrage commented 2 years ago

I was testing the bell inequality in the simulator and i ended up with some decent code to present as an example. Feel free to do whatever you prefer with it.

This example is based on the circuits presented in https://arxiv.org/pdf/1712.05642.pdf

Renmusxd commented 2 years ago

I'll need to check these when I'm back at my work computer later this week but I really like the idea. I'll get back to you soon.

Renmusxd commented 2 years ago

Ok! All looks good. This also makes me think of two things that the library really should have: noise 'gates' to simulate real machines. This would let you check how quickly results like this break down with environmental noise (related to #12 and #16). Also there should be a way to add arguments to gates in the program! macro to do things like Rz(theta).