conservationrules

Deprecated since version 0.1.3: Use QRules, AmpForm, and TensorWaves instead.

import pycompwa.expertsystem.state.conservationrules

Functors for quantum number condition checks.

class AbstractConditionFunctor[source]

Bases: abc.ABC

abstract check(qn_names, in_edges, out_edges, int_node)[source]
class AbstractRule(rule_name)[source]

Bases: abc.ABC

add_required_qn(qn_name, qn_condition_functions=[])[source]
abstract check(ingoing_part_qns, outgoing_part_qns, interaction_qns)[source]
check_requirements(in_edges, out_edges, int_node)[source]
get_qn_conditions()[source]
get_required_qn_names()[source]
abstract specify_required_qns()[source]
class AdditiveQuantumNumberConservation(qn_name)[source]

Bases: pycompwa.expertsystem.state.conservationrules.AbstractRule

checks for the conservation of an additive quantum number such as electric charge, baryon number, lepton number.

\(\sum q_{in} = \sum q_{out}\)

check(ingoing_part_qns, outgoing_part_qns, interaction_qns)[source]
specify_required_qns()[source]
class CParityConservation[source]

Bases: pycompwa.expertsystem.state.conservationrules.AbstractRule

check(ingoing_part_qns, outgoing_part_qns, interaction_qns)[source]

Implements \(C_{in} = C_{out}\).

get_cparity_multiparticle(part_qns, interaction_qns)[source]
specify_required_qns()[source]
class ClebschGordanCheckHelicityToCanonical[source]

Bases: pycompwa.expertsystem.state.conservationrules.AbstractRule

implements clebsch gordan checks for \(S_1, S_2\) to \(S\) and the \(L,S\) to \(J\) coupling based on the conversion of helicity to canonical amplitude sums

check(ingoing_part_qns, outgoing_part_qns, interaction_qns)[source]
specify_required_qns()[source]
class DefinedForAllEdges[source]

Bases: pycompwa.expertsystem.state.conservationrules.AbstractConditionFunctor

check(qn_names, in_edges, out_edges, int_node)[source]
class DefinedForAllOutgoingEdges[source]

Bases: pycompwa.expertsystem.state.conservationrules.AbstractConditionFunctor

check(qn_names, in_edges, out_edges, int_node)[source]
class DefinedForInteractionNode[source]

Bases: pycompwa.expertsystem.state.conservationrules.AbstractConditionFunctor

check(qn_names, in_edges, out_edges, int_node)[source]
class DefinedIfOtherQnNotDefinedInOutSeparate(other_qn_names)[source]

Bases: pycompwa.expertsystem.state.conservationrules.AbstractConditionFunctor

Implements logic for…

check(qn_names, in_edges, out_edges, int_node)[source]
check_edge_set(qn_names, edges, int_node)[source]
find_in_dict(name, props)[source]
class GParityConservation[source]

Bases: pycompwa.expertsystem.state.conservationrules.AbstractRule

check(ingoing_part_qns, outgoing_part_qns, interaction_qns)[source]

Implements \(G_{in} = G_{out}\).

check_multistate_gparity(single_state_qns, double_state_qns, interaction_qns)[source]
specify_required_qns()[source]
class GellMannNishijimaRule[source]

Bases: pycompwa.expertsystem.state.conservationrules.AbstractRule

calculate_hypercharge(particle)[source]

calculates the hypercharge \(Y=S+C+B+T+B\)

check(ingoing_part_qns, outgoing_part_qns, interaction_qns)[source]

checks the Gell-Mann–Nishijima formula \(Q=I_3+\frac{Y}{2}\) for each particle.

specify_required_qns()[source]
class HelicityConservation[source]

Bases: pycompwa.expertsystem.state.conservationrules.AbstractRule

check(ingoing_part_qns, outgoing_part_qns, interaction_qns)[source]

implements \(|\lambda_2-\lambda_3| \leq S_1\)

specify_required_qns()[source]
class IdenticalParticleSymmetrization[source]

Bases: pycompwa.expertsystem.state.conservationrules.AbstractRule

check(ingoing_part_qns, outgoing_part_qns, interaction_qns)[source]
check_particles_identical(particles)[source]
specify_required_qns()[source]
class MassConservation(width_factor=3)[source]

Bases: pycompwa.expertsystem.state.conservationrules.AbstractRule

check(ingoing_part_qns, outgoing_part_qns, interaction_qns)[source]

implements the mass check.

\(M_{out} - N \cdot W_{out} < M_{in} + N \cdot W_{in}\)

It makes sure that the net mass outgoing state \(M_{out}\) is smaller than the net mass of the ingoing state \(M_{in}\). Also the width \(W\) of the states is taken into account.

specify_required_qns()[source]
class ParityConservation[source]

Bases: pycompwa.expertsystem.state.conservationrules.AbstractRule

check(ingoing_part_qns, outgoing_part_qns, interaction_qns)[source]

Implements \(P_{in} = P_{out} \cdot (-1)^L\) .

specify_required_qns()[source]
class ParityConservationHelicity[source]

Bases: pycompwa.expertsystem.state.conservationrules.AbstractRule

check(ingoing_part_qns, outgoing_part_qns, interaction_qns)[source]

Implements the check.

\(A_{-\lambda_1-\lambda_2} = P_1 P_2 P_3 (-1)^{S_2+S_3-S_1} A_{\lambda_1\lambda_2}\)

Notice that only the special case \(\lambda_1=\lambda_2=0\) may return False

specify_required_qns()[source]
class SpinConservation(spinlike_qn, use_projection=True)[source]

Bases: pycompwa.expertsystem.state.conservationrules.AbstractRule

Implements conservation of a spin-like quantum number for a two body decay (coupling of two particle states).

See check() for details.

calculate_total_spins(part_list, interaction_qns)[source]
check(ingoing_part_qns, outgoing_part_qns, interaction_qns)[source]

implements \(|S_1 - S_2| \leq S \leq |S_1 + S_2|\) and optionally \(|L - S| \leq J \leq |L + S|\). Also checks \(M_1 + M_2 = M\) and if Clebsch-Gordan coefficients are 0

check_magnitude(in_part, out_part, interaction_qns)[source]
check_projections(in_part, out_part)[source]
specify_required_qns()[source]
spin_couplings(spin1, spin2)[source]

implements the coupling of two spins.

\(|S_1 - S_2| \leq S \leq |S_1 + S_2|\) and \(M_1 + M_2 = M\)

is_clebsch_gordan_coefficient_zero(spin1, spin2, spin_coupled)[source]
is_particle_antiparticle_pair(pid1, pid2)[source]

Check if PID is opposite sign.

We just check if the pid is opposite in sign, this is a requirement of the pid numbers of course