-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing more bugs in emulator. (#614)
* making detuning matrix elements negative. * mising factor of 2 in rabi amplitude. * add integration test comparing braket to bloqade emulator. * removing extra sorting in KS test impl. * adding check for bounds in locations. * adding visitor to check if sequence has hyperfine coupling. * fixing some bugs in local drives. * making tests shorter, adding scipy KS test * reduce shots counts * reducing test time for emulator. * adding integration tests for emulator ir codegen (#623) * update `LocalBatch` annotation.
- Loading branch information
Showing
7 changed files
with
413 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from typing import Any | ||
import bloqade.ir.analog_circuit as analog_circuit | ||
import bloqade.ir.control.sequence as sequence | ||
from bloqade.ir.visitor.analog_circuit import AnalogCircuitVisitor | ||
|
||
|
||
class IsHyperfineSequence(AnalogCircuitVisitor): | ||
def __init__(self): | ||
self.is_hyperfine = False | ||
|
||
def visit_analog_circuit(self, ast: analog_circuit.AnalogCircuit) -> Any: | ||
self.visit(ast.sequence) | ||
|
||
def visit_append_sequence(self, ast: sequence.Append) -> Any: | ||
list(map(self.visit, ast.sequences)) | ||
|
||
def visit_slice_sequence(self, ast: sequence.Slice) -> Any: | ||
self.visit(ast.sequence) | ||
|
||
def visit_named_sequence(self, ast: sequence.NamedSequence) -> Any: | ||
self.visit(ast.sequence) | ||
|
||
def visit_sequence(self, ast: sequence.Sequence) -> Any: | ||
self.is_hyperfine = self.is_hyperfine or sequence.hyperfine in ast.pulses | ||
|
||
def emit(self, ast: analog_circuit.AnalogCircuit) -> bool: | ||
self.visit(ast) | ||
return self.is_hyperfine |
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
Oops, something went wrong.