Sources¶
Input current sources that drive neurons via SC-encoded bitstreams.
Bitstream Current Source¶
Converts multiple scalar inputs through weighted SC synapses into a realised
per-cycle current trace. step() consumes that trace one cycle at a time, and
full_current_estimate() returns the mean of the same realised trace.
sc_neurocore.sources.bitstream_current_source.BitstreamCurrentSource
dataclass
¶
Multi-channel bitstream current source.
- Takes scalar inputs x_i in [x_min, x_max]
- Encodes each into a bitstream via BitstreamEncoder
- Passes them through BitstreamSynapses
- Decodes the realised post-synaptic bitstreams into a per-cycle current trace for neuron simulation.
Static inputs and weights are encoded once at construction time. The stochastic realisation is then fixed until a new source is constructed with different parameters or seeds.
Source code in src/sc_neurocore/sources/bitstream_current_source.py
| Python | |
|---|---|
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 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 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
__post_init__()
¶
Validate input/weight lengths and derive the input count.
Source code in src/sc_neurocore/sources/bitstream_current_source.py
| Python | |
|---|---|
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 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 | |
reset()
¶
Reset the realised current trace cursor to its first timestep.
Source code in src/sc_neurocore/sources/bitstream_current_source.py
| Python | |
|---|---|
154 155 156 | |
current_trace()
¶
Return the realised per-cycle decoded current trace.
The returned trace is computed from the fixed post-synaptic
bitstreams generated during construction. It is therefore the
exact sequence consumed by repeated step() calls, not a
separate probability-space approximation.
Source code in src/sc_neurocore/sources/bitstream_current_source.py
| Python | |
|---|---|
158 159 160 161 162 163 164 165 166 167 | |
step()
¶
Return the current I_t at the current time index and advance.
step() returns the t-th element of current_trace() and
clamps at the final element after the bitstream is exhausted.
Source code in src/sc_neurocore/sources/bitstream_current_source.py
| Python | |
|---|---|
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | |
full_current_estimate()
¶
Return the mean current over the realised bitstream duration.
Source code in src/sc_neurocore/sources/bitstream_current_source.py
| Python | |
|---|---|
185 186 187 | |
Quantum Entropy Source¶
Optional integration with quantum random number generators (Qiskit, PennyLane) for true randomness in SC encoding.
sc_neurocore.sources.quantum_entropy
¶
Simulated quantum-measurement entropy source for stochastic inputs.
This module maintains a small classical state-vector simulation, applies Hadamard-style mixing before measurement, and converts seeded measurement outcomes into deterministic pseudo-random samples. It does not claim access to physical quantum hardware or certified quantum random numbers.
QuantumEntropySource
dataclass
¶
Simulated quantum-measurement entropy source.
Injects simulated quantum indeterminacy into neural models by maintaining
a qubit state |psi>, applying Hadamard superposition and phase
rotations, and measuring (collapsing) the state to generate noise.
Source code in src/sc_neurocore/sources/quantum_entropy.py
| Python | |
|---|---|
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
__post_init__()
¶
Initialise the RNG and reset the qubit register to |0>.
Source code in src/sc_neurocore/sources/quantum_entropy.py
| Python | |
|---|---|
34 35 36 37 38 39 | |
sample_normal(mean=0.0, std=1.0)
¶
Two independent measurements → Box-Muller → Gaussian sample.
Discrete outcomes dithered with uniform jitter for continuous input.
Source code in src/sc_neurocore/sources/quantum_entropy.py
| Python | |
|---|---|
70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |
sample()
¶
Return one default normal sample from the simulated measurement source.
Source code in src/sc_neurocore/sources/quantum_entropy.py
| Python | |
|---|---|
85 86 87 | |