Skip to content

Commit 41b81e8

Browse files
Sampreetpiperfw
authored andcommitted
Add DEVELOPMENT.md with JAX info
1 parent 6f3aea1 commit 41b81e8

File tree

8 files changed

+19
-32
lines changed

8 files changed

+19
-32
lines changed

oqupy/backends/pt_tempo_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def compute_step(self) -> None:
288288
return self._step < self._num_steps
289289

290290
def get_mpo_tensor(self, step: int) -> ndarray:
291-
"""ToDo. """
291+
"""TODO. """
292292
n = len(self._mps.nodes)
293293
assert n == self._num_steps
294294
assert step < n

oqupy/backends/tempo_backend.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
os.environ['NUMPY_EXPERIMENTAL_ARRAY_FUNCTION'] = '0'
3131

32-
class TIBaseBackend: # ToDo: translate this numpy code into tensornetwork
32+
class TIBaseBackend: # TODO: translate this numpy code into tensornetwork
3333
"""
3434
Backend class for TEMPO.
3535
@@ -195,7 +195,7 @@ def _truncate_left(self, k) -> int:
195195

196196

197197
def initialise(self, step=None, mps=None) -> Tuple[int, ndarray]:
198-
""" ToDo """
198+
""" TODO """
199199
if mps is not None:
200200
self._mps = mps
201201
self._step = step
@@ -216,7 +216,7 @@ def initialise(self, step=None, mps=None) -> Tuple[int, ndarray]:
216216
self._step = 1
217217
return self._step, self.data[-1]
218218

219-
def compute_step(self) -> Tuple[int, ndarray]: # ToDo: make readout optional
219+
def compute_step(self) -> Tuple[int, ndarray]: # TODO: make readout optional
220220
"""
221221
Takes a step in the TEMPO tensor network computation.
222222
@@ -264,7 +264,7 @@ def compute_step(self) -> Tuple[int, ndarray]: # ToDo: make readout optional
264264
# turn east leg at last site into north leg at new last site
265265
self._mps.append(self._cap)
266266

267-
if len(self._mps) > self._kmax + 1: # ToDo: check this
267+
if len(self._mps) > self._kmax + 1: # TODO: check this
268268
# remove first site, turn into matrix
269269
end = self._mps.pop(0).sum(1)
270270
# np.dot into new first site
@@ -378,7 +378,7 @@ def step(self) -> int:
378378
return self._step
379379

380380
def initialize_mps_mpo(self):
381-
"""ToDo"""
381+
"""TODO"""
382382
self._initial_state = copy(self._initial_state).reshape(-1)
383383

384384
self._super_u = op.left_right_super(
@@ -588,7 +588,7 @@ def compute_system_step(self, current_step, prop_1, prop_2) -> ndarray:
588588

589589
class TempoBackend(BaseTempoBackend):
590590
"""
591-
ToDo
591+
TODO
592592
"""
593593

594594
def __init__(
@@ -620,7 +620,7 @@ def __init__(
620620

621621
def initialize(self) -> Tuple[int, ndarray]:
622622
"""
623-
ToDo
623+
TODO
624624
"""
625625
self._step = 0
626626
self.initialize_mps_mpo()
@@ -629,7 +629,7 @@ def initialize(self) -> Tuple[int, ndarray]:
629629

630630
def compute_step(self) -> Tuple[int, ndarray]:
631631
"""
632-
ToDo
632+
TODO
633633
"""
634634
self._step += 1
635635
prop_1, prop_2 = self._propagators(self._step - 1)

oqupy/control.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def add_continuous(
112112
control_fct: Callable[[ndarray, float], ndarray],
113113
post: Optional[bool] = False) -> None:
114114
"""
115-
ToDo
115+
TODO
116116
"""
117117
raise NotImplementedError()
118118

oqupy/pt_tempo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def __init__(
150150
self._init_pt_tempo_backend()
151151

152152
def _init_simple_process_tensor(self):
153-
"""ToDo. """
153+
"""TODO. """
154154
unitary = self._bath.unitary_transform
155155
if not np.allclose(unitary, np.identity(self._dimension)):
156156
transform_in = left_right_super(unitary.conjugate().T,
@@ -169,7 +169,7 @@ def _init_simple_process_tensor(self):
169169
description=self.description)
170170

171171
def _init_file_process_tensor(self, filename, overwrite):
172-
"""ToDo. """
172+
"""TODO. """
173173
unitary = self._bath.unitary_transform
174174
if not np.allclose(unitary, np.identity(self._dimension)):
175175
transform_in = left_right_super(unitary.conjugate().T,

oqupy/system.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ def get_propagators(
555555
dt: float,
556556
parameters: ndarray) -> Callable[[int], Tuple[ndarray,ndarray]]:
557557
"""
558-
ToDo
558+
TODO
559559
"""
560560
def propagators(step: int):
561561
"""Create the system propagators (first and second half) for
@@ -597,7 +597,7 @@ def get_propagator_derivatives(
597597
dt: float,
598598
parameters: ndarray) -> Callable[[int],Tuple[ndarray,ndarray]]:
599599
"""
600-
ToDo
600+
TODO
601601
"""
602602
if self._propagator_derivatives is not None:
603603
def propagator_derivatives_a(step: int):

oqupy/system_dynamics.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ def _compute_dynamics_input_parse(
559559

560560

561561
def _get_caps(process_tensors: List[BaseProcessTensor], step: int):
562-
"""ToDo """
562+
"""TODO """
563563
caps = []
564564
for i in range(len(process_tensors)):
565565
try:
@@ -576,7 +576,7 @@ def _get_caps(process_tensors: List[BaseProcessTensor], step: int):
576576

577577

578578
def _get_pt_mpos(process_tensors: List[BaseProcessTensor], step: int):
579-
"""ToDo """
579+
"""TODO """
580580
pt_mpos = []
581581
for i in range(len(process_tensors)):
582582
pt_mpo = process_tensors[i].get_mpo_tensor(step)
@@ -628,7 +628,7 @@ def _get_pt_mpos_backprop(mpo_list:ndarray, step: int):
628628

629629

630630
def _apply_system_superoperator(current_node, current_edges, sup_op):
631-
"""ToDo """
631+
"""TODO """
632632
if sup_op is None:
633633
return current_node, current_edges
634634
sup_op_node = tn.Node(sup_op.T)
@@ -640,7 +640,7 @@ def _apply_system_superoperator(current_node, current_edges, sup_op):
640640

641641

642642
def _apply_caps(current_node, current_edges, caps):
643-
"""ToDo """
643+
"""TODO """
644644
node_dict, edge_dict = tn.copy([current_node])
645645
for current_edge, cap in zip(current_edges[:-1], caps):
646646
cap_node = tn.Node(np.array(cap))

oqupy/tempo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ def coeffs(k):
579579

580580

581581
unitary_transform = self._bath.unitary_transform
582-
# ToDo: Unitary transform is not used. Check that GibbsTempo also works
582+
# TODO: Unitary transform is not used. Check that GibbsTempo also works
583583
# with non-diagonal coupling operators!!!
584584
if not np.allclose(unitary_transform,np.identity(self.dimension)):
585585
raise NotImplementedError(

oqupy/util.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,6 @@ def get_indices(
7272
# return the index matrix with shape (n_in, n_iters)
7373
return ((iteration_matrix / divisors).astype(int) % shape).T
7474

75-
def increase_list_of_index(
76-
a: List,
77-
shape: List,
78-
index: Optional[int] = -1) -> bool:
79-
"""Circle through a list of indices. """
80-
a[index] += 1
81-
if a[index] >= shape[index]:
82-
if index == -len(shape):
83-
return False
84-
a[index] = 0
85-
return increase_list_of_index(a, shape, index-1)
86-
return True
87-
8875
def add_singleton(
8976
tensor: ndarray,
9077
index: Optional[int] = -1) -> ndarray:

0 commit comments

Comments
 (0)