metrolopy 0.6.5__py3-none-any.whl → 1.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,903 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ # module builtin_constants
4
+
5
+ # Copyright (C) 2025 National Research Council Canada
6
+ # Author: Harold Parks
7
+
8
+ # This file is part of MetroloPy.
9
+
10
+ # MetroloPy is free software: you can redistribute it and/or modify it under
11
+ # the terms of the GNU General Public License as published by the Free Software
12
+ # Foundation, either version 3 of the License, or (at your option) any later
13
+ # version.
14
+
15
+ # MetroloPy is distributed in the hope that it will be useful, but WITHOUT ANY
16
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17
+ # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18
+ # details.
19
+
20
+ # You should have received a copy of the GNU General Public License along with
21
+ # MetroloPy. If not, see <http://www.gnu.org/licenses/>.
22
+
23
+ """
24
+ constant definitions
25
+ """
26
+
27
+ from numpy import sqrt
28
+ from .constant import GummyConstant
29
+ from .unit import unit,MFraction
30
+ from .gummy import gummy
31
+ from .constcom import h,c,e,hbar,k,dalton,me,mp,a0,G,pi,euler,sqrt2
32
+ from .constcom import (alph,aral,ryd,ae,rd,ghn,arh,sigmah,mmu,amu,
33
+ arn,gnn,ard,gdn,gp,sigmapp,mtu,gtn)
34
+ from .constcom import earth_mass,jupiter_mass,solar_mass
35
+
36
+ def norm(x):
37
+ return GummyConstant.latex_norm(x)
38
+
39
+ with GummyConstant._builtin():
40
+
41
+ GummyConstant(pi,
42
+ name='float64 representation of pi',
43
+ symbol='\u03c0',
44
+ html_symbol='<i>&pi;</i>',
45
+ latex_symbol='\\pi',
46
+ ascii_symbol='pi',
47
+ add_symbol=True,
48
+ description='numpy.pi',
49
+ )
50
+
51
+ _euler = GummyConstant(euler,
52
+ name='float64 representation of Euler\'s number e',
53
+ symbol='e',
54
+ html_symbol='<i>e</i>',
55
+ add_symbol=False,
56
+ short_name='Euler',
57
+ description='numpy.e',
58
+ )
59
+ GummyConstant.alias('euler',_euler)
60
+ GummyConstant.alias('math e',_euler)
61
+ GummyConstant.alias('math_e',_euler)
62
+
63
+ GummyConstant(sqrt2,
64
+ name='float64 representation of sqrt(2)',
65
+ symbol='sqrt(2)',
66
+ latex_symbol='\\sqrt{2}',
67
+ add_symbol=True,
68
+ description='numpy.sqrt(2)',
69
+ )
70
+
71
+ GummyConstant(9192631770,unit='Hz',
72
+ name='hyperfine transition frequency of Cs-133',
73
+ symbol='\u0394\u03bd(Cs)',
74
+ html_symbol='&Delta;<i>&nu;</i><sub>Cs</sub>',
75
+ latex_symbol='\\Delta\\nu_{' + norm('Cs') + '}',
76
+ ascii_symbol='hf(Cs)',
77
+ add_symbol=True,
78
+ description='hyperfine transition frequency of Cs-133, SI defining constant, SI Brochure 9th ed.,Caesium, Cesium',
79
+ _key='nucs')
80
+
81
+ _h = GummyConstant(h,unit='J s',
82
+ name='Planck constant',
83
+ symbol='h',
84
+ add_symbol=True,
85
+ description='Planck constant, SI defining constant, SI Brochure 9th ed.',
86
+ _key='h')
87
+
88
+ _c = GummyConstant(c,unit='m/s',
89
+ name='speed of light in vacuum',
90
+ symbol='c',
91
+ add_symbol=True,
92
+ description='speed of light in vacuum, SI defining constant, SI Brochure 9th ed.',
93
+ _key='c')
94
+
95
+ _e = GummyConstant(e,unit='C',
96
+ name='elementary charge',
97
+ symbol='e',
98
+ add_symbol=True,
99
+ description='elementary charge, SI defining constant, SI Brochure 9th ed.',
100
+ _key='e')
101
+
102
+ _NA = GummyConstant(MFraction('6.02214076e23'),unit='mol**-1',
103
+ name='Avogadro constant',
104
+ symbol='N(A)',
105
+ html_symbol='<i>N</i><sub>A</sub>',
106
+ latex_symbol='N_{' + norm('A') + '}',
107
+ add_symbol=True,
108
+ description='Avogadro constant, SI defining constant, SI Brochure 9th ed.',
109
+ _key='na')
110
+
111
+ _k = GummyConstant(k,unit='J/K',
112
+ name='Boltzmann constant',
113
+ symbol='k',
114
+ add_symbol=True,
115
+ description='Boltzmann constant, SI defining constant, SI Brochure 9th ed.',
116
+ _key='k')
117
+
118
+ GummyConstant(683,unit='lm/W',
119
+ name='luminous efficacy',
120
+ symbol='K(cd)',
121
+ html_symbol='<i>K</i><sub>cd</sub>',
122
+ latex_symbol='K_{' + norm('cd') + '}',
123
+ add_symbol=True,
124
+ description='luminous efficacy, SI defining constant, SI Brochure 9th ed., candela',
125
+ _key='kcd')
126
+
127
+ _hbar = GummyConstant(hbar*unit('J s'),
128
+ name='reduced Planck constant',
129
+ symbol='hbar',
130
+ html_symbol='&hbar;',
131
+ latex_symbol='\\hbar',
132
+ add_symbol=True,
133
+ description='reduced Planck constant, calculated from SI Brochure 9th ed. value as h/(2*numpy.pi)',
134
+ _key='hbar')
135
+ GummyConstant.alias('h-bar',_hbar)
136
+
137
+ _mu = GummyConstant(dalton*unit('kg'),
138
+ name='atomic mass constant',
139
+ symbol='m(u)',
140
+ html_symbol='<i>m<sub>u</sub></i>',
141
+ latex_symbol='m_u',
142
+ add_symbol=True,
143
+ description='atomic mass constant, calculated from CODATA 2022 values as 2*R(inf)*h/(Ar(e)*c*alpha**2\nsee also the Unit dalton',
144
+ _key='u')
145
+
146
+ _me = GummyConstant(me*unit('kg'),
147
+ name='electron mass',
148
+ symbol='m(e)',
149
+ html_symbol='<i>m<sub>e</sub></i>',
150
+ latex_symbol='m_{' + norm('e')+ '}',
151
+ add_symbol=True,
152
+ description='electron mass, calculated from CODATA 2022 values as 2*R(inf)*h/c*alpha**2',
153
+ _key='me')
154
+
155
+ _alpha = GummyConstant(alph,
156
+ name='fine-structure constant',
157
+ symbol='alpha',
158
+ html_symbol='<i>&alpha;</i>',
159
+ latex_symbol='\\alpha',
160
+ add_symbol=True,
161
+ description='fine-structure constant, CODATA 2022',
162
+ _key='alph')
163
+
164
+ GummyConstant(ryd*unit('m**-1'),
165
+ name='Rydberg constant',
166
+ symbol='R(\u221e)',
167
+ html_symbol='<i>R</i><sub>&infin;</sub>',
168
+ latex_symbol='R_{\\infty}',
169
+ ascii_symbol='R(inf)',
170
+ add_symbol=True,
171
+ description='Rydberg constant, CODATA 2022',
172
+ _key='ryd')
173
+
174
+ _a0= GummyConstant(a0*unit('m'),
175
+ name='Bohr radius',
176
+ symbol='a(0)',
177
+ html_symbol='<i>a</i><sub>0</sub>',
178
+ latex_symbol='a_{0}',
179
+ add_symbol=True,
180
+ description='Bohr radius, calculated from CODATA 2022 values as alpha/(4*pi*R(inf))',
181
+ _key='bohrrada0')
182
+
183
+ _mp = GummyConstant(mp*unit('kg'),
184
+ name='proton mass',
185
+ symbol='m(p)',
186
+ html_symbol='<i>m</i><sub>p</sub>',
187
+ latex_symbol='m_{' + norm('p') + '}',
188
+ add_symbol=True,
189
+ description='proton mass, calculated from CODATA 2022 values as p_e_mass_ratio*m(e) where\nm(e) = 2*R(inf)*h/c*alpha**2',
190
+ _key='mp')
191
+
192
+ _e0 = GummyConstant(_e**2/(2*_h*_c*_alpha),
193
+ name='vacuum electric permittivity',
194
+ symbol='\u03b5(0)',
195
+ html_symbol='<i>&epsilon;</i><sub>0</sub>',
196
+ latex_symbol='\\epsilon_{0}',
197
+ ascii_symbol = 'epsilon(0)',
198
+ add_symbol=True,
199
+ description='vacuum electric permittivity, calculated from CODATA 2022 values as e**2/(s*h*c*alpha)',
200
+ _key='ep0')
201
+ _e0.unit = 'F/m'
202
+
203
+ GummyConstant(1/(4*pi*_e0),name='Coulomb constant',
204
+ symbol='k(e)',
205
+ html_symbol='<i>k</i><sub>e</sub>',
206
+ latex_symbol='k_{' + norm('e') + '}',
207
+ add_symbol=True,
208
+ description='Coulomb constant, calculated from CODATA 2022 values as 1/(4*pi*e(0)) where\ne(0) = e**2/(s*h*c*alpha)'
209
+ ).unit='N m**2/C**2'
210
+
211
+ GummyConstant(2*_h*_alpha/(_c*_e**2),
212
+ name='vacuum magnetic permeability',
213
+ symbol='\u03bc(0)',
214
+ html_symbol='<i>&mu;</i><sub>0</sub>',
215
+ latex_symbol='\\mu_{0}',
216
+ ascii_symbol='mu(0)',
217
+ add_symbol=True,
218
+ description='vacuum magnetic permeability, calculated from CODATA 2022 values as 2*h*alpha/(c*e**2)',
219
+ _key='mu0'
220
+ ).unit = 'N/A**2'
221
+
222
+ GummyConstant(_h/_e**2,name='von Klitzing constant',
223
+ symbol='R(K)',
224
+ html_symbol='<i>R</i><sub>K</sub>',
225
+ latex_symbol='R_{' + norm('K') + '}',
226
+ add_symbol=True,
227
+ description='von Klitzing constant, calculated from SI Brochure 9th ed. values as h/e**2',
228
+ _key='rk')
229
+
230
+ GummyConstant(2*_e/_h,name='Josephson constant',
231
+ symbol='K(J)',
232
+ html_symbol='<i>K</i><sub>J</sub>',
233
+ latex_symbol='K_{' + norm('J') + '}',
234
+ add_symbol=True,
235
+ description='Josephson constant, calculated from SI Brochure 9th ed. values as 2*e/h',
236
+ _key='kjos'
237
+ ).unit = 'Hz/V'
238
+
239
+ GummyConstant(MFraction('483597.9e9'),unit='Hz/V',
240
+ name='1990 conventional value of Josephson constant',
241
+ symbol='K(J-90)',
242
+ html_symbol='<i>K</i><sub>J-90</sub>',
243
+ latex_symbol='K_{' + norm('J-90') + '}',
244
+ add_symbol=True,
245
+ description='1990 conventional value of Josephson constant',
246
+ _key='kj90')
247
+
248
+ GummyConstant(MFraction('25812.807'),unit='ohm',
249
+ name='1990 conventional value of von Klitzing constant',
250
+ symbol='R(K-90)',
251
+ html_symbol='<i>R</i><sub>K-90</sub>',
252
+ latex_symbol='R_{' + norm('K-90') + '}',
253
+ add_symbol=True,
254
+ description='1990 conventional value of von Klitzing constant',
255
+ _key='rk90')
256
+
257
+ GummyConstant(_h/(2*_e),
258
+ name='magnetic flux quantum',
259
+ symbol='Phi(0)',
260
+ html_symbol='<i>&Phi;</i><sub>0</sub>',
261
+ latex_symbol='\\Phi_{0}',
262
+ add_symbol=True,
263
+ description='magnetic flux quantum, calculated from SI Brochure 9th ed. values as h/(2*e)',
264
+ _key='flxquhs2e'
265
+ ).unit = 'Wb'
266
+
267
+ GummyConstant(_h/(_me*_c),
268
+ name='Compton wavelength',
269
+ symbol='\u03bb(C)',
270
+ html_symbol='<i>&lambda;</i><sub>C</sub>',
271
+ latex_symbol='\\lambda_{' + norm('C') + '}',
272
+ ascii_symbol='lambda(C)',
273
+ add_symbol=True,
274
+ description='Compton wavelength of the electron, calculated from CODATA 2022 values as\nh/(m(e)*c) where m(e) = 2*R(inf)*h/c*alpha**2',
275
+ _key='ecomwl'
276
+ ).unit = 'm'
277
+
278
+ GummyConstant(_e**2/(4*pi*_e0*_me*_c**2),
279
+ name='classical electron radius',
280
+ symbol='r(e)',
281
+ html_symbol='<i>r</i><sub>r</sub>',
282
+ latex_symbol='r_{' + norm('e') + '}',
283
+ add_symbol=True,
284
+ description='classical electron radius, calculated from CODATA 2022 values as e**2/(4*pi*e(0)*m(e)*c**2) where\nm(e) = 2*R(inf)*h/c*alpha**2 and e(0) = e**2/(s*h*c*alpha)',
285
+ _key='re'
286
+ ).unit='m'
287
+
288
+ GummyConstant(2*_h*_alpha/_e**2,
289
+ name='vacuum impedance',
290
+ symbol='Z(0)',
291
+ html_symbol='<i>Z</i><sub>0</sub>',
292
+ latex_symbol='Z_{0}',
293
+ add_symbol=True,
294
+ description='vacuum impedance, calculated from CODATA 2022 values as 2*h*alpha/e**2',
295
+ _key='z0'
296
+ ).unit = 'ohm'
297
+
298
+ GummyConstant(aral*_mu,
299
+ name='alpha particle mass',
300
+ symbol='m(\u03b1)',
301
+ html_symbol='<i>m</i><sub>&alpha;</sub>',
302
+ latex_symbol='m_{' + norm('\u03b1') + '}',
303
+ ascii_symbol='m(alpha)',
304
+ add_symbol=True,
305
+ description='alpha particle mass, calculated from CODATA 2022 values as Ar(alpha)*m(u)',
306
+ _key='mal'
307
+ )
308
+
309
+ _muB = GummyConstant(_e*_hbar/(2*_me),
310
+ name='Bohr magneton',
311
+ symbol='\u03bc(B)',
312
+ html_symbol='<i>&mu;</i><sub>B</sub>',
313
+ latex_symbol='\\mu_{' + norm('B') + '}',
314
+ ascii_symbol='mu(B)',
315
+ add_symbol=True,
316
+ description='Bohr magneton, calculated from CODATA 2022 values as e*hbar/(2*m(e))',
317
+ _key='mub')
318
+ _muB.unit = 'J/T'
319
+
320
+ _emma = GummyConstant(ae,
321
+ name='electron magnetic moment anomaly',
322
+ symbol='a(e)',
323
+ html_symbol='<i>a</i><sub>e</sub>',
324
+ latex_symbol='a_{' + norm('e') + '}',
325
+ add_symbol=True,
326
+ description='electron magnetic moment anomaly, CODATA 2022',
327
+ _key='ae')
328
+
329
+ _ge = GummyConstant(-2*(1+_emma),
330
+ name='electron g factor',
331
+ symbol='g(e-)',
332
+ html_symbol='<i>g</i><sub>e<sup>-</sup></sub>',
333
+ latex_symbol='g_{' + norm('e') + '^{-}}',
334
+ add_symbol=True,
335
+ description='electron g factor, calculated from CODATA 2022 values as -2*(1-a(e))',
336
+ _key='gem')
337
+
338
+ GummyConstant(-_ge*_muB/_hbar,
339
+ name='electron gyromagnetic ratio',
340
+ symbol='\u03B3(e)',
341
+ html_symbol='<i>&gamma;</i><sub>e</sub>',
342
+ latex_symbol='\\gamma_{' + norm('e') + '}',
343
+ ascii_symbol='gamma(e)',
344
+ add_symbol=True,
345
+ description='electron gyromagnetic ratio, calculated from CODATA 2022 values as -g(e)*mu(B)/hbar where\ng(e) = -2*(1-a(e)) and mu(B) = e*hbar/(2*m(e))',
346
+ _key='gammae')
347
+
348
+ GummyConstant(_ge*_muB/2,
349
+ name='electron magnetic moment',
350
+ symbol='\u03bc(e)',
351
+ html_symbol='<i>&mu;</i><sub>e</sub>',
352
+ latex_symbol='\\mu_{' + norm('e') + '}',
353
+ ascii_symbol = 'mu(e)',
354
+ add_symbol=True,
355
+ description='electron magnetic moment, calculated from CODATA 2022 values as g(e)*mu(B)/2 where\ng(e) = -2*(1-a(e)) and mu(B) = e*hbar/(2*m(e))',
356
+ _key='muem'
357
+ ).unit = 'J/T'
358
+
359
+ GummyConstant(2*_e**2/_h,
360
+ name='conductance quantum',
361
+ symbol='G(0)',
362
+ html_symbol='<i>G</i><sub>0</sub>',
363
+ latex_symbol='G_{0}',
364
+ add_symbol=True,
365
+ description='conductance quantum, calculated from SI Brochure 9th ed. values as 2*e**2/h',
366
+ _key='conqu2e2sh'
367
+ ).unit = 'S'
368
+
369
+
370
+ (
371
+ _angstar, # Angstrom star (m)
372
+ _copperx, # Copper x unit (m)
373
+ _molyx, # Molybdenum x unit (m)
374
+ _a # lattice parameter of silicon
375
+ ) = gummy.create([1.00001495e-10,
376
+ 1.00207697e-13,
377
+ 1.00209952e-13,
378
+ 5.431020511e-10],
379
+ [0.00000090e-10,
380
+ 0.00000028e-13,
381
+ 0.00000053e-13,
382
+ 0.000000089e-10],
383
+ correlation_matrix = [[1,0.00039,0.00100,0.00818],
384
+ [0.00039,1,0.00067,0.01272],
385
+ [0.00100,0.00067,1,0.01398],
386
+ [0.00818,0.01272,0.01398,1]])
387
+ GummyConstant(_angstar*unit('m'),
388
+ name='Angstrom star',
389
+ symbol='\u212B*',
390
+ html_symbol='&#8491;<sup>*</sup>',
391
+ latex_symbol='\u212B^{*}',
392
+ ascii_symbol='A*',
393
+ add_symbol=True,
394
+ description='Angstrom star, CODATA 2022',
395
+ _key='angstar')
396
+
397
+ GummyConstant(_copperx*unit('m'),
398
+ name='copper x unit',
399
+ symbol='xu(CuK\u03B11)',
400
+ html_symbol='xu(CuK&alpha;<sub>1</sub>)',
401
+ latex_symbol=norm('xu') + '(' + norm('CuK\u03b1') + '_{1})',
402
+ ascii_symbol='xu(CuKalpha1)',
403
+ short_name='xu(Cu)',
404
+ add_symbol=True,
405
+ description='copper x unit, CODATA 2022',
406
+ _key='xucukalph1'
407
+ )
408
+
409
+ GummyConstant(_molyx*unit('m'),
410
+ name='molybdenum x unit',
411
+ symbol='xu(MoK\u03B11)',
412
+ html_symbol='xu(MoK&alpha;<sub>1</sub>)',
413
+ latex_symbol=norm('xu') + '(' + norm('MoK\u03b1') + '_{1})',
414
+ ascii_symbol='xu(MoKalpha1)',
415
+ short_name='xu(Mo)',
416
+ add_symbol=True,
417
+ description='molybdenum x unit, CODATA 2022',
418
+ _key='xumokalph1')
419
+
420
+ GummyConstant(_a*unit('m'),
421
+ name='lattice parameter of silicon',
422
+ symbol='a',
423
+ add_symbol=True,
424
+ description='lattice parameter of silicon, CODATA 2022',
425
+ _key='asil')
426
+
427
+ GummyConstant((_a/sqrt(8))*unit('m'),
428
+ name='lattice spacing of ideal Si (220)',
429
+ symbol='d(220)',
430
+ html_symbol='d<sub>220</sub>)',
431
+ latex_symbol='d_{220}',
432
+ add_symbol=True,
433
+ description='lattice spacing of ideal Si (220), calculated from CODATA 2022 values as a/sqrt(8)',
434
+ _key='d220sil')
435
+
436
+ GummyConstant(_mu*ard,
437
+ name='deuteron mass',
438
+ symbol='m(d)',
439
+ html_symbol='<i>m</i><sub>d</sub>',
440
+ latex_symbol='m_{' + norm('d') + '}',
441
+ add_symbol=True,
442
+ description='deuteron mass, calculated from CODATA 2022 values as m(u)*Ar(d)',
443
+ _key='md')
444
+
445
+ GummyConstant(gdn,
446
+ name='deuteron g factor',
447
+ symbol='g(d)',
448
+ html_symbol='<i>g</i><sub>d</sub>',
449
+ latex_symbol='g_{' + norm('d') + '}',
450
+ add_symbol=True,
451
+ description='deuteron g factor, CODATA 2022',
452
+ _key='gdn')
453
+
454
+ _muN = GummyConstant(_e*_hbar/(2*_mp),
455
+ name='nuclear magneton',
456
+ symbol='\u03bc(N)',
457
+ html_symbol='<i>&mu;</i><sub>N</sub>',
458
+ latex_symbol='\\mu_{' + norm('N') + '}',
459
+ ascii_symbol='mu(N)',
460
+ add_symbol=True,
461
+ description='nuclear magneton, calculated from CODATA 2022 values as e*hbar/(2*m(p))',
462
+ _key='mun')
463
+ _muN.unit = 'J/T'
464
+
465
+ GummyConstant(gdn*_muN,
466
+ name='deuteron magnetic moment',
467
+ symbol='\u03bc(d)',
468
+ html_symbol='<i>&mu;</i><sub>d</sub>',
469
+ latex_symbol='\\mu_{' + norm('d') + '}',
470
+ ascii_symbol='mu(d)',
471
+ add_symbol=True,
472
+ description='deuteron magnetic moment, calculated from CODATA 2022 values as g(d)*mu(N)',
473
+ _key='mud')
474
+
475
+ GummyConstant(rd*unit('m'),
476
+ name='deuteron rms charge radius',
477
+ symbol='r(d)',
478
+ html_symbol='<i>r</i><sub>d</sub>',
479
+ latex_symbol='r_{' + norm('d') + '}',
480
+ add_symbol=True,
481
+ description='deuteron rms charge radius',
482
+ _key='rd'
483
+ )
484
+
485
+ _G = GummyConstant(G*unit('m**3 kg**-1 s**-2'),
486
+ name='Newtonian constant of gravitation',symbol='G',
487
+ add_symbol=True,short_name='constant of gravitation',
488
+ description='Newtonian constant of gravitation, CODATA 2022',
489
+ _key='bg')
490
+
491
+ GummyConstant(_e*_NA,
492
+ name='Faraday constant',
493
+ symbol='F',
494
+ html_symbol='<i>F</i>',
495
+ add_symbol=True,
496
+ description='Faraday constant, calculated from CODATA 2022 values as e*N(A)',
497
+ _key='f')
498
+
499
+ GummyConstant(2*_h*_c**2,
500
+ name='first radiation constant for spectral radiance',
501
+ symbol='c(1L)',
502
+ html_symbol='<i>c</i><sub>1L</sub>',
503
+ latex_symbol='c_{1' + norm('L') + '}',
504
+ add_symbol=True,
505
+ description='first radiation constant for spectral radiance, calculated from SI Brochure 9th ed. values as 2*h*c**2',
506
+ _key='c1l'
507
+ ).unit = 'W m**2/sr'
508
+
509
+ GummyConstant(2*pi*_h*_c**2,
510
+ name='first radiation constant',
511
+ symbol='c(1)',
512
+ html_symbol='<i>c</i><sub>1</sub>',
513
+ latex_symbol='c_{1}',
514
+ add_symbol=True,
515
+ description='first radiation constant, calculated from SI Brochure 9th ed. values as 2*pi*h*c**2',
516
+ _key='eqc11strc'
517
+ ).unit = 'W m**2'
518
+
519
+ GummyConstant(_h*_c/_k,
520
+ name='second radiation constant',
521
+ symbol='c(2)',
522
+ html_symbol='<i>c</i><sub>2</sub>',
523
+ latex_symbol='c_{2}',
524
+ add_symbol=True,
525
+ description='second radiation constant, calculated from SI Brochure 9th ed. values as h*c/k',
526
+ _key='c22ndrc'
527
+ ).unit = 'm K'
528
+
529
+ GummyConstant(_me*_c**2*_alpha**2,
530
+ name='Hartree energy',
531
+ symbol='E(h)',
532
+ html_symbol='<i>E</i><sub>h</sub>',
533
+ latex_symbol='E_{' + norm('h') + '}',
534
+ add_symbol=True,
535
+ description='Hartree energy, calculated from CODATA 2022 values as m(e)*c**2*alpha**2\nwhere m(e) = m(u)*Ar(e) and m(u) = 2*R(inf)*h/(Ar(e)*c*alpha**2)',
536
+ _key='hr'
537
+ ).unit = 'J'
538
+
539
+ _gh = GummyConstant(ghn,
540
+ name='helion g factor',
541
+ symbol='g(h)',
542
+ html_symbol='<i>g</i><sub>h</sub>',
543
+ latex_symbol='g_{' + norm('h') + '}',
544
+ add_symbol=True,
545
+ description='helion g factor, CODATA 2022',
546
+ _key='ghn'
547
+ )
548
+
549
+ GummyConstant(_gh*_muN/2,
550
+ name='helion magnetic moment',
551
+ symbol='\u03bc(h)',
552
+ html_symbol='<i>&mu;</i><sub>h</sub>',
553
+ latex_symbol='\\mu_{' + norm('h') + '}',
554
+ ascii_symbol = 'mu(h)',
555
+ add_symbol=True,
556
+ description='helion magnetic moment, calculated from CODATA 2022 values as g(h)*mu(B)/2 where\nmu(B) = e*hbar/(2*m(e))',
557
+ _key='muh'
558
+ ).unit = 'J/T'
559
+
560
+ GummyConstant(_mu*arh,
561
+ name='helion mass',
562
+ symbol='m(h)',
563
+ html_symbol='<i>m</i><sub>h</sub>',
564
+ latex_symbol='m_{' + norm('h') + '}',
565
+ add_symbol=True,
566
+ description='helion mass, calculated from CODATA 2022 values as m(u)*Ar(h) where\nm(u) = 2*R(inf)*h/(Ar(e)*c*alpha**2)',
567
+ _key='mh'
568
+ )
569
+
570
+ GummyConstant(sigmah,
571
+ name='helion shielding shift',
572
+ symbol='\u03c3(h)',
573
+ html_symbol='<i>&sigma;</i><sub>h</sub>',
574
+ latex_symbol='\\sigma_{' + norm('h') + '}',
575
+ ascii_symbol='sigma(h)',
576
+ add_symbol=True,
577
+ description='helion shielding shift, CODATA 2022',
578
+ _key='sigmah'
579
+ )
580
+
581
+ GummyConstant(_mu*_NA,
582
+ name='molar mass constant',
583
+ symbol='M(u)',
584
+ html_symbol='<i>M</i><sub>u</sub>',
585
+ latex_symbol='M_{' + norm('u') + '}',
586
+ add_symbol=True,
587
+ description='molar mass constant, calculated from CODATA 2022 values as m(u)*N(A)',
588
+ _key='mu'
589
+ )
590
+
591
+ GummyConstant(_NA*_k,
592
+ name='molar gas constant',
593
+ symbol='R',
594
+ html_symbol='<i>R</i>',
595
+ latex_symbol='R',
596
+ add_symbol=True,
597
+ description='molar gas constant, calculated from CODATA 2022 values as N(A)*k',
598
+ _key='r'
599
+ )
600
+
601
+ GummyConstant(12*_NA*_mu,
602
+ name='molar mass of carbon-12',
603
+ symbol='M(12C)',
604
+ html_symbol='<i>M</i>(<sup>12</sup>C)',
605
+ latex_symbol='M(^{12}' + norm('C') + ')',
606
+ add_symbol=True,
607
+ description='molar mass of carbon-12, calculated from CODATA 2022 values as 12*m(u)',
608
+ _key='mm12c'
609
+ )
610
+
611
+ GummyConstant(_NA*_a**3/8,
612
+ name='molar volume of silicon',
613
+ symbol='Vm(Si)',
614
+ html_symbol='<i>V</i><sub>m</sub>(Si)',
615
+ latex_symbol='V_{' + norm('m') + '}(' + norm('Si') + ')',
616
+ add_symbol=True,
617
+ description='molar volume of silicon, calculated from CODATA 2022 values as N(A)*a**3/8',
618
+ _key='mvolsil'
619
+ )
620
+
621
+ GummyConstant(100000,unit='Pa',
622
+ name='standard-state pressure',
623
+ symbol='ssp',
624
+ add_symbol=True,
625
+ description='standard-state pressure, CODATA 2022',
626
+ _key='stdspr'
627
+ )
628
+
629
+ GummyConstant(101325,unit='Pa',
630
+ name='standard atmosphere',
631
+ symbol='atm',
632
+ add_symbol=True,
633
+ description='standard atmosphere, CODATA 2022',
634
+ _key='stdatm'
635
+ )
636
+
637
+ _mmu = GummyConstant(mmu*unit('kg'),
638
+ name='muon mass',
639
+ symbol='m(\u03bc)',
640
+ html_symbol='<i>m</i><sub>&mu;</sub>',
641
+ latex_symbol='m_{' + norm('\u03bc') + '}',
642
+ ascii_symbol='m(mu)',
643
+ add_symbol=True,
644
+ description='muon mass, CODATA 2022',
645
+ _key='mmu'
646
+ )
647
+
648
+ GummyConstant(amu,
649
+ name='muon magnetic moment anomaly',
650
+ symbol='a(\u03bc)',
651
+ html_symbol='<i>a</i><sub>&mu;</sub>',
652
+ latex_symbol='a_{' + norm('\u03bc') + '}',
653
+ ascii_symbol='a(mu)',
654
+ add_symbol=True,
655
+ description='muon magnetic moment anomaly, CODATA 2022',
656
+ _key='amu'
657
+ )
658
+
659
+ _gmu = GummyConstant(-2*(1+amu),
660
+ name='muon g factor',
661
+ symbol='g(\u03bc-)',
662
+ html_symbol='<i>g</i><sub>&mu;<sup>-</sup></sub>',
663
+ latex_symbol='g_{' + norm('\u03bc') + '^-}',
664
+ ascii_symbol='g(mu-)',
665
+ add_symbol=True,
666
+ description='muon g factor, calculated from CODATA 2022 values as -2*(1 + a(mu))',
667
+ _key='gmum'
668
+ )
669
+
670
+ GummyConstant(_gmu*_e*_hbar/(4*_mmu),
671
+ name='muon magnetic moment',
672
+ symbol='\u03bc(\u03bc)',
673
+ html_symbol='<i>&mu;</i><sub>&mu;</sub>',
674
+ latex_symbol='\\mu_{' + norm('\u03bc') + '}',
675
+ ascii_symbol = 'mu(mu)',
676
+ add_symbol=True,
677
+ description='muon magnetic moment, calculated from CODATA 2022 values as g(mu-)*e*hbar/(4*m(mu)))',
678
+ _key='mumum'
679
+ ).unit = 'J/T'
680
+
681
+ GummyConstant(_h/(_mmu*_c),
682
+ name='muon Compton wavelength',
683
+ symbol='\u03bb(\u03bc)',
684
+ html_symbol='<i>&lambda;</i><sub>&mu;</sub>',
685
+ latex_symbol='\\lambda_{' + norm('\u03bc') + '}',
686
+ ascii_symbol = 'lambda(mu)',
687
+ add_symbol=True,
688
+ description='muon Compton wavelength, calculated from CODATA 2022 values as\nh/(m(mu)*c)',
689
+ _key='mcomwl'
690
+ ).unit = 'm'
691
+
692
+ _mn = GummyConstant(arn*_mu,
693
+ name='neutron mass',
694
+ symbol='m(n)',
695
+ html_symbol='<i>m</i><sub>n</sub>',
696
+ latex_symbol='m_{' + norm('n') + '}',
697
+ add_symbol=True,
698
+ description='neutron mass, CODATA 2022 calculated from CODATA 2018 values as Ar(n)*m(u) where\nm(u) = 2*R(inf)*h/(Ar(e)*c*alpha**2)',
699
+ _key='mn'
700
+ )
701
+
702
+ _gn = GummyConstant(gnn,
703
+ name='neutron g factor',
704
+ symbol='g(n)',
705
+ html_symbol='<i>g</i><sub>n</sub>',
706
+ latex_symbol='g_{' + norm('g') + '}',
707
+ add_symbol=True,
708
+ description='neutron g factor, CODATA 2022',
709
+ _key='gnn'
710
+ )
711
+
712
+ _mun = GummyConstant(_gn*_muN/2,
713
+ name='neutron magnetic moment',
714
+ symbol='\u03bc(n)',
715
+ html_symbol='<i>&mu;</i><sub>n</sub>',
716
+ latex_symbol='\\mu_{' + norm('n') + '}',
717
+ ascii_symbol = 'mu(n)',
718
+ add_symbol=True,
719
+ description='neutron magnetic moment, calculated from CODATA 2022 values as g(n)*mu(N)/2 where\nmu(N) = e*hbar/(2*m(p))',
720
+ _key='munn'
721
+ )
722
+ _mun.unit = 'J/T'
723
+
724
+ GummyConstant(-2*_mun/_hbar,
725
+ name='neutron gyromagnetic ratio',
726
+ symbol='\u03b3(n)',
727
+ html_symbol='<i>&gamma;</i><sub>n</sub>',
728
+ latex_symbol='\\gamma_{' + norm('n') + '}',
729
+ ascii_symbol = 'gamma(n)',
730
+ add_symbol=True,
731
+ description='neutron gyromagnetic ratio, calculated from CODATA 2022 values as -2*mu(n)/hbar where\nmu(n) = g(n)*mu(N)/2 and mu(N) = e*hbar/(2*m(p))',
732
+ _key='gamman'
733
+ )
734
+
735
+ GummyConstant(_h/(_mn*_c),
736
+ name='neutron Compton wavelength',
737
+ symbol='\u03bb(n)',
738
+ html_symbol='<i>&lambda;</i><sub>n</sub>',
739
+ latex_symbol='\\lambda_{' + norm('n') + '}',
740
+ ascii_symbol = 'lambda(n)',
741
+ add_symbol=True,
742
+ description='neutron Compton wavelength, calculated from CODATA 2022 values as\nh/(m(n)*c) where m(e) = Ar(n)*m(u)',
743
+ _key='ncomwl'
744
+ ).unit = 'm'
745
+
746
+ _gp = GummyConstant(gp,
747
+ name='proton g factor',
748
+ symbol='g(p)',
749
+ html_symbol='<i>g</i><sub>p</sub>',
750
+ latex_symbol='g_{' + norm('p') + '}',
751
+ add_symbol=True,
752
+ description='proton g factor, CODATA 2022',
753
+ _key='gp'
754
+ )
755
+
756
+ _mup = GummyConstant(_gp*_muN/2,
757
+ name='proton magnetic moment',
758
+ symbol='\u03bc(p)',
759
+ html_symbol='<i>&mu;</i><sub>p</sub>',
760
+ latex_symbol='\\mu_{' + norm('p') + '}',
761
+ ascii_symbol = 'mu(p)',
762
+ add_symbol=True,
763
+ description='proton magnetic moment, calculated from CODATA 2022 values as g(p)*mu(N)/2 where\nmu(N) = e*hbar/(2*m(p))',
764
+ _key='mup'
765
+ )
766
+ _mup.unit = 'J/T'
767
+
768
+ GummyConstant(2*_mup/_hbar,
769
+ name='proton gyromagnetic ratio',
770
+ symbol='\u03b3(p)',
771
+ html_symbol='<i>&gamma;</i><sub>p</sub>',
772
+ latex_symbol='\\gamma_{' + norm('p') + '}',
773
+ ascii_symbol = 'gamma(p)',
774
+ add_symbol=True,
775
+ description='proton gyromagnetic ratio, calculated from CODATA 2022 values as 2*mu(p)/hbar where\nmu(p) = g(p)*mu(N)/2 and mu(N) = e*hbar/(2*m(p))',
776
+ _key='gammap'
777
+ )
778
+
779
+ GummyConstant(sigmapp,
780
+ name='proton magnetic shielding correction',
781
+ symbol='\u03c3\u2032(p)',
782
+ html_symbol='<i>&sigma;</i>&prime;<sub>p</sub>',
783
+ latex_symbol='\\sigma\'_{' + norm('p') + '}',
784
+ ascii_symbol='sigma\'(p)',
785
+ add_symbol=True,
786
+ description='proton magnetic shielding correction, CODATA 2022',
787
+ _key='sigmapp'
788
+ )
789
+
790
+ GummyConstant(mtu*_mu,
791
+ name='triton mass',
792
+ symbol='m(t)',
793
+ html_symbol='<i>m</i><sub>t</sub>',
794
+ latex_symbol='m_{' + norm('t') + '}',
795
+ add_symbol=True,
796
+ description='triton mass, calculated from CODATA 2022 values as Ar(t)*m(u) where\nm(u) = 2*R(inf)*h/(Ar(e)*c*alpha**2)',
797
+ _key='mt'
798
+ )
799
+
800
+ _gtn = GummyConstant(gtn,
801
+ name='triton g factor',
802
+ symbol='g(t)',
803
+ html_symbol='<i>g</i><sub>t</sub>',
804
+ latex_symbol='g_{' + norm('t') + '}',
805
+ add_symbol=True,
806
+ description='triton g factor, CODATA 2022',
807
+ _key='gtn'
808
+ )
809
+
810
+ _mut = GummyConstant(_gtn*_muN/2,
811
+ name='triton magnetic moment',
812
+ symbol='\u03bc(t)',
813
+ html_symbol='<i>&mu;</i><sub>t</sub>',
814
+ latex_symbol='\\mu_{' + norm('t') + '}',
815
+ ascii_symbol = 'mu(t)',
816
+ add_symbol=True,
817
+ description='triton magnetic moment, calculated from CODATA 2022 values as g(t)*mu(N)/2 where\nmu(N) = e*hbar/(2*m(t))',
818
+ _key='mut'
819
+ )
820
+ _mut.unit = 'J/T'
821
+
822
+ GummyConstant((8*pi/3)*_alpha**4*_a0**2,
823
+ name='Thomson cross section',
824
+ symbol='\u03c3(e)',
825
+ html_symbol='<i>&sigma;</i><sub>e</sub>',
826
+ latex_symbol='\\sigma_{' + norm('e') + '}',
827
+ ascii_symbol = 'sigma(e)',
828
+ add_symbol=True,
829
+ description='Thomson cross section, calculated from CODATA 2022 values as (8*pi/3)*alpha**4*a0**2',
830
+ _key='eqsigmae'
831
+ ).unit = 'm**2'
832
+
833
+ _wm = GummyConstant(0.22305,0.00023,
834
+ name='weak mixing angle',
835
+ symbol='sin2(\u03f4(W))',
836
+ html_symbol='sin<sup>2</sup> <i>&Theta;</i><sub>W</sub>',
837
+ latex_symbol='sin^{2}\\Theta_{' + norm('W') + '}',
838
+ ascii_symbol='sin2(Theta(W))',
839
+ description='weak mixing angle, CODATA 2022',
840
+ add_symbol=True,
841
+ _key='sin2th'
842
+ )
843
+
844
+ GummyConstant(sqrt(1 - _wm),
845
+ name='W to Z mass ratio',
846
+ symbol='m(W)/m(Z)',
847
+ html_symbol='<i>m</i><sub>W</sub>/<i>m</i><sub>Z</sub>',
848
+ latex_symbol='m_{' + norm('W') + '}/m_{' + norm('Z') + '}',
849
+ add_symbol=True,
850
+ description='W to Z mass ratio, calculated from CODATA 2022 values as sqrt(1 - sin2(Theta(W)))',
851
+ _key='rmwmz'
852
+ )
853
+
854
+ GummyConstant(2*pi**5*_k**4/(15*_h**3*_c**2),
855
+ name='Stefan-Boltzmann constant',
856
+ symbol='\u03c3',
857
+ html_symbol='<i>&sigma;</i>',
858
+ latex_symbol='\\sigma',
859
+ ascii_symbol = 'sigma',
860
+ add_symbol=True,
861
+ description='Stefan-Boltzmann constant, calculated from CODATA 2022 values as 2*pi*5*k**4/(15*h**3*c**2)',
862
+ _key='sigma'
863
+ ).unit = 'W m**-2 K**-4'
864
+
865
+ GummyConstant(1.1663787e-05,6e-12,unit='GeV**-2',
866
+ name='Fermi coupling constant',
867
+ symbol='G(F)/(hbar*c)**3',
868
+ html_symbol='<i>G</i><sub>F</sub>/(&hbar;c)<sup>3</sup>',
869
+ latex_symbol='G_{' + norm('F') + '}/(\\hbar c)^{3}',
870
+ add_symbol=True,
871
+ description='Fermi coupling constant, CODATA 2022',
872
+ _key='gf'
873
+ )
874
+
875
+ GummyConstant(earth_mass,unit='kg',
876
+ name='mass of the earth',
877
+ symbol='M(E)',
878
+ html_symbol='<i>M</i><sub>E</sub>',
879
+ latex_symbol='M_E',
880
+ add_symbol=True,
881
+ description='mass of the earth, IAU 2009 GM(E) divided by G from CODATA 2022',
882
+ _key='mearth'
883
+ )
884
+
885
+ GummyConstant(jupiter_mass,unit='kg',
886
+ name='mass of Jupiter',
887
+ symbol='M(J)',
888
+ html_symbol='<i>M</i><sub>J</sub>',
889
+ latex_symbol='M_J',
890
+ add_symbol=True,
891
+ description='mass of Jupiter, IAU 2009 GM(J) divided by G from CODATA 2022',
892
+ _key='mjupiter'
893
+ )
894
+
895
+ GummyConstant(solar_mass,unit='kg',
896
+ name='mass of the sun',
897
+ symbol='M(S)',
898
+ html_symbol='<i>M</i><sub>S</sub>',
899
+ latex_symbol='M_S',
900
+ add_symbol=True,
901
+ description='mass of the sun, IAU 2009 GM(S) divided by G from CODATA 2022',
902
+ _key='msun'
903
+ )