Skip to content

Losing QN information when reading from HDF5 #414

@Thomas-Kiely

Description

@Thomas-Kiely

I find that, when reading a QN Index object from an HDF5 file, the block structure is retained but I don't recover the quantum numbers associated with each block. For example,

auto io = Index(QN({"Sz",0}),1,QN({"Sz",-1}),1,QN({"Sz",+1}),1,Out,"index");
auto fo = h5_open("test.h5",'w');
h5_write(fo,"index",io);
close(fo);

auto fi = h5_open("test.h5",'r');
auto ii = h5_read<Index>(fi,"index");

println(ii == io);
println(ii);
println(io);

produces

1
(dim=3|id=34|"index") <Out>
  1: 1 QN()
  2: 1 QN()
  3: 1 QN()
(dim=3|id=34|"index") <Out>
  1: 1 QN({"Sz",0})
  2: 1 QN({"Sz",-1})
  3: 1 QN({"Sz",1})

I can read the same HDF5 file in Julia, however, where I recover the quantum numbers for each block. So this seems to be a problem with the C++ read function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions