コード例 #1
0
    # Read file with simulation data
    try:
        iom.open_file(filename=sys.argv[1])
    except IndexError:
        iom.open_file()

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

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

        # See if we have an inhomogeneous wavepacket in the current data block
        if iom.has_inhomogwavepacket(blockid=blockid):
            import EvaluateWavepacketsInhomog

            EvaluateWavepacketsInhomog.compute_evaluate_wavepackets(iom, blockid=blockid, basis="canonical")
        # If not, we test for a homogeneous wavepacket next
        elif iom.has_wavepacket(blockid=blockid):
            import EvaluateWavepackets

            EvaluateWavepackets.compute_evaluate_wavepackets(iom, blockid=blockid, basis="canonical")
        # If there is also no wavefunction, then there is nothing to compute the norm
        else:
            print("Warning: Not evaluating any wavepackets in block '" + str(blockid) + "'!")

    iom.finalize()
コード例 #2
0
    PA = ParameterLoader().load_from_file(parametersfile)
else:
    PA = None

# 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("Evaluating wavepackets in data block '"+str(blockid)+"'")

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

    # NOTE: Add new algorithms here

    if iom.has_wavepacket(blockid=blockid):
        import EvaluateWavepackets
        EvaluateWavepackets.compute_evaluate_wavepackets(PA, iom, blockid=blockid, eigentrafo=False)
    elif iom.has_inhomogwavepacket(blockid=blockid):
        import EvaluateWavepacketsInhomog
        EvaluateWavepacketsInhomog.compute_evaluate_wavepackets(PA, iom, blockid=blockid, eigentrafo=False)
    else:
        print("Warning: Not evaluating any wavepackets in block '"+str(blockid)+"'!")

iom.finalize()
コード例 #3
0
    iom = IOManager()

    # Read file with simulation data
    try:
        iom.open_file(filename=sys.argv[1])
    except IndexError:
        iom.open_file()

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

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

        # See if we have an inhomogeneous wavepacket in the current data block
        if iom.has_inhomogwavepacket(blockid=blockid):
            import EvaluateWavepacketsInhomog
            EvaluateWavepacketsInhomog.compute_evaluate_wavepackets(iom, blockid=blockid)
        # If not, we test for a homogeneous wavepacket next
        elif iom.has_wavepacket(blockid=blockid):
            import EvaluateWavepackets
            EvaluateWavepackets.compute_evaluate_wavepackets(iom, blockid=blockid)
        # If there is also no wavefunction, then there is nothing to compute the norm
        else:
            print("Warning: Not evaluating any wavepackets in block '"+str(blockid)+"'!")

    iom.finalize()