diff --git a/src/braket/aws/aws_device.py b/src/braket/aws/aws_device.py index 7fd458710..229fc1a6c 100644 --- a/src/braket/aws/aws_device.py +++ b/src/braket/aws/aws_device.py @@ -49,6 +49,7 @@ from braket.devices import Devices from braket.devices.device import Device from braket.emulators import Emulator +from braket.emulators.emulator_passes import ProgramType from braket.ir.blackbird import Program as BlackbirdProgram from braket.ir.openqasm import Program as OpenQasmProgram from braket.parametric.free_parameter import FreeParameter @@ -931,9 +932,9 @@ def validate( self.emulator.run_validation_passes(task_specification) return - def run_emulator_passes[ - ProgramType - ](self, task_specification: ProgramType, apply_noise_model: bool = True) -> ProgramType: + def run_emulator_passes( + self, task_specification: ProgramType, apply_noise_model: bool = True + ) -> ProgramType: """ Runs all emulator passes and returns the modified program, which should be the same type as the input program. diff --git a/src/braket/emulators/emulator_interface.py b/src/braket/emulators/emulator_interface.py index 7a079c3d4..47a163285 100644 --- a/src/braket/emulators/emulator_interface.py +++ b/src/braket/emulators/emulator_interface.py @@ -3,7 +3,7 @@ from abc import ABC from typing import Iterable, Union -from braket.emulators.emulator_passes import EmulatorPass +from braket.emulators.emulator_passes import EmulatorPass, ProgramType from braket.emulators.emulator_passes.criteria import EmulatorCriterion @@ -11,7 +11,7 @@ class EmulatorInterface(ABC): def __init__(self, emulator_passes: Iterable[EmulatorPass] = None): self._emulator_passes = emulator_passes if emulator_passes is not None else [] - def run_program_passes[ProgramType](self, task_specification: ProgramType) -> ProgramType: + def run_program_passes(self, task_specification: ProgramType) -> ProgramType: """ This method passes the input program through the EmulatorPasses contained within this emulator. An emulator pass may simply validate a program or may @@ -27,7 +27,7 @@ def run_program_passes[ProgramType](self, task_specification: ProgramType) -> Pr task_specification = emulator_pass(task_specification) return task_specification - def run_validation_passes[ProgramType](self, task_specification: ProgramType) -> None: + def run_validation_passes(self, task_specification: ProgramType) -> None: """ This method passes the input program through EmulatorPasses that perform only validation, without modifying the input program.