10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-26 06:14:38 +01:00

Improve multiplicity support and add suport for double

This commit is contained in:
Mickaël Véril 2020-06-01 14:06:42 +02:00
parent 8bcc80aa48
commit 497bffbad2

View File

@ -7,6 +7,7 @@ class excitationTypes {
static get Double() { return new excitationType(1 << 6, new description("Double")) } static get Double() { return new excitationType(1 << 6, new description("Double")) }
static get SingletSinglet() { return new excitationType(1 << 7, new description(String.raw`\mathrm{Singlet} \rightarrow \mathrm{Singlet}`,true)) } static get SingletSinglet() { return new excitationType(1 << 7, new description(String.raw`\mathrm{Singlet} \rightarrow \mathrm{Singlet}`,true)) }
static get SingletTriplet() { return new excitationType(1 << 8, new description(String.raw`\mathrm{Singlet} \rightarrow \mathrm{Triplet}`,true)) } static get SingletTriplet() { return new excitationType(1 << 8, new description(String.raw`\mathrm{Singlet} \rightarrow \mathrm{Triplet}`,true)) }
static get DoubletDoublet() { return new excitationType(1 << 9, new description(String.raw`\mathrm{Doublet} \rightarrow \mathrm{Doublet}`,true)) }
// Max bit shifts is 31 because int are int32 So 1 << 31 are -2147483648 // Max bit shifts is 31 because int are int32 So 1 << 31 are -2147483648
static get Others() { return new excitationType(1 << 31, new description("Others"))} static get Others() { return new excitationType(1 << 31, new description("Others"))}
static get All() { return EnumUltils.getAll(this,excitationType)} static get All() { return EnumUltils.getAll(this,excitationType)}
@ -171,13 +172,14 @@ class excitationBase {
} }
} }
} }
switch (final.multiplicity) { var m = new Map([
case 1: [JSON.stringify([1,1]), excitationTypes.SingletSinglet],
this.type.Value=this.type|excitationTypes.SingletSinglet [JSON.stringify([2,2]), excitationTypes.DoubletDoublet],
break; [JSON.stringify([1,3]), excitationTypes.SingletTriplet],
case 3: ])
this.type.Value=this.type|excitationTypes.SingletTriplet const marray=JSON.stringify([initial.multiplicity, final.multiplicity])
break; if (m.has(marray)) {
this.type.Value=this.type.Value|m.get(marray)
} }
if (this.type.Value==0) { if (this.type.Value==0) {
this.type.Value=excitationTypes.Others.Value; this.type.Value=excitationTypes.Others.Value;