def all_single_hadrons(mom):
    logging.info("Include all the single hadrons")
    args.outfile.write("# start with all the single hadrons\n") #beyonce
    isomap = {"1": ["pion"], "1h": ["kaon"], "0": ["eta", "phi"]}

    basechan = args.channel.split("_")[0]

    psqr = sum(int(i)**2 for i in args.momentum)
    if psqr == 0:
        sh = getprunedops(args.isospin, "sh")
        atrest = getprunedops(args.isospin, "atrest")
        ops = sh[basechan] + atrest[basechan]
    if psqr == 1 or psqr == 4:
        ops = getprunedops(args.isospin, "OA")[basechan]
    if psqr == 2:
        ops = getprunedops(args.isospin, "PD")[basechan]
    if psqr == 3:
        ops = getprunedops(args.isospin, "CD")[basechan]
    isomap = {"1": ["pion"], "1h": ["kaon"], "0": ["eta", "phi"]}
    namemap = {"1": "pi", "1h": "K", "0": "eta"}
    psqr = sum(int(i)**2 for i in args.momentum)
    operators = particle_operators.particleDatabase()
    op = operators.read_op(namemap[args.isospin], basechan, psqr)
    for disp in ops:

        for name in isomap[args.isospin]:
            p = "({},{},{})".format(*[mom_map[i] for i in mom])
            singleopline = '@oplist.push("{} P={} {} {}")\n'.format(name, p, args.channel, disp)
            args.outfile.write(singleopline)
Beispiel #2
0
def operator_for_singlehadron(name, psqr):
    logging.info("Translating {}".format(name))
    operators = particle_operators.particleDatabase()
    p1 = particle_name(name)
    try:
        irreps = irrep_moving_particle(p1, psqr)
    except KeyError:
        logging.critical("I don't know how to do subductions for this momenta")
        raise NotImplementedError("Unsupported momenta")
    ops = {}
    for irrep in irreps:
        op = operators.read_op(name, irrep, getmomint(psqr))
        logging.info("particle1 %s in %s, primary operator is %s", name, irrep, op)
        ops[irrep] = op
    return ops
Beispiel #3
0
def translate_name_to_irrep(name):
    logging.info("Translating {}".format(name))
    name = name.replace("KB", "K")
    operators = particle_operators.particleDatabase()
    if "_" not in name:
        logging.info("Is a single hadron?")
        p1 = particle_name(name)
        logging.info("particle %s at rest irreps: %s", name, " ".join(irrep_rest_particle(p1)))
        raise ValueError("is a single hadron")

    if name.count("_") > 5:
        logging.info("Is a three or four hadron state?")
        raise NotImplementedError("3 or more hadrons")

    particle1, momentum1, particle2, momentum2, _, _ = name.split("_")
    mom1 = getmomint(momentum1)
    mom2 = getmomint(momentum2)
    try:
        p1 = particle_name(particle1)
        p2 = particle_name(particle2)
    except KeyError:
        logging.critical("I don't know understand one of the particle names")
        raise NotImplementedError("Particle name unknown")
    logging.info("particle1 %s at rest irreps: %s", particle1, " ".join(irrep_rest_particle(p1)))
    logging.info("particle2 %s at rest irreps: %s", particle2, " ".join(irrep_rest_particle(p2)))

    iso = [i for i in name.split("_") if i.startswith("iso")][0]

    try:
        irreps1 = irrep_moving_particle(p1, momentum1)
        irreps2 = irrep_moving_particle(p2, momentum2)
    except KeyError:
        logging.critical("I don't know how to do subductions for this momenta")
        raise NotImplementedError("Unsupported momenta")

    if mom1 > 0:
        logging.info("particle1 %s moving irreps: %s", particle1,
                     " ".join(irreps1))

    if mom2 > 0:
        logging.info("particle2 %s moving irreps: %s", particle2,
                     " ".join(irreps2))

    for i in irreps1:
        for j in irreps2:
            logging.info("operator file: {}_{}_{}_{}".format(momentums[mom1], i, momentums[mom2], j))

    for irrep in irreps1:
        op = operators.read_op(particle1, irrep, mom1)
        logging.info("particle1 %s in %s, primary operator is %s", particle1, irrep, op)

    for irrep in irreps2:
        op = operators.read_op(particle2, irrep, mom2)
        logging.info("particle2 %s in %s, primary operator is %s", particle2, irrep, op)

    opset = []
    for i in irreps1:
        op1 = operators.read_op(particle1, i, mom1)
        for j in irreps2:
            op2 = operators.read_op(particle2, j, mom2)
            opset.append(((p1, momentums[mom1], i, op1), (p2, momentums[mom2], j, op2)))
            opfile = "{}_{}_{}_{}".format(momentums[mom1], i, momentums[mom2], j)
            if op1 == op2:
                logging.info("cat S\=0_{opfile}_* | grep -r {op1}.*{op2}".format(opfile=opfile, op1=op1, op2=op2))
            else:
                logging.info("cat S\=0_{opfile}_* | grep {op1} |grep {op2}".format(opfile=opfile, op1=op1, op2=op2))
            #print "op1:", "p={}".format(mom1), i, op1, "op2:", "p={}".format(mom2), j, op2

    return opset