-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify the parser to make importing to Qiskit easier or possible (#201)
* Modify the parser to importing to Qiskit easier or possible The parser no longer is expected to parse bogus gate definitions from stdgates.inc. Rather, symbols are entered as if it had been parsed. This requires modifying how the Qiskit importer works. The main change here is implementing `SymbolTable::gates`. This returns some information on all gates found in the symbol table. Included is the minimal information required for the Qiskit importer to map `SymbolId`s to Qiskit gates. * A smaller convenience: Add GateDeclaration::num_params() for convenience * Remove `struct Identifier` from asg.rs As noted in a comment, having enum variants `Identifier(Identifier)` where the field is a `struct Identifier` is not necessary, unless we want to carry an extra copy of the name as a `String` for convenience. This is a big price to pay for this convenience, which has not been used for anything. This commit removes `struct Identifier`. This also makes asg.rs more consistent, since some of the variant already have the form `Identifier(SymbolIdResult)` * Update two out-of-date doc strings * Refactor symbol lookup for flexibility Looking up symbols has been refactored a bit. A method was added that either returns an existing binding or makes a new one. It always returns a `SymbolId` rather than a `Result<...>`. This method will be used for hardware qubits. * Remove methods rendered unneeded after changing data type The types of the fields of `Type::Gate` were changed to unsigned.
- Loading branch information
Showing
5 changed files
with
79 additions
and
78 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