Quantum-Tunnelling Oscillators for Cognitive Modelling and Neural Computation: Foundations, Machine-Vision Realisation and Applications
The 1 match
- [1] § 4. Quantum-Cognitive Neural Networks › 4.1. Algorithm › 4.1.1. General Discussion ↔ Quantum-Tunnelling-Neural-Networks-Tutorial/QT_BNN_fashionMNIST_tutorial_paper_final.py, lines 6 to 10 · score 0.57 · Fashion MNIST, pixel, trained, network · Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 248 lines · 8.5 KB · no license · 1 match
- import numpy as np
- import matplotlib.pyplot as plt
- from sklearn.metrics import accuracy_score
- from keras.datasets import fashion_mnist
- # Load and preprocess the dataset
- (x_train, y_train), (x_test, y_test) = fashion_mnist.load_data()
- x_train, x_test = x_train / 255.0, x_test / 255.0 # Normalize pixel values
- x_train, x_test = x_train.reshape(-1, 28 * 28), x_test.reshape(-1, 28 * 28) # Flatten images
- y_train_onehot = np.eye(10)[y_train] # One-hot encode labels
- # Bayesian Neural Network Parameters
- input_dim = 28 * 28
- hidden_dim = 512
- output_dim = 10
- num_samples = 50
- # Initialize weights and biases
- np.random.seed(42)
- W1_mean, W1_std = np.random.randn(input_dim, hidden_dim), np.ones((input_dim, hidden_dim)) * 0.1
- b1_mean, b1_std = np.random.randn(hidden_dim), np.ones(hidden_dim) * 0.1
- W2_mean, W2_std = np.random.randn(hidden_dim, output_dim), np.ones((hidden_dim, output_dim)) * 0.1
- b2_mean, b2_std = np.random.randn(output_dim), np.ones(output_dim) * 0.1
- # Helper functions
- # Physical constants and parameters of the potential barrier
- m = 9.1093837e-31
- hbar = 1.054571817e-34
- qe = 1.60217663e-19
- m1 = 0.5
- Vpot = 30.0 # eV
- ampl = 10.0
- L = m1*hbar/np.sqrt(2*m*qe*Vpot)
- def diffQT(L, E, U0):
- # Precompute constants
- m_qe = m * qe
- hbar_squared = hbar ** 2
- # Create output array
- diffT = np.zeros_like(E)
- # Mask arrays for conditions
- mask_E_neg = E < 0.0
- mask_E_between = (E >= 0.0) & (E < U0)
- mask_E_greater = E > U0
- mask_E_equal = E == U0
- # For E < 0.0, diffT is already 0 (default)
- # For 0 <= E < U0
- if np.any(mask_E_between):
- E_between = E[mask_E_between]
- alpha = E_between - U0
- kappa1 = np.sqrt(-2.0 * m_qe * alpha) / hbar
- beta = U0**2 / (4.0 * E_between * alpha)
- delta1 = kappa1 * L
- T1 = 1.0 / (1.0 - beta * np.sinh(delta1) ** 2)
- diffT[mask_E_between] = -beta * (
- (np.sinh(delta1) ** 2 / E_between)
- + (np.sinh(delta1) ** 2 - delta1 * np.sinh(delta1) * np.cosh(delta1)) / alpha
- ) * T1**2
- # For E > U0
- if np.any(mask_E_greater):
- E_greater = E[mask_E_greater]
- alpha = E_greater - U0
- kappa = np.sqrt(2.0 * m_qe * alpha) / hbar
- beta = U0**2 / (4.0 * E_greater * alpha)
- delta = kappa * L
- T2 = 1.0 / (1.0 + beta * np.sin(delta) ** 2)
- diffT[mask_E_greater] = beta * (
- (np.sin(delta) ** 2 / E_greater)
- + (np.sin(delta) ** 2 - delta * np.sin(delta) * np.cos(delta)) / alpha
- ) * T2**2
- # For E == U0
- if np.any(mask_E_equal):
- diffT[mask_E_equal] = (
- 4 * L**4 * U0 * m**2 * qe**2
- + 6 * L**2 * hbar_squared * m * qe
- ) / (
- 3 * L**4 * U0**2 * m**2 * qe**2
- + 12 * L**2 * U0 * hbar_squared * m * qe
- + 12 * hbar_squared**2
- )
- return diffT
- def QT(L, E, U0):
- # Precompute constants
- m_qe = m * qe
- hbar_squared = hbar ** 2
- # Create output array
- T = np.zeros_like(E)
- # Mask arrays for conditions
- mask_E_neg = E < 0.0
- mask_E_between = (E >= 0.0) & (E < U0)
- mask_E_greater = E > U0
- mask_E_equal = E == U0
- # For E < 0.0, T is already 0 (default)
- # For 0 <= E < U0
- if np.any(mask_E_between):
- E_between = E[mask_E_between]
- alpha = E_between - U0
- kappa1 = np.sqrt(-2.0 * m_qe * alpha) / hbar
- beta = U0**2 / (4.0 * E_between * alpha)
- T[mask_E_between] = 1.0 / (1.0 - beta * np.sinh(kappa1 * L) ** 2)
- # For E > U0
- if np.any(mask_E_greater):
- E_greater = E[mask_E_greater]
- alpha = E_greater - U0
- kappa = np.sqrt(2.0 * m_qe * alpha) / hbar
- beta = U0**2 / (4.0 * E_greater * alpha)
- T[mask_E_greater] = 1.0 / (1.0 + beta * np.sin(kappa * L) ** 2)
- # For E == U0
- if np.any(mask_E_equal):
- T[mask_E_equal] = 1.0 / (
- 1.0 + m * L**2 * U0 * qe / (2.0 * hbar_squared)
- )
- return T
- def softmax(x):
- exps = np.exp(x - np.max(x, axis=1, keepdims=True))
- return exps / np.sum(exps, axis=1, keepdims=True)
- def forward_pass(x, W1, b1, W2, b2):
- z1 = np.dot(x, W1) + b1
- a1 = QT(L, z1*ampl, Vpot)
- z2 = np.dot(a1, W2) + b2
- return softmax(z2)
- def bayesian_predict(x, num_samples, W1_mean, W1_std, b1_mean, b1_std, W2_mean, W2_std, b2_mean, b2_std):
- predictions = np.zeros((num_samples, x.shape[0], output_dim))
- for i in range(num_samples):
- W1_sample = W1_mean + W1_std * np.random.randn(*W1_mean.shape)
- b1_sample = b1_mean + b1_std * np.random.randn(*b1_mean.shape)
- W2_sample = W2_mean + W2_std * np.random.randn(*W2_mean.shape)
- b2_sample = b2_mean + b2_std * np.random.randn(*b2_mean.shape)
- predictions[i] = forward_pass(x, W1_sample, b1_sample, W2_sample, b2_sample)
- return predictions.mean(axis=0)
- # Training Function
- def train_bnn(x_train, y_train, epochs, lr):
- global W1_mean, W1_std, b1_mean, b1_std, W2_mean, W2_std, b2_mean, b2_std
- loss_history = []
- accuracy_history = []
- for epoch in range(epochs):
- W1_sample = W1_mean + W1_std * np.random.randn(*W1_mean.shape)
- b1_sample = b1_mean + b1_std * np.random.randn(*b1_mean.shape)
- W2_sample = W2_mean + W2_std * np.random.randn(*W2_mean.shape)
- b2_sample = b2_mean + b2_std * np.random.randn(*b2_mean.shape)
- predictions = forward_pass(x_train, W1_sample, b1_sample, W2_sample, b2_sample)
- loss = -np.mean(np.sum(y_train * np.log(predictions + 1e-9), axis=1))
- loss_history.append(loss)
- grad_output = predictions - y_train
- grad_W2 = np.dot(QT(L, ampl*(np.dot(x_train, W1_sample) + b1_sample), Vpot).T, grad_output) / x_train.shape[0]
- grad_b2 = np.mean(grad_output, axis=0)
- grad_hidden = np.dot(grad_output, W2_sample.T) * diffQT(L, ampl*(np.dot(x_train, W1_sample) + b1_sample), Vpot)
- grad_W1 = np.dot(x_train.T, grad_hidden) / x_train.shape[0]
- grad_b1 = np.mean(grad_hidden, axis=0)
- W1_mean -= lr * grad_W1
- W1_std -= lr * grad_W1 # Update W1_std as well
- b1_mean -= lr * grad_b1
- b1_std -= lr * grad_b1 # Update b1_std as well
- W2_mean -= lr * grad_W2
- W2_std -= lr * grad_W2 # Update W2_std as well
- b2_mean -= lr * grad_b2
- b2_std -= lr * grad_b2 # Update b2_std as well
- train_acc = accuracy_score(np.argmax(y_train, axis=1), np.argmax(predictions, axis=1))
- accuracy_history.append(train_acc)
- print(f"Epoch {epoch + 1}, Loss: {loss:.4f}, Accuracy: {train_acc:.4f}")
- return loss_history, accuracy_history
- # Visualize Results
- def visualize_results(loss_history, accuracy_history, W1_std, W2_std):
- plt.figure(figsize=(12, 6))
- # Loss vs. Epochs
- plt.subplot(1, 3, 1)
- plt.plot(loss_history, label="Loss")
- plt.xlabel("Epochs")
- plt.ylabel("Loss")
- plt.title("Training Loss")
- plt.legend()
- # Accuracy vs. Epochs
- plt.subplot(1, 3, 2)
- plt.plot(accuracy_history, label="Accuracy", color="green")
- plt.xlabel("Epochs")
- plt.ylabel("Accuracy")
- plt.title("Training Accuracy")
- plt.legend()
- # Weight Standard Deviations
- plt.subplot(1, 3, 3)
- plt.hist(W1_std.flatten(), bins=50, alpha=0.7, label="W1 std")
- plt.hist(W2_std.flatten(), bins=50, alpha=0.7, label="W2 std")
- plt.xlabel("Standard Deviation")
- plt.ylabel("Frequency")
- plt.title("Weight Standard Deviations")
- plt.legend()
- plt.tight_layout()
- plt.show()
- # Train the BNN
- #loss_history, accuracy_history = train_bnn(x_train[:1000], y_train_onehot[:1000], epochs=500, lr=0.5)
- loss_history, accuracy_history = train_bnn(x_train, y_train_onehot, epochs=1000, lr=0.5)
- # Visualize the training process
- visualize_results(loss_history, accuracy_history, W1_std, W2_std)
- # Predict on test data
- test_predictions = np.argmax(bayesian_predict(x_test, num_samples, W1_mean, W1_std, b1_mean, b1_std, W2_mean, W2_std, b2_mean, b2_std), axis=1)
- test_accuracy = np.mean(test_predictions == y_test)
- print(f"Test Accuracy: {test_accuracy:.4f}")
- # Display some classified images
- labels_map = ['T-shirt/top', 'Trouser', 'Pullover', 'Dress', 'Coat', 'Sandal', 'Shirt', 'Sneaker', 'Bag', 'Ankle boot']
- x_test_images = x_test.reshape(-1, 28, 28)
- plt.figure(figsize=(10, 10))
- for i in range(16):
- idx = np.random.randint(0, len(x_test))
- plt.subplot(4, 4, i + 1)
- plt.imshow(x_test_images[idx], cmap='gray')
- plt.title(f"Pred: {labels_map[test_predictions[idx]]}\nTrue: {labels_map[y_test[idx]]}")
- plt.axis('off')
- plt.tight_layout()
- plt.show()
QT_BNN_fashionMNIST_tutorial_paper_final.py at commit e7c6edd, no license · at the source
Overview
- Seymour Research Laboratories, Seymour, VIC 3660, Australia
Abstract
I present a quantum-tunnelling oscillator model as a universal dynamical engine for two paradigmatic problems in quantum cognition theory—optical illusion perception and group decision making—where individuals are treated as quantum-mechanical agents whose choices shift through context-dependent transitions rather than simple probabilities. I show that, when networked together, these units form a quantum-cognitive neural system that reproduces familiar collective and perceptual phenomena while naturally accommodating counterintuitive processes that challenge classical models. Bridging ideas from quantum cognition theory and neural networks, this approach offers a compact, physically grounded way to describe how real individuals and groups think, perceive and decide.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repositories
Its files are read in the Code ↔ Paper reader above, with 1 match between paragraphs and lines of code.
IvanMaksymov/Quantum-Tunnelling-Neural-Networks-Tutorial
8b8b20231087a39a25fbb36ad0710da6eb66ef1b, 22 February 2025Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
6 files
- QT-RNN/
data.py , Python, 83 lines - QT-RNN/
main_qt.py , Python, 83 lines - QT-RNN/
rnn_qt.py , Python, 200 lines - QTNN_classify_MNIST_tuto
rial_paper_final.py , Python, 225 lines - QT_BNN_fashionMNIST_tuto
rial_paper_final.py , Python, 248 lines - QT_ESN_tutorial_paper_fi
nal.py , Python, 153 lines
ivanmaksymov/cognition-in-superposition
e7c6edd7a5f2d5042e130f69df0272ebc23e8373, 18 February 2026Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
16 files
- Book_Crank_Nicolson_meth
od.py , Python, 58 lines - Book_FDTD_DoubleParaboli
c.py , Python, 101 lines - Book_opinion_polarisatio
n.py , Python, 164 lines - Magnetisation-Preference
-Reversal/ , Fortran, 474 linesPSYCH_main.f90 - Magnetisation-Preference
-Reversal/ , Fortran, 31 linescdot.f90 - Magnetisation-Preference
-Reversal/ , Fortran, 37 linesconfig_PSYCH.f90 - Military-Trucks/
alternative_version_CIFA , Python, 89 linesR_military_for_book.py - Quantum-Cognitive-NN-Sta
tistical-Analysis/ , Python, 119 linesW1W2_compare_JSD.py - Quantum-Cognitive-NN-Sta
tistical-Analysis/ , Python, 102 linespaper_res_plot_JSD_SEv2. py - Quantum-Tunnelling-Neura
l-Networks-Tutorial/ , Python, 225 linesQTNN_classify_MNIST_tuto rial_paper_final.py - Quantum-Tunnelling-Neura
l-Networks-Tutorial/ , Python, 248 lines, 1 matchQT_BNN_fashionMNIST_tuto rial_paper_final.py - Quantum-Tunnelling-Neura
l-Networks-Tutorial/ , Python, 153 linesQT_ESN_tutorial_paper_fi nal.py - Quantum-Tunnelling-Neura
l-Networks-Tutorial/ , Python, 83 linesdata.py - Quantum-Tunnelling-Neura
l-Networks-Tutorial/ , Python, 83 linesmain_qt.py - Quantum-Tunnelling-Neura
l-Networks-Tutorial/ , Python, 200 linesrnn_qt.py - README.md, Text, 11 lines
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 21 scripts, each with its path and the digest of its content;
- 1 match between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data Availability Statement
The source codes that implement the neural network models discussed in this paper are available in the GitHub repository, https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 1 author, 9 keywords, 127 references.
Cite
This paper
Maksymov, I. S. (2026). Quantum-Tunnelling Oscillators for Cognitive Modelling and Neural Computation: Foundations, Machine-Vision Realisation and Applications. Entropy (Basel, Switzerland), 28(6), 697.
BibTeX
@article{maksymov2026qua
author = {Maksymov, Ivan S.},
title = {{Quantum-Tunnelling Oscillators for Cognitive Modelling and Neural Computation: Foundations, Machine-Vision Realisation and Applications}},
journal = {Entropy (Basel, Switzerland)},
year = {2026},
month = jun,
volume = {28},
number = {6},
pages = {697},
publisher = {Multidisciplinary Digital Publishing Institute (MDPI)},
issn = {1099-4300},
pmcid = {PMC13297894}
}
RIS
TY - JOUR
AU - Maksymov, Ivan S.
TI - Quantum-Tunnelling Oscillators for Cognitive Modelling and Neural Computation: Foundations, Machine-Vision Realisation and Applications
T2 - Entropy (Basel, Switzerland)
J2 - Entropy (Basel)
PY - 2026
DA - 2026/
VL - 28
IS - 6
SP - 697
SN - 1099-4300
PB - Multidisciplinary Digital Publishing Institute (MDPI)
LA - en
ER -
CSL-JSON
{
"id": "pmcid:PMC13297894",
"type": "article-journal",
"title": "Quantum-Tunnelling Oscillators for Cognitive Modelling and Neural Computation: Foundations, Machine-Vision Realisation and Applications",
"container-title": "Entropy (Basel, Switzerland)",
"author": [
{
"family": "Maksymov",
"given": "Ivan S."
}
],
"container-title-short":
"volume": "28",
"issue": "6",
"page": "697",
"PMCID": "PMC13297894",
"ISSN": "1099-4300",
"publisher": "Multidisciplinary Digital Publishing Institute (MDPI)",
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
1
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1016/j.crmeth.2024.100964 [code]
- Unifying community whole-brain imaging datasets enables robust neuron identification and reveals determinants of neuron position in C. elegans.Journal: Cell reports methodsIn common: Keras, OpenCV, TensorFlow, 4 other tools, 1 reference
- [2] doi:10.1007/s11571-023-10038-0 [code]
- Coincidence detection and integration behavior in spiking neural networks.Journal: Cognitive neurodynamicsIn common: Keras, TensorFlow, scikit-learn, 3 other tools, 1 reference
- [3] doi:10.1016/j.isci.2024.108845 [code]
- Emergence of brain-inspired small-world spiking neural network through neuroevolution.Journal: iScienceIn common: OpenCV, TensorFlow, scikit-learn, 3 other tools, 1 reference
- [4] doi:10.3389/fnins.2024.1439414 [code]
- Spiking representation learning for associative memories.Journal: Frontiers in neuroscienceIn common: OpenCV, TensorFlow, scikit-learn, 3 other tools, 1 reference
- [5] doi:10.1038/s41467-025-62069-2 [code]
- Temporal coding carries more stable cortical visual representations than firing rate over time.Journal: Nature communicationsIn common: Keras, TensorFlow, scikit-learn, 3 other tools, 1 reference
- [6] doi:10.1117/1.nph.12.4.045003 [code]
- Anisotropic light propagation in human brain white matter.Journal: NeurophotonicsIn common: Keras, TensorFlow, SciPy, 2 other tools, 1 reference
- [7] doi: [code]
- Going deeper with morphologically detailed neural networks by simulation-based gradient propagationJournal: Frontiers in computational neuroscienceIn common: Keras, TensorFlow, SciPy, 2 other tools, 1 reference
- [8] doi:10.1162/imag_a_00025 [code]
- Application of a &
lt;sup& gt;1& lt;/ sup& gt;H brain MRS benchmark dataset to deep learning for out-of-voxel artifacts. Journal: Imaging neuroscience (Cambridge, Mass.)In common: Keras, TensorFlow, SciPy, 2 other tools, 1 reference - [9] doi:10.1038/s41467-025-61458-x [code]
- Computational models reveal that intuitive physics underlies visual processing of soft objects.Journal: Nature communicationsIn common: OpenCV, scikit-learn, SciPy, 2 other tools, 1 reference
- [10] doi:10.1038/s41467-024-54688-y [code]
- Dynamic tracking of objects in the macaque dorsomedial frontal cortex.Journal: Nature communicationsIn common: TensorFlow, scikit-learn, SciPy, 2 other tools, 1 reference
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 2 repositories of the authors' code, each at its verified commit and with its license, 21 scripts, and 1 match between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:c4725fac53ab8354…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/repo/github.com/ivanmaksymov/quantum-tunnelling-neural-networks-tutorial)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/repo/github.com/ivanmaksymov/quantum-tunnelling-neural-networks-tutorial.svg
:target: https://openscicode.org/badge/repo/github.com/ivanmaksymov/quantum-tunnelling-neural-networks-tutorial
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/repo/github.com/ivanmaksymov/quantum-tunnelling-neural-networks-tutorial"><img src="https://openscicode.org/badge/repo/github.com/ivanmaksymov/quantum-tunnelling-neural-networks-tutorial.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
- IvanMaksymov/Quantum-Tunnelling-Neural-Networks-Tutorial on GitHub (add a README there)
- ivanmaksymov/cognition-in-superposition: README.md on GitHub
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
