Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type hints in python wrapper for noisy simulator. #1857

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
orpuente-MS marked this conversation as resolved.
Show resolved Hide resolved
"""
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
Loading