Skip to content

Commit

Permalink
Fix type hints in python wrapper for noisy simulator. (#1857)
Browse files Browse the repository at this point in the history
Fixes some type hints in the python wrapper for the noisy simulators.
  • Loading branch information
orpuente-MS authored Aug 20, 2024
1 parent 897a397 commit e6af3bd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pip/qsharp/noisy_simulator/_noisy_simulator.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class DensityMatrixSimulator:
"""
...

def sample_instrument(self, instrument: Instrument, qubits: List[int]):
def sample_instrument(self, instrument: Instrument, qubits: List[int]) -> int:
"""
Performs selective evolution under the given instrument.
Returns the index of the observed outcome.
Expand All @@ -142,7 +142,7 @@ class DensityMatrixSimulator:
"""
...

def set_state(self) -> None:
def set_state(self, state: DensityMatrix) -> None:
"""
Set state of the quantum system to another `DensityMatrix` of the
same dimensions.
Expand Down Expand Up @@ -210,22 +210,22 @@ class StateVectorSimulator:
"""
...

def sample_instrument(self, instrument: Instrument, qubits: List[int]):
def sample_instrument(self, instrument: Instrument, qubits: List[int]) -> int:
"""
Performs selective evolution under the given instrument.
Returns the index of the observed outcome.
Use this method to perform measurements on the quantum system.
"""

def get_state(self) -> Optional[DensityMatrix]:
def get_state(self) -> Optional[StateVector]:
"""
Returns the `StateVector` if the simulator is in a valid state,
otherwise returns None.
"""
...

def set_state(self) -> None:
def set_state(self, state: StateVector) -> None:
"""
Set state of the quantum system to another `StateVector` of the
same dimensions.
Expand Down

0 comments on commit e6af3bd

Please sign in to comment.