Skip to content

fix: fix simplification so that a/(bc) = (a/b)/c #442

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

Merged
merged 3 commits into from
Mar 5, 2025

Conversation

antalsz
Copy link
Contributor

@antalsz antalsz commented Mar 5, 2025

Now, expression simplification will try to simplify a / (b * c) to (a / b) / c.

Previously, it would try to simplify to (a / b) * c instead.

(Expression simplification already correctly simplifies (x * y) / z to x * (y / z).)

Copy link

github-actions bot commented Mar 5, 2025

PR Preview Action v1.6.0

🚀 View preview at
https://rigetti.github.io/quil-rs/pr-preview/pr-442/

Built to branch quil-py-docs at 2025-03-05 17:15 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@antalsz antalsz force-pushed the 441-div-by-mul-simplification branch from 5de4684 to bc97fb9 Compare March 5, 2025 17:14
"4 / (2 * x)",
"2 / x"
}

// TODO doesn't fully simplify in a reasonable amount of recursion
// test_simplify! {
// the_big_one,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we want the big one!!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I've been working on recently, actually! Fingers crossed

@antalsz antalsz merged commit 370d8d1 into main Mar 5, 2025
11 of 14 checks passed
@antalsz antalsz deleted the 441-div-by-mul-simplification branch March 5, 2025 17:25
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