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

Refactor QuantumState::get_state #19

Closed kvark closed 4 years ago

kvark commented 4 years ago

(breaking change)

into_xxx is idiomatic way of showing that it consumes self. Boolean arguments are also an anti-pattern, since it's not clear what they mean at the invocation spot. Naming of Order and its variants likely needs to be changed to something better - suggestions welcome!

Renmusxd commented 4 years ago

I agree on all counts, will review the code either tonight or tomorrow. I may change "Order" to Representation (which more closely matches what you might say in a physics class, but is a little harder to follow code-wise) and add some more docs explaining the difference. Not sure yet though.

Renmusxd commented 4 years ago

Oh, and thanks for the pull request!