Skip to content
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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Enhance proportionality #47

wants to merge 13 commits into from

Conversation

wjbs
Copy link
Collaborator

@wjbs wjbs commented Jan 16, 2025

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.

@adrianleh
Copy link
Member

Also please run static validation and fix issues

@wjbs
Copy link
Collaborator Author

wjbs commented Jan 19, 2025

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.

@adrianleh adrianleh mentioned this pull request Jan 21, 2025
Copy link
Member

@adrianleh adrianleh left a 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




Declare Custom Entry rwlist.
Copy link
Member

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?

Copy link
Collaborator Author

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.




Ltac tac_iter_simpl lst :=
Copy link
Member

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?

Copy link
Collaborator Author

@wjbs wjbs Jan 21, 2025

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.
Copy link
Member

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),
Copy link
Member

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

Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants