def doit(cfgpath, range, count):
    cfg = QcfpConfig.from_yaml_file(str(cfgpath))

    vcfg = VoltageConfig()
    vcfg.range = range
    vcfg.count = count
    vcfg.stark_field_magnitudes = np.linspace(vcfg.range[0], vcfg.range[1],
                                              vcfg.count).tolist()

    with open('voltagecfg.yaml', 'w') as f:
        vcfg.to_yaml(stream=f)

    path = str(pathlib.Path(cfgpath).with_suffix(''))
    for i, m in enumerate(vcfg.stark_field_magnitudes):
        p = path + '-{:03d}.yaml'.format(i)
        with open(p, 'w') as f:
            vec = np.array(cfg.stark_field_vector)
            vec /= np.linalg.norm(vec)
            cfg.stark_field_vector = (m * vec).tolist()
            cfg.to_yaml(stream=f)
def doit(cfgpath, index, range, count):
    cfg = QcfpConfig.from_yaml_file(str(cfgpath))

    if cfg.nsites < index:
        raise ValueError('index too large for system hamiltonian size')

    scfg = SitePositionConfig()
    scfg.range = range
    scfg.count = count
    site_energy = cfg.system_hamiltonian[index][index]
    scfg.site_energies = (site_energy + np.linspace(scfg.range[0], scfg.range[1], scfg.count)).tolist()

    with open('site_energy_config.yaml', 'w') as f:
        scfg.to_yaml(stream=f)

    path = str(pathlib.Path(cfgpath).with_suffix(''))
    for i, m in enumerate(scfg.site_energies):
        p = path + '-{:03d}.yaml'.format(i)
        with open(p, 'w') as f:
            cfg.system_hamiltonian[i][i] = m
            cfg.to_yaml(stream=f)
Exemplo n.º 3
0
from pyqcfp.runqcfp import QcfpConfig
import pathlib
import sys

path = pathlib.Path(sys.argv[1])

cfg = QcfpConfig.from_yaml_file(str(path))
cfg.simulation_type = 'absorption'
cfg.simulation_code = 'excitons-abs'

linearpath = str(path.with_suffix('').name + '-linear.yaml')

with open(linearpath, 'w') as f:
    cfg.to_yaml(stream=f)
Exemplo n.º 4
0
from pyqcfp.runqcfp import QcfpConfig

cfg = QcfpConfig.from_yaml_file('template-cfg.yaml')
cfg.simulation_type = 'absorption'
cfg.simulation_code = 'excitons-abs'

with open('template-cfg.yaml', 'w') as f:
    cfg.to_yaml(stream=f)