Tags and keywords
Fermion
is an abstraction representing some rules for many kinds of particles, and it need not always be an elementary particle, it could be a composite particle. We therefore have to use multiple inheritance:
We do, however, have to be careful not to inherit equivalent redefined properties in twice. The spin:Spin[1]=0.5
redefinition has now been bumped up from Lepton
into a reusable abstract block SpinHalfParticle
, and the temporary redefinition spin:Spin[1]
that was in ElementaryParticle
has been removed completely.
The abstract block SpinHalfParticle
carries properties and constraints that apply to any spin-1/2 particle (not just elementary particles). There are two different representations of the two possible spin states: (1) 'up' and 'down' enumeration literals within the enumeration value type SpinHalfState
; (2) the allowed values +0.5 and -0.5 of the Sz spin projection component, represented by a value property sz:SpinProjection
, where SpinProjection
is a Real
, so that - unlike 'up' and 'down' - we can easily do some maths with it. (The use of the z-axis is an arbitrary convention).
In SpinHalfParticle
the value property spinState
is redefined to have the type SpinHalfState
. The value properties spinState
and sz
are then constrained using OCL:
this.spinState = SpinHalfState::up implies this.sz = 0.5 and this.spinState = SpinHalfState::down implies this.sz = -0.5
this.sz = 0.5 implies this.spinState = SpinHalfState::up and this.sz = -0.5 implies this.spinState = SpinHalfState::down
A mapping between them is controlled using SysML Parametrics. The constraint on ConstraintBlock SpinZ
is written in BeanShell; it is not particularly elegant, but works fine when run in Magic Cyber-Systems Engineer® (Cameo Systems Modeler®) or Magic Model Analyst® (Cameo Simulation Toolkit®)
:
sz = state.getName().equals("up") ? 0.5 : -0.5;