Skip to content

Implemeting TTI-PTs#158

Open
emile-cochin wants to merge 30 commits intotempoCollaboration:mainfrom
emile-cochin:iTEBD
Open

Implemeting TTI-PTs#158
emile-cochin wants to merge 30 commits intotempoCollaboration:mainfrom
emile-cochin:iTEBD

Conversation

@emile-cochin
Copy link

Summary

Pull request for implementing time-translationally invariant process tensors (TTI-PTs) into OQuPy, as agreed in #155.

Pull Request Check List

This checklist serves as a guide for contributors and maintainers to assess
whether a contribution can be merged into the main branch and thus serves
to guarantee the quality of the package. Please read the
contribution guideline.

Before you submit a pull request, please go through this checklist once
more, as it will decrease the number of unnecessary review cycles.
However, this list is there to help all contributors to produce high
quality code, not to deter you from contributing. If you can't tick some of the
boxes, feel free to submit the pull request anyway and report about it in the
pull request message. Also, some of the boxes might not apply to the specific
type of your contribution.

  • The contribution has been discussed and agreed on in the Issue section.
  • Code contributions do its best to follow the zen of python.
  • The automated test are all positive:
    • tox -e py36 (to run pytest) the code tests.
    • tox -e style (to run pylint) the code style tests.
  • Added test for changed/added code.
  • The documentation has been updated:
    • docstring for all new functions/methods/classes/modules.
    • consistent style of all docstrings.
    • for new modules: /docs/pages/modules.rst has been updated.
    • for new functionality: /docs/pages/api.rst has been updated.
    • for new functionality: tutorials and examples have been updated.

@gefux gefux self-assigned this Feb 23, 2026
@gefux gefux added the enhancement New feature or request label Feb 23, 2026
paulreastham and others added 28 commits March 2, 2026 00:23
…of time dependent Hamiltonian to iTEBD-example
Modified example to use this capability.
@gefux
Copy link
Member

gefux commented Mar 1, 2026

Hi @emile-cochin! Thank you for submitting this pull request and sorry for the delayed reply. Because several of the changes that need to be made are of a type that is easier for me to quickly carry out rather then explain, I'd like to continue my go-over this code myself before we start code review together. I'll get back to you sometime this week. Best -- gefux

@gefux gefux self-requested a review March 6, 2026 10:32
Copy link
Member

@gefux gefux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @emile-cochin. Thank you for this.
I made some comments with suggestions for the core functionality.
Beside this there are a few other topics, which we'll maybe resolve in another round of review later, but I mention here for completness:

  • Create coverage test
  • Create physics tests
  • Create a tutorial
  • Fix code style (linter)
  • [Optional] some performance testing

progress = get_progress(None)
title = "--> TTI-TEMPO building:"
with progress(self.n_c, title) as prog_bar:
for k in range(1, self.n_c +1):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be accessible / interuptable by the user. For all computationally heavy calculations we want allow the user checkpointing, i.e. for a memory cutoff of 200 they should be able to save the python object and environment when they have done 100 steps, and then continue.

This is not a high priority, but I think this backend should be restructured such that there is an compute_step() method, that just computes the next step, and the loop (including the progress bar) should be moved into a TTITempo.compute() method.

aim = np.concatenate((np.flip(self.eta[:n].imag), np.zeros(n)))
return np.exp(-np.dot(s_diff_path, np.convolve(are, s_diff_path, 'valid')[:n]) - 1j * np.dot(s_diff_path, np.convolve(aim, s_sum_path, 'valid')[:n]))

def evolve(self, h_s: np.ndarray, rho_0: np.ndarray, n: int) -> np.ndarray:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this method, right?
The TTI process tensor should work smoothly with our compute_dynamics() function.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, that method is just left from Link's original code and is not needed/used.


return rho_t

def steadystate(self, h_s: np.ndarray) -> np.ndarray:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This I would to also like to see outside of the backend as a function compute_steady_state() in system_dynamics.py using a TTI process tensor and a oqupy.System object.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree but perhaps in another pull request? This is another leftover from Link's original code. If we wanted this functionality in OQuPy I agree it should take an oqupy.System object (and account for e.g. the Liouvillian dissipators).

return self._dt

@property
def max_step(self) -> Union[int, float]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am makeing a comment on the Process Tensor classes in the #155 issue thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants