-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance proportionality #47
base: main
Are you sure you want to change the base?
Conversation
…itted as they are proven with alternate methods in feature-permutations
Also please run static validation and fix issues |
CI is currently failing because the Qlib version bump hasn't gone into opam yet. Once it does, the CI will start failing because SQIR doesn't work with the new Qlib, until the SQIR PR with the fixes is merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See line comments. Great additions; just might want some comments so we can maintain the Ltacs going forward
src/CoreData/Proportional.v
Outdated
|
||
|
||
|
||
Declare Custom Entry rwlist. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Genuine question: What's the benefit of this over notations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's quite similar to just notations, but restricted to a specific domain so that we don't pollute or compete with the rest of the term grammar. I was also attempting to get these things to not evaluate too much too soon, but that wasn't successful (in Ltac1). Moreover, I don't know how to (ergonomically) use an Ltac2-based solution without switching over to Ltac2 completely within a proof, which is not infeasible or necessarily too much work, but it has bad version compatibility and has lots of little incompatibilities. Finally, since the final zxrewrite
tactic is only used in a handful of places, I didn't optimize for making it particularly powerful.
src/CoreData/Proportional.v
Outdated
|
||
|
||
|
||
Ltac tac_iter_simpl lst := |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain/comment what is happening in L440-L590?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much of this is an attempt to do a general rewrite tactic (allowing modifiers like multiple rewriting, direction changing, etc.) in Ltac1, when Ltac2 is really needed for a lot of that functionality. I'll remove what isn't used and comment what is.
@@ -1,485 +1,55 @@ | |||
From QuantumLib Require Import Matrix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for moving this to QLib!
simpl. | ||
apply Z_0_is_wire. | ||
Qed. | ||
|
||
Lemma stack_nwire_distribute_r : forall {n m o p} (zx0 : ZX n m) (zx1 : ZX m o), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to keep this diagrammatic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch; I'll revert.
Add notions of semantic equality and of proportionality up to a designated constant, along with tactic support for both. Also prove soundness of proportionality / reconstruction of constants, leading ultimately also the the decidability of proportionality (though this is highly inefficient, and in fact ineffective due to an opaque definition in QuantumLib).
Note: This PR is incomplete. It needs further description and several main theorems are
Admitted
.