Qaintum / Qaintessent.jl

Digital quantum circuit simulator written in Julia
Apache License 2.0
30 stars 8 forks source link

Code cleanup #91

Closed keefehuang closed 3 years ago

keefehuang commented 3 years ago

Major update to clean up code.

cmendl commented 3 years ago

Can we let matrix(g) (with 'g' some gate) return a dense matrix, and rename matrix(cg::CircuitGate) to sparsematrix(cg::CircuitGate)? Why is there a separate "_matrix" function for CircuitGate?

cmendl commented 3 years ago

The naming "size" in size(cg::CircuitGate) is a bit confusing; maybe rename to "required_wires" or similar?

cmendl commented 3 years ago

"get_data" at the end of gates.jl presumably no longer required...

cmendl commented 3 years ago

The naming "compile.jl" is somewhat confusing, rename to "unitary2circuit.jl" or similar?

cmendl commented 3 years ago

circuitgate.jl, line 77: Int[i for i in cg.iwire] can be replaced by collect(cg.iwire). (There might be other occurrences as well.)

cmendl commented 3 years ago

One level of indentation missing at cricuit.jl, line 164

keefehuang commented 3 years ago
cmendl commented 3 years ago

"get_data" at the end of gates.jl presumably no longer required...

can we remove get_data?