-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(badger):
cx
and rz
const functions and strategies for `Lexic…
…ographicCostFunction` (#625) A couple of points to note: 1. I've made some minor breaking changes to the Rust API of `LexicographicCostFunction`. I think it is cleaner now. 2. I had the choice between keeping `fn` pointers as the cost function type within `LexicographicCostFunction` or moving to `Box<Fn>`. I've stuck to the former for the moment, but I didn't figure out a simple way to reuse the same code for `Tk2Op::CX` and `Tk2Op::RzF64` without using closures. The current code has some duplication as a result, but I think it's bearable. 3. I've tried running badger with `cost_fn='rz'`, but the Rz gate count does not decrease at all. I've looked for an obvious bug but I don't think it is within these changes... Let me know if you disagree with 1. or 2 and what you think we should do about 3. --- ### Changelog metadata BEGIN_COMMIT_OVERRIDE feat: `BadgerOptimiser.load_precompiled`, `BadgerOptimiser.compile_eccs` and `passes.badger_pass` now take an optional `cost_fn` parameter to specify the cost function to minimise. Supported values are `'cx'` (default behaviour) and `'rz'`. END_COMMIT_OVERRIDE --------- Co-authored-by: Agustín Borgna <[email protected]>
- Loading branch information
Showing
5 changed files
with
150 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters