Skip to content

Commit

Permalink
Merge branch 'cm/krauss_ops' of github.com:pasqal-io/horqrux into cm/…
Browse files Browse the repository at this point in the history
…krauss_ops
  • Loading branch information
Charles MOUSSA committed Jan 8, 2025
2 parents 07db5e0 + 6155c78 commit 58954e9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion horqrux/primitive.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ def I(
def X(
target: TargetQubits, control: ControlQubits = (None,), noise: NoiseProtocol = None
) -> Primitive:
"""X gate. This function returns an instance of 'Primitive' and does *not* apply the gate.
"""The definition for the X gate.
This function returns an instance of 'Primitive' and does *not* apply the gate.
By providing tuple of ints to 'control', it turns into a controlled gate.
Example usage: X(1) represents the instruction to apply X to qubit 1.
Expand Down
2 changes: 1 addition & 1 deletion horqrux/shots.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def eigen_probabilities(state: Any, eigvecs: Array) -> Array:
Returns:
Array: The probabilities.
"""
raise NotImplementedError("prod_eigenvectors_state is not implemented")
raise NotImplementedError(f"prod_eigenvectors_state is not implemented for the state type {type(state)}.")


@eigen_probabilities.register
Expand Down
2 changes: 1 addition & 1 deletion horqrux/utils_noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def PauliChannel(error_probability: tuple[float, ...]) -> tuple[Array, ...]:
raise ValueError("The sum of probabilities can't be greater than 1.0")
for probability in error_probability:
if (probability > 1.0) or (probability < 0.0):
raise ValueError("The probability values are not correct probabilities")
raise ValueError(f"The error probability values are incorrect. Got {probability}.")
px, py, pz = (
error_probability[0],
error_probability[1],
Expand Down

0 comments on commit 58954e9

Please sign in to comment.