Skip to content
This repository was archived by the owner on Dec 7, 2021. It is now read-only.

Commit 4e84910

Browse files
committed
Remove Optional type hint where not applicable
1 parent 54db503 commit 4e84910

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

qiskit/chemistry/drivers/fcidumpd/dumper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
def dump(outpath: str, norb: int, nelec: int, hijs: List[float], hijkls: List[float], einact: float,
24-
ms2: Optional[int] = 0, orbsym: Optional[List[int]] = None, isym: Optional[int] = 1
24+
ms2: int = 0, orbsym: Optional[List[int]] = None, isym: int = 1
2525
) -> None:
2626
# pylint: disable=wrong-spelling-in-docstring
2727
"""Generates a FCIDump output.
@@ -70,7 +70,7 @@ def dump(outpath: str, norb: int, nelec: int, hijs: List[float], hijkls: List[fl
7070

7171

7272
def _dump_1e_ints(hij: List[float], mos: List[int], outfile: TextIOWrapper,
73-
beta: Optional[bool] = False) -> None:
73+
beta: bool = False) -> None:
7474
idx_offset = 1 if not beta else 1+len(mos)
7575
hij_elements = set()
7676
for i, j in itertools.product(mos, repeat=2):
@@ -84,7 +84,7 @@ def _dump_1e_ints(hij: List[float], mos: List[int], outfile: TextIOWrapper,
8484

8585

8686
def _dump_2e_ints(hijkl: List[float], mos: List[int], outfile: TextIOWrapper,
87-
beta: Optional[int] = 0) -> None:
87+
beta: int = 0) -> None:
8888
idx_offsets = [1, 1]
8989
for b in range(beta):
9090
idx_offsets[1-b] += len(mos)

qiskit/chemistry/drivers/fcidumpd/fcidumpdriver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def run(self) -> QMolecule:
9090

9191
@staticmethod
9292
def dump(q_mol: QMolecule, outpath: str, orbsym: Optional[List[int]] = None,
93-
isym: Optional[int] = 1) -> None:
93+
isym: int = 1) -> None:
9494
"""Convenience method to produce an FCIDump output file.
9595
9696
Args:

qiskit/chemistry/drivers/fcidumpd/parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
"""FCIDump parser."""
1616

17-
from typing import Any, Dict, List, Optional, Set
17+
from typing import Any, Dict, List, Set
1818
import itertools
1919
import re
2020
import numpy as np
@@ -196,15 +196,15 @@ def parse(fcidump: str) -> Dict[str, Any]:
196196

197197

198198
def _permute_1e_ints(hij: List[float], elements: Set[int], norb: int,
199-
beta: Optional[bool] = False) -> None:
199+
beta: bool = False) -> None:
200200
for elem in elements.copy():
201201
shifted = tuple(e-(beta * norb) for e in elem)
202202
hij[shifted] = hij[shifted[::-1]]
203203
elements.remove(elem)
204204

205205

206206
def _permute_2e_ints(hijkl: List[float], elements: Set[int], norb: int,
207-
beta: Optional[bool] = False) -> None:
207+
beta: bool = False) -> None:
208208
# pylint: disable=wrong-spelling-in-comment
209209
for elem in elements.copy():
210210
shifted = tuple(e-((e >= norb) * norb) for e in elem)

0 commit comments

Comments
 (0)