Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when loading a process tensor from file #73

Closed
gefux opened this issue Oct 7, 2022 · 0 comments · Fixed by #74
Closed

Bug when loading a process tensor from file #73

gefux opened this issue Oct 7, 2022 · 0 comments · Fixed by #74
Labels
bug Something isn't working

Comments

@gefux
Copy link
Member

gefux commented Oct 7, 2022

I've found a bug when loading a process tensor with non-diagonal coupling from a file.

Here is a (minimal) failing example:

import oqupy

TEMP_FILE = "./temp-process-tensor.hdf5"

system = oqupy.System(oqupy.operators.sigma("x"))
initial_state = oqupy.operators.spin_dm("z+")
correlations = oqupy.PowerLawSD(
    alpha=0.3,
    zeta=1.0,
    cutoff=5.0,
    cutoff_type="exponential",
    temperature=0.2,
    name="ohmic")bath = oqupy.Bath(
    0.5*oqupy.operators.sigma("x"),
    correlations)
tempo_params = oqupy.TempoParameters(
    dt=0.1,
    dkmax=5,
    epsrel=10**(-5))
pt = oqupy.pt_tempo_compute(
    bath,
    start_time=0.0,
    end_time=0.3,
    process_tensor_file=TEMP_FILE,
    overwrite=True,
    parameters=tempo_params)
del pt

pt = oqupy.import_process_tensor(TEMP_FILE, process_tensor_type="file")

This is the output:

--> PT-TEMPO computation:
100.0%    2 of    2 [########################################] 00:00:00
Elapsed time: 0.0s
Traceback (most recent call last):
  File "./examples/fail.py", line 33, in <module>
    pt = oqupy.import_process_tensor(TEMP_FILE, process_tensor_type="file")
  File "./oqupy/process_tensor.py", line 729, in import_process_tensor
    pt_file = FileProcessTensor(mode="read", filename=filename)
  File "./oqupy/process_tensor.py", line 457, in __init__
    dictionary = self._read_file(filename)
  File "./oqupy/process_tensor.py", line 536, in _read_file
    if transform_in == 0.0:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
@gefux gefux added the bug Something isn't working label Oct 7, 2022
@gefux gefux mentioned this issue Oct 7, 2022
7 tasks
@gefux gefux closed this as completed in #74 Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant