-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: support non-contiguous qubit indices local simulator (#262)
* feature: support non-contiguous qubit indices local simulator * Fix lint * Convert to classmethod * Fix black * Map IR inplace * Remove unused import * Remove qubit set sorted assumption * Remove test * Support Jaqcd discontiguous qubits * Add discontiguous qubits test * Add discontiguous qubits test * Refactor to fixture * Fix discontiguous qubits targets mapping * Fix lint * fix lint * Remove check for discontiguous qubit * Remove discontiguous qubits check * Make private * Remove redudant basis rotation prop check * Add OpenQASM discontiguous qubits test * Refactor to static * Make code understable * Improve coverage * Fix Jaqcd result mapping * Handle Jaqcd result instructions target * Handle invalid qubit * Add test for targets * Remove unnecessary mapping * Apply suggestions from code review --------- Co-authored-by: Cody Wang <speller26@gmail.com>
- Loading branch information
Showing
7 changed files
with
259 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
OPENQASM 3.0; | ||
bit[2] b; | ||
qubit[5] q; | ||
h q[2]; | ||
cnot q[2], q[3]; | ||
b = measure q; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"braketSchemaHeader": {"name": "braket.ir.jaqcd.program", "version": "1"}, | ||
"instructions": [ | ||
{"target": 2, "type": "x"}, | ||
{"control": 2, "target": 9, "type": "cnot"} | ||
], | ||
"results": [], | ||
"basis_rotation_instructions": [] | ||
} |
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