Skip to content

Commit cd2f3d4

Browse files
committed
fix: fix type annotations
1 parent 64919c2 commit cd2f3d4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

torchquantum/plugin/qiskit/qiskit_plugin.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222
SOFTWARE.
2323
"""
24+
from __future__ import annotations
2425

25-
from typing import Iterable
26+
from typing import Iterable, Optional
2627

2728
import numpy as np
2829
import qiskit
@@ -837,7 +838,7 @@ def qiskit2tq_translate_qiskit_params(
837838

838839

839840
def qiskit2tq(
840-
circ: QuantumCircuit, initial_parameters: list[torch.nn.Parameter] | None = None
841+
circ: QuantumCircuit, initial_parameters: Optional[list[torch.nn.Parameter]] = None
841842
):
842843
ops = qiskit2tq_Operator(circ, initial_parameters)
843844
return tq.QuantumModuleFromOps(ops)

0 commit comments

Comments
 (0)