Skip to content

Commit

Permalink
Fix typing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
yao-cqc committed Oct 31, 2023
1 parent dfabe4f commit 5c0ad12
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pytket/extensions/qulacs/backends/qulacs_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""Methods to allow tket circuits to be ran on the Qulacs simulator
"""

from typing import List, Optional, Sequence, Union, cast
from typing import List, Optional, Sequence, Union, Type, cast
from logging import warning
from random import Random
from uuid import uuid4
Expand Down Expand Up @@ -126,6 +126,7 @@ def __init__(
self._GATE_SET,
)
self._result_type = result_type
self._sim: Type[Union[QuantumState, DensityMatrix, "QuantumStateGpu"]]
if result_type == "state_vector":
self._sim = QuantumState
elif result_type == "density_matrix":
Expand Down Expand Up @@ -211,9 +212,9 @@ def process_circuits(
)
qulacs_circ.update_quantum_state(qulacs_state)
if self._result_type == "state_vector":
state = qulacs_state.get_vector()
state = qulacs_state.get_vector() # type: ignore
else:
state = qulacs_state.get_matrix()
state = qulacs_state.get_matrix() # type: ignore
qubits = sorted(circuit.qubits, reverse=False)
shots = None
bits = None
Expand Down

0 comments on commit 5c0ad12

Please sign in to comment.