TeamGraphix / graphix

measurement-based quantum computing (MBQC) compiler and simulator
https://graphix.readthedocs.io
Apache License 2.0
55 stars 20 forks source link

DensityMatrix backend fixes #76

Closed mgarnier59 closed 10 months ago

mgarnier59 commented 11 months ago

Before submitting, please check the following:

Then, please fill in below:

Context (if applicable): Density matrix backend.

Description of the change:

Related issue: None.

also see that checks (github actions) pass. If lint check keeps failing, try installing black==22.8.0 as behavior seems to vary across versions.

mgarnier59 commented 11 months ago

New commit solving the issues we mentionned as well as a few updates:

For the feature, maybe generic data validation like checking operators are square matrices of size $2^N \times 2^N$ can be mutualised with the density matrix that just adds further conditions on top of that (hermiticity, unit trace). Maybe put those methods in a specific file?

shinich1 commented 11 months ago

Nice! Will take a look through later.

Maybe put those methods in a specific file?

good idea, sounds like a portable feature outside this simulator. maybe a new file in in graphix/sim/?

mgarnier59 commented 11 months ago

good idea, sounds like a portable feature outside this simulator. maybe a new file in in graphix/sim/?

Actually I was thinking of it while working on the kraus.pyfile that requires the same types of checks. So either we move kraus (we might rename it) in graphix/sim/ or we include the checks in graphix/ but that doesn't really matter much.

shinich1 commented 11 months ago

@mgarnier59 maybe graphix/sim/quantum_channel.py, but as you say it does not matter much at this stage. let's continue with whatever that works for you, we then deal with file arrangement after all the implementation part is ready :)

shinich1 commented 10 months ago

@mgarnier59 I just assigned you to the PR (sorry I haven't done this yet). Do you see the button for squash and merge now?

mgarnier59 commented 10 months ago

@mgarnier59 I just assigned you to the PR (sorry I haven't done this yet). Do you see the button for squash and merge now?

@shinich1 Hey. Nope I don't see it. Maybe I don't have the correct rights?