@aleph-ai/tinyaleph 1.4.4 → 1.5.2
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.
- package/backends/bioinformatics/binding.js +44 -52
- package/backends/bioinformatics/dna-computing.js +14 -23
- package/backends/bioinformatics/encoding.js +22 -30
- package/backends/bioinformatics/folding.js +24 -32
- package/backends/bioinformatics/genetic-code.js +17 -21
- package/backends/bioinformatics/index.js +12 -12
- package/backends/bioinformatics/transcription.js +5 -3
- package/backends/bioinformatics/translation.js +6 -4
- package/backends/cryptographic/index.js +10 -9
- package/backends/index.js +7 -6
- package/backends/interface.js +4 -1
- package/backends/scientific/index.js +7 -4
- package/backends/semantic/index.js +7 -4
- package/backends/semantic/surface.js +2 -1
- package/backends/semantic/two-layer.js +5 -3
- package/core/beacon.js +10 -9
- package/core/compound.js +4 -4
- package/core/crt-homology.js +40 -13
- package/core/enochian-vocabulary.js +5 -17
- package/core/enochian.js +3 -2
- package/core/entanglement.js +7 -7
- package/core/errors.js +2 -10
- package/core/events.js +7 -6
- package/core/fano.js +7 -6
- package/core/hilbert.js +40 -34
- package/core/hypercomplex.js +4 -2
- package/core/index.js +42 -80
- package/core/inference.js +6 -6
- package/core/lambda.js +5 -18
- package/core/llm.js +1 -1
- package/core/logger.js +3 -4
- package/core/prime.js +26 -1
- package/core/quaternion-semantics.js +3 -3
- package/core/reduction.js +5 -21
- package/core/resonance.js +20 -6
- package/core/rformer-crt.js +15 -29
- package/core/rformer-layers.js +12 -14
- package/core/rformer-tf.js +34 -43
- package/core/rformer.js +17 -32
- package/core/sieve.js +8 -3
- package/core/symbols/archetypes.js +3 -3
- package/core/symbols/base.js +4 -4
- package/core/symbols/elements.js +6 -3
- package/core/symbols/hieroglyphs.js +3 -3
- package/core/symbols/iching.js +3 -3
- package/core/symbols/index.js +32 -18
- package/core/symbols/tarot.js +6 -3
- package/core/symbols.js +26 -4
- package/core/topology.js +3 -14
- package/core/types.js +3 -14
- package/engine/aleph.js +8 -6
- package/engine/index.js +4 -2
- package/index.js +3 -2
- package/modular.js +18 -41
- package/package.json +4 -2
- package/physics/collapse.js +10 -11
- package/physics/entropy.js +8 -8
- package/physics/index.js +70 -102
- package/physics/kuramoto-coupled-ladder.js +10 -14
- package/physics/kuramoto.js +5 -2
- package/physics/lyapunov.js +7 -7
- package/physics/oscillator.js +5 -1
- package/physics/primeon_z_ladder_multi.js +7 -9
- package/physics/primeon_z_ladder_u.js +8 -9
- package/physics/stochastic-kuramoto.js +7 -7
- package/physics/sync-models.js +11 -14
- package/telemetry/index.js +1 -1
- package/telemetry/metrics.js +3 -8
package/physics/index.js
CHANGED
|
@@ -2,146 +2,114 @@
|
|
|
2
2
|
* Physics engine - exports all physics modules
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
shannonEntropy,
|
|
5
|
+
import { Oscillator, OscillatorBank } from './oscillator.js';
|
|
6
|
+
import { KuramotoModel } from './kuramoto.js';
|
|
7
|
+
|
|
8
|
+
import { shannonEntropy,
|
|
9
9
|
stateEntropy,
|
|
10
10
|
coherence,
|
|
11
11
|
mutualInformation,
|
|
12
12
|
relativeEntropy,
|
|
13
13
|
jointEntropy,
|
|
14
|
-
oscillatorEntropy
|
|
15
|
-
|
|
16
|
-
const {
|
|
17
|
-
estimateLyapunov,
|
|
14
|
+
oscillatorEntropy } from './entropy.js';
|
|
15
|
+
import { estimateLyapunov,
|
|
18
16
|
classifyStability,
|
|
19
17
|
adaptiveCoupling,
|
|
20
18
|
localLyapunov,
|
|
21
19
|
delayEmbedding,
|
|
22
|
-
stabilityMargin
|
|
23
|
-
|
|
24
|
-
const {
|
|
25
|
-
collapseProbability,
|
|
20
|
+
stabilityMargin } from './lyapunov.js';
|
|
21
|
+
import { collapseProbability,
|
|
26
22
|
shouldCollapse,
|
|
27
23
|
measureState,
|
|
28
24
|
collapseToIndex,
|
|
29
25
|
bornMeasurement,
|
|
30
26
|
partialCollapse,
|
|
31
|
-
applyDecoherence
|
|
32
|
-
} = require('./collapse');
|
|
27
|
+
applyDecoherence } from './collapse.js';
|
|
33
28
|
|
|
34
29
|
// Extended synchronization models
|
|
35
|
-
|
|
36
|
-
NetworkKuramoto,
|
|
30
|
+
import { NetworkKuramoto,
|
|
37
31
|
AdaptiveKuramoto,
|
|
38
32
|
SakaguchiKuramoto,
|
|
39
33
|
SmallWorldKuramoto,
|
|
40
34
|
MultiSystemCoupling,
|
|
41
35
|
createHierarchicalCoupling,
|
|
42
|
-
createPeerCoupling
|
|
43
|
-
} = require('./sync-models');
|
|
36
|
+
createPeerCoupling } from './sync-models.js';
|
|
44
37
|
|
|
45
38
|
// Stochastic Kuramoto models
|
|
46
|
-
|
|
47
|
-
StochasticKuramoto,
|
|
39
|
+
import { StochasticKuramoto,
|
|
48
40
|
ColoredNoiseKuramoto,
|
|
49
41
|
ThermalKuramoto,
|
|
50
|
-
gaussianRandom
|
|
51
|
-
} = require('./stochastic-kuramoto');
|
|
42
|
+
gaussianRandom } from './stochastic-kuramoto.js';
|
|
52
43
|
|
|
53
44
|
// Primeon Z-Ladder with canonical U evolution
|
|
54
|
-
|
|
55
|
-
PrimeonZLadderU,
|
|
45
|
+
import { PrimeonZLadderU,
|
|
56
46
|
createPrimeonLadder,
|
|
57
47
|
shannonEntropyNats,
|
|
58
48
|
probsOf,
|
|
59
|
-
normalize
|
|
60
|
-
C
|
|
61
|
-
} = require('./primeon_z_ladder_u');
|
|
49
|
+
normalize as normalizeComplex,
|
|
50
|
+
C as Complex } from './primeon_z_ladder_u.js';
|
|
62
51
|
|
|
63
52
|
// Multi-channel Primeon Z-Ladder
|
|
64
|
-
|
|
65
|
-
ZChannel,
|
|
53
|
+
import { ZChannel,
|
|
66
54
|
PrimeonZLadderMulti,
|
|
67
55
|
createMultiChannelLadder,
|
|
68
|
-
createAdiabaticSchedule
|
|
69
|
-
} = require('./primeon_z_ladder_multi');
|
|
56
|
+
createAdiabaticSchedule } from './primeon_z_ladder_multi.js';
|
|
70
57
|
|
|
71
58
|
// Kuramoto-coupled ladder (hybrid quantum + oscillator dynamics)
|
|
72
|
-
|
|
73
|
-
KuramotoCoupledLadder,
|
|
59
|
+
import { KuramotoCoupledLadder,
|
|
74
60
|
createKuramotoLadder,
|
|
75
61
|
runCollapsePressureExperiment,
|
|
76
62
|
kuramotoOrderParameter,
|
|
77
|
-
getPhase
|
|
78
|
-
} = require('./kuramoto-coupled-ladder');
|
|
63
|
+
getPhase } from './kuramoto-coupled-ladder.js';
|
|
79
64
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
// Lyapunov stability
|
|
132
|
-
estimateLyapunov,
|
|
133
|
-
classifyStability,
|
|
134
|
-
adaptiveCoupling,
|
|
135
|
-
localLyapunov,
|
|
136
|
-
delayEmbedding,
|
|
137
|
-
stabilityMargin,
|
|
138
|
-
|
|
139
|
-
// State collapse
|
|
140
|
-
collapseProbability,
|
|
141
|
-
shouldCollapse,
|
|
142
|
-
measureState,
|
|
143
|
-
collapseToIndex,
|
|
144
|
-
bornMeasurement,
|
|
145
|
-
partialCollapse,
|
|
146
|
-
applyDecoherence
|
|
65
|
+
export {
|
|
66
|
+
Oscillator,
|
|
67
|
+
OscillatorBank,
|
|
68
|
+
KuramotoModel,
|
|
69
|
+
NetworkKuramoto,
|
|
70
|
+
AdaptiveKuramoto,
|
|
71
|
+
SakaguchiKuramoto,
|
|
72
|
+
SmallWorldKuramoto,
|
|
73
|
+
MultiSystemCoupling,
|
|
74
|
+
createHierarchicalCoupling,
|
|
75
|
+
createPeerCoupling,
|
|
76
|
+
StochasticKuramoto,
|
|
77
|
+
ColoredNoiseKuramoto,
|
|
78
|
+
ThermalKuramoto,
|
|
79
|
+
gaussianRandom,
|
|
80
|
+
PrimeonZLadderU,
|
|
81
|
+
createPrimeonLadder,
|
|
82
|
+
shannonEntropyNats,
|
|
83
|
+
probsOf,
|
|
84
|
+
normalizeComplex,
|
|
85
|
+
Complex,
|
|
86
|
+
ZChannel,
|
|
87
|
+
PrimeonZLadderMulti,
|
|
88
|
+
createMultiChannelLadder,
|
|
89
|
+
createAdiabaticSchedule,
|
|
90
|
+
KuramotoCoupledLadder,
|
|
91
|
+
createKuramotoLadder,
|
|
92
|
+
runCollapsePressureExperiment,
|
|
93
|
+
kuramotoOrderParameter,
|
|
94
|
+
getPhase,
|
|
95
|
+
shannonEntropy,
|
|
96
|
+
stateEntropy,
|
|
97
|
+
coherence,
|
|
98
|
+
mutualInformation,
|
|
99
|
+
relativeEntropy,
|
|
100
|
+
jointEntropy,
|
|
101
|
+
oscillatorEntropy,
|
|
102
|
+
estimateLyapunov,
|
|
103
|
+
classifyStability,
|
|
104
|
+
adaptiveCoupling,
|
|
105
|
+
localLyapunov,
|
|
106
|
+
delayEmbedding,
|
|
107
|
+
stabilityMargin,
|
|
108
|
+
collapseProbability,
|
|
109
|
+
shouldCollapse,
|
|
110
|
+
measureState,
|
|
111
|
+
collapseToIndex,
|
|
112
|
+
bornMeasurement,
|
|
113
|
+
partialCollapse,
|
|
114
|
+
applyDecoherence
|
|
147
115
|
};
|
|
@@ -21,19 +21,15 @@
|
|
|
21
21
|
|
|
22
22
|
'use strict';
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
PrimeonZLadderMulti,
|
|
24
|
+
import { PrimeonZLadderMulti,
|
|
26
25
|
ZChannel,
|
|
27
26
|
createMultiChannelLadder,
|
|
28
|
-
createAdiabaticSchedule
|
|
29
|
-
} = require('./primeon_z_ladder_multi');
|
|
27
|
+
createAdiabaticSchedule } from './primeon_z_ladder_multi.js';
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
C,
|
|
29
|
+
import { C,
|
|
33
30
|
shannonEntropyNats,
|
|
34
31
|
probsOf,
|
|
35
|
-
normalize
|
|
36
|
-
} = require('./primeon_z_ladder_u');
|
|
32
|
+
normalize } from './primeon_z_ladder_u.js';
|
|
37
33
|
|
|
38
34
|
/**
|
|
39
35
|
* Extract phase from complex number
|
|
@@ -594,10 +590,10 @@ function runCollapsePressureExperiment(opts = {}) {
|
|
|
594
590
|
return results;
|
|
595
591
|
}
|
|
596
592
|
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
593
|
+
export {
|
|
594
|
+
KuramotoCoupledLadder,
|
|
595
|
+
createKuramotoLadder,
|
|
596
|
+
runCollapsePressureExperiment,
|
|
597
|
+
kuramotoOrderParameter,
|
|
598
|
+
getPhase
|
|
603
599
|
};
|
package/physics/kuramoto.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Kuramoto synchronization dynamics
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
import { OscillatorBank } from './oscillator.js';
|
|
5
6
|
|
|
6
7
|
class KuramotoModel extends OscillatorBank {
|
|
7
8
|
constructor(frequencies, couplingStrength = 0.3) {
|
|
@@ -88,4 +89,6 @@ class KuramotoModel extends OscillatorBank {
|
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
|
|
91
|
-
|
|
92
|
+
export {
|
|
93
|
+
KuramotoModel
|
|
94
|
+
};
|
package/physics/lyapunov.js
CHANGED
|
@@ -70,11 +70,11 @@ function stabilityMargin(lyapunovExponent, threshold = 0.1) {
|
|
|
70
70
|
return threshold - lyapunovExponent;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
export {
|
|
74
|
+
estimateLyapunov,
|
|
75
|
+
classifyStability,
|
|
76
|
+
adaptiveCoupling,
|
|
77
|
+
localLyapunov,
|
|
78
|
+
delayEmbedding,
|
|
79
|
+
stabilityMargin
|
|
80
80
|
};
|
package/physics/oscillator.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* by input to become active. This ensures the field response
|
|
6
6
|
* reflects the input, not a default full-amplitude state.
|
|
7
7
|
*/
|
|
8
|
+
|
|
8
9
|
class Oscillator {
|
|
9
10
|
constructor(frequency, phase = 0, amplitude = 0) { // Start quiescent!
|
|
10
11
|
this.freq = frequency;
|
|
@@ -92,4 +93,7 @@ class OscillatorBank {
|
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
95
|
|
|
95
|
-
|
|
96
|
+
// Named exports for ESM compatibility
|
|
97
|
+
export { Oscillator, OscillatorBank };
|
|
98
|
+
|
|
99
|
+
export default { Oscillator, OscillatorBank };
|
|
@@ -16,13 +16,11 @@
|
|
|
16
16
|
|
|
17
17
|
'use strict';
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
PrimeonZLadderU,
|
|
19
|
+
import { PrimeonZLadderU,
|
|
21
20
|
C,
|
|
22
21
|
shannonEntropyNats,
|
|
23
22
|
probsOf,
|
|
24
|
-
normalize
|
|
25
|
-
} = require('./primeon_z_ladder_u');
|
|
23
|
+
normalize } from './primeon_z_ladder_u.js';
|
|
26
24
|
|
|
27
25
|
/**
|
|
28
26
|
* Z Channel configuration
|
|
@@ -661,9 +659,9 @@ function createAdiabaticSchedule(J0, J1, T, schedule = 'linear') {
|
|
|
661
659
|
}
|
|
662
660
|
}
|
|
663
661
|
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
662
|
+
export {
|
|
663
|
+
ZChannel,
|
|
664
|
+
PrimeonZLadderMulti,
|
|
665
|
+
createMultiChannelLadder,
|
|
666
|
+
createAdiabaticSchedule
|
|
669
667
|
};
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
/**
|
|
14
14
|
* Minimal Complex number helpers (intentionally tiny for predictable perf).
|
|
15
15
|
*/
|
|
16
|
+
|
|
16
17
|
class C {
|
|
17
18
|
constructor(re = 0, im = 0) {
|
|
18
19
|
this.re = re;
|
|
@@ -481,13 +482,11 @@ function createPrimeonLadder(primes, opts = {}) {
|
|
|
481
482
|
return ladder;
|
|
482
483
|
}
|
|
483
484
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
// Export Complex class for advanced usage
|
|
492
|
-
C
|
|
485
|
+
export {
|
|
486
|
+
PrimeonZLadderU,
|
|
487
|
+
createPrimeonLadder,
|
|
488
|
+
shannonEntropyNats,
|
|
489
|
+
probsOf,
|
|
490
|
+
normalize,
|
|
491
|
+
C
|
|
493
492
|
};
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
|
|
14
14
|
'use strict';
|
|
15
15
|
|
|
16
|
-
const { KuramotoModel } = require('./kuramoto');
|
|
17
|
-
|
|
18
16
|
/**
|
|
19
17
|
* Box-Muller transform for Gaussian random numbers
|
|
20
18
|
* @returns {number} Standard normal random variable
|
|
21
19
|
*/
|
|
20
|
+
import { KuramotoModel } from './kuramoto.js';
|
|
21
|
+
|
|
22
22
|
function gaussianRandom() {
|
|
23
23
|
const u1 = Math.random();
|
|
24
24
|
const u2 = Math.random();
|
|
@@ -558,9 +558,9 @@ class ThermalKuramoto extends StochasticKuramoto {
|
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
561
|
+
export {
|
|
562
|
+
StochasticKuramoto,
|
|
563
|
+
ColoredNoiseKuramoto,
|
|
564
|
+
ThermalKuramoto,
|
|
565
|
+
gaussianRandom
|
|
566
566
|
};
|
package/physics/sync-models.js
CHANGED
|
@@ -9,9 +9,6 @@
|
|
|
9
9
|
* - MultiSystemCoupling: Cross-system synchronization
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
const { KuramotoModel } = require('./kuramoto');
|
|
13
|
-
const { OscillatorBank } = require('./oscillator');
|
|
14
|
-
|
|
15
12
|
/**
|
|
16
13
|
* NetworkKuramoto - Topology-Aware Coupling
|
|
17
14
|
*
|
|
@@ -20,6 +17,9 @@ const { OscillatorBank } = require('./oscillator');
|
|
|
20
17
|
*
|
|
21
18
|
* Enables modular synchronization respecting semantic neighborhoods.
|
|
22
19
|
*/
|
|
20
|
+
import { KuramotoModel } from './kuramoto.js';
|
|
21
|
+
import { OscillatorBank } from './oscillator.js';
|
|
22
|
+
|
|
23
23
|
class NetworkKuramoto extends KuramotoModel {
|
|
24
24
|
/**
|
|
25
25
|
* @param {number[]} frequencies - Natural frequencies
|
|
@@ -756,15 +756,12 @@ function createPeerCoupling(frequencies, numPeers = 3, strength = 0.15) {
|
|
|
756
756
|
return new MultiSystemCoupling(systems, G);
|
|
757
757
|
}
|
|
758
758
|
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
// Factory functions
|
|
768
|
-
createHierarchicalCoupling,
|
|
769
|
-
createPeerCoupling
|
|
759
|
+
export {
|
|
760
|
+
NetworkKuramoto,
|
|
761
|
+
AdaptiveKuramoto,
|
|
762
|
+
SakaguchiKuramoto,
|
|
763
|
+
SmallWorldKuramoto,
|
|
764
|
+
MultiSystemCoupling,
|
|
765
|
+
createHierarchicalCoupling,
|
|
766
|
+
createPeerCoupling
|
|
770
767
|
};
|
package/telemetry/index.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Browser-compatible: No Node.js dependencies.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
|
-
*
|
|
13
|
+
* import { MetricRegistry, Counter, Gauge } from '@aleph-ai/tinyaleph/telemetry';
|
|
14
14
|
*
|
|
15
15
|
* const registry = new MetricRegistry({ prefix: 'myapp_' });
|
|
16
16
|
* const requests = registry.counter('requests_total', { help: 'Total requests' });
|
package/telemetry/metrics.js
CHANGED
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
* Extracted from apps/sentient/lib/telemetry.js for library reuse.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
const { SimpleEventEmitter } = require('../core/errors');
|
|
16
|
-
|
|
17
15
|
// ============================================================================
|
|
18
16
|
// METRIC TYPES
|
|
19
17
|
// ============================================================================
|
|
20
18
|
|
|
19
|
+
import { SimpleEventEmitter } from '../core/errors.js';
|
|
20
|
+
|
|
21
21
|
const MetricType = {
|
|
22
22
|
COUNTER: 'counter',
|
|
23
23
|
GAUGE: 'gauge',
|
|
@@ -692,17 +692,12 @@ class MetricRegistry extends SimpleEventEmitter {
|
|
|
692
692
|
// EXPORTS
|
|
693
693
|
// ============================================================================
|
|
694
694
|
|
|
695
|
-
|
|
696
|
-
// Metric types
|
|
695
|
+
export {
|
|
697
696
|
MetricType,
|
|
698
|
-
|
|
699
|
-
// Metric classes
|
|
700
697
|
Metric,
|
|
701
698
|
Counter,
|
|
702
699
|
Gauge,
|
|
703
700
|
Histogram,
|
|
704
701
|
Summary,
|
|
705
|
-
|
|
706
|
-
// Registry
|
|
707
702
|
MetricRegistry
|
|
708
703
|
};
|