except IndexError:
        iom.open_file()

    # Iterate over all blocks
    for blockid in iom.get_block_ids():
        print("Computing the norms in data block '"+str(blockid)+"'")

        if iom.has_norm(blockid=blockid):
            print("Datablock '"+str(blockid)+"' already contains norm data, silent skip.")
            continue

        # TODO: Add new algorithms here

        # We test for an inhomogeneous wavepacket next
        if iom.has_inhomogwavepacket(blockid=blockid):
            import NormWavepacket
            NormWavepacket.compute_norm_inhawp(iom, blockid=blockid)
        # We test for a homogeneous wavepacket next
        elif iom.has_wavepacket(blockid=blockid):
            import NormWavepacket
            NormWavepacket.compute_norm_hawp(iom, blockid=blockid)
        # We have no wavepacket, then we try for a wavefunction
        elif iom.has_wavefunction(blockid=blockid):
            import NormWavefunction
            NormWavefunction.compute_norm(iom, blockid=blockid)
        # If there is also no wavefunction, then there is nothing to compute the norm
        else:
            print("Warning: Not computing any norm in block '"+str(blockid)+"'!")

    iom.finalize()
Example #2
0
# Which blocks to handle
if "all" in args.blockid:
    blocks_to_handle = iom.get_block_ids()
else:
    blocks_to_handle = map(int, args.blockid)

# Iterate over all blocks
for blockid in blocks_to_handle:
    print("Computing the norms in data block '"+str(blockid)+"'")

    if iom.has_norm(blockid=blockid):
        print("Datablock '"+str(blockid)+"' already contains norm data, silent skip.")
        continue

    # NOTE: Add new algorithms here

    if iom.has_wavepacket(blockid=blockid):
        import NormWavepacket
        NormWavepacket.compute_norm_hawp(iom, blockid=blockid, eigentrafo=False)
    elif iom.has_wavefunction(blockid=blockid):
        import NormWavefunction
        NormWavefunction.compute_norm(iom, blockid=blockid, eigentrafo=False)
    elif iom.has_inhomogwavepacket(blockid=blockid):
        import NormWavepacket
        NormWavepacket.compute_norm_inhawp(iom, blockid=blockid, eigentrafo=False)
    else:
        print("Warning: Not computing any norm in block '"+str(blockid)+"'!")

iom.finalize()
Example #3
0
            print("Datablock '" + str(blockid) +
                  "' already contains norm data, silent skip.")
            continue

        # TODO: Add new algorithms here

        # We test for an inhomogeneous wavepacket next
        if iom.has_inhomogwavepacket(blockid=blockid):
            import NormWavepacket
            NormWavepacket.compute_norm_inhawp(iom,
                                               blockid=blockid,
                                               eigentrafo=False)
        # We test for a homogeneous wavepacket next
        elif iom.has_wavepacket(blockid=blockid):
            import NormWavepacket
            NormWavepacket.compute_norm_hawp(iom,
                                             blockid=blockid,
                                             eigentrafo=False)
        # We have no wavepacket, then we try for a wavefunction
        elif iom.has_wavefunction(blockid=blockid):
            import NormWavefunction
            NormWavefunction.compute_norm(iom,
                                          blockid=blockid,
                                          eigentrafo=False)
        # If there is also no wavefunction, then there is nothing to compute the norm
        else:
            print("Warning: Not computing any norm in block '" + str(blockid) +
                  "'!")

    iom.finalize()
Example #4
0
    # Iterate over all blocks
    for blockid in iom.get_block_ids():
        print("Computing the norms in data block '" + str(blockid) + "'")

        if iom.has_norm(blockid=blockid):
            print("Datablock '" + str(blockid) +
                  "' already contains norm data, silent skip.")
            continue

        # TODO: Add new algorithms here

        # We test for an inhomogeneous wavepacket next
        if iom.has_inhomogwavepacket(blockid=blockid):
            import NormWavepacket
            NormWavepacket.compute_norm_inhawp(iom, blockid=blockid)
        # We test for a homogeneous wavepacket next
        elif iom.has_wavepacket(blockid=blockid):
            import NormWavepacket
            NormWavepacket.compute_norm_hawp(iom, blockid=blockid)
        # We have no wavepacket, then we try for a wavefunction
        elif iom.has_wavefunction(blockid=blockid):
            import NormWavefunction
            NormWavefunction.compute_norm(iom, blockid=blockid)
        # If there is also no wavefunction, then there is nothing to compute the norm
        else:
            print("Warning: Not computing any norm in block '" + str(blockid) +
                  "'!")

    iom.finalize()