Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaceSun committed Dec 11, 2022
1 parent 567cf8b commit df66795
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tensorcircuit/circuit.py
Expand Up @@ -412,7 +412,9 @@ def step_function(x: Tensor) -> Tensor:
r = backend.convert_to_tensor(0.0)
else:
r = backend.sum(
backend.stack([backend.sign(x - prob_cumsum[i]) for i in range(l - 1)])
backend.stack(
[backend.sign(x - prob_cumsum[i]) for i in range(l - 1)]
)
)
r = backend.cast(r / 2.0 + (l - 1) / 2.0, dtype="int32")
# [0: kraus[0], 1: kraus[1]...]
Expand All @@ -433,6 +435,7 @@ def step_function(x: Tensor) -> Tensor:

def _general_kraus_tf(
self,
kraus: Sequence[Gate],
*index: int,
status: Optional[float] = None,
) -> float:
Expand Down

0 comments on commit df66795

Please sign in to comment.