Variational Quantum RNS Comparator: A Cluster-Inspired Quantum Machine Learning Architecture for Residue Number Systems | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article Variational Quantum RNS Comparator: A Cluster-Inspired Quantum Machine Learning Architecture for Residue Number Systems Parham Ghayour This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-8296596/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract Residue Number Systems (RNS) offer a highly parallel and carry-freerepresentation for arithmetic, yet the fundamental operation of magnitude compar-ison is notoriously non-trivial due to the loss of positional ordering across residues.In 2010, the first cluster-based method for RNS comparison was introduced, show-ing that global ordering can be recovered from algebraic partitions of the residuedomain. In this work we reformulate this principle in the quantum setting and pro-pose ClusterNet, a variational quantum architecture whose entanglement structuremirrors the cluster geometry of the RNS domain. ClusterNet embeds the residuesof two integers into a multi-register quantum state, uses intra- and inter-registerentanglement to encode relative structure, and extracts a comparator bit through aparameterized flag qubit. We show that ClusterNet can exactly represent the RNScomparator via a reversible quantum circuit and prove expressivity guarantees forthe ansatz family. Because large-scale variational training of quantum circuits remains challeng-ing, we validate the underlying inductive bias through a classical surrogate modelthat preserves ClusterNet’s residue decomposition. A two-hidden-layer neural net-work trained on the full RNS domain (3, 5, 7) successfully learns the magnituderelation X > Y with 95–97% accuracy and reveals geometric patterns correspond-ing to the same residue clusters that structure our quantum design. The learneddecision boundary exhibits a sharp diagonal and highly interpretable modular stri-ations, demonstrating that the cluster-based representation is both natural andlearnable. Taken together, our theoretical construction and empirical results show thatClusterNet provides a principled quantum representation of the RNS compari-son problem and captures the algebraic geometry underlying magnitude ordering.This establishes cluster-structured residue embeddings as a promising direction forquantum arithmetic, hybrid quantum-classical architectures, and future quantumaccelerators for modular computation. Full Text Additional Declarations No competing interests reported. Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-8296596","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":556599423,"identity":"5c0dc58c-08b5-4ac9-947c-846e517a00d6","order_by":0,"name":"Parham Ghayour","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABQ0lEQVRIie3RsWrCQBjA8YMrTpGuVyK5JxAuHASk4GN06XKh4C2RCoHi4BAQ4tJ2TsnQV6gIzoFAugRnIaXYxflEECepdw3FVDt063D/4XKB+91HCAA63X+NlU+oVvT1YsklWfyFUEXY8elKFeIGh7cd1Bw9pGLRT2+BOVyue4MpwNfDJVqF7/z5Kv3YT2lbzaBCnHzWQSxPW0Ejo3GUFcB+y5yLp9DvjosO2ZMb6iRVMvcc4IYpAYhRaNT2JGKOWQ9ZdxwzSRJ3ekSocHeS8DU0dpLwjSTcjrn4hRDkBpJ4FNbDAmDkqSkMm97pKXnuIJZxUmvkPqw/FgZBnt+KZsx+Mb1ewsjxt7ze09V2cEnOzdEEGpvCwhEfz8UdwzjmEyH6besH+a5W/g6DJOBM7Yk6SU4fV5UE4ABAUW50Op1OJ/sEKM97VF9810MAAAAASUVORK5CYII=","orcid":"","institution":"","correspondingAuthor":true,"prefix":"","firstName":"Parham","middleName":"","lastName":"Ghayour","suffix":""}],"badges":[],"createdAt":"2025-12-06 19:38:13","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-8296596/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-8296596/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":99320039,"identity":"04b12af3-b350-404f-ab59-4a7b12dff4bf","added_by":"auto","created_at":"2025-12-31 16:38:06","extension":"json","order_by":0,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":4115,"visible":true,"origin":"","legend":"","description":"","filename":"dfaf9b18edbb4fb6a296bf247d88de32.json","url":"https://assets-eu.researchsquare.com/files/rs-8296596/v1/f26a93e29c721c215addf763.json"},{"id":99319171,"identity":"e41389ef-631d-4740-80e0-68329c865277","added_by":"auto","created_at":"2025-12-31 16:36:31","extension":"pdf","order_by":1,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":377783,"visible":true,"origin":"","legend":"","description":"","filename":"QuantumMRNS.pdf","url":"https://assets-eu.researchsquare.com/files/rs-8296596/v1/0d2ef91f184b84dd8a661992.pdf"},{"id":99280891,"identity":"53d1fac4-88e4-4fb0-ac66-73cebab2f39f","added_by":"auto","created_at":"2025-12-31 08:26:32","extension":"png","order_by":2,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":25935,"visible":true,"origin":"","legend":"","description":"","filename":"accuracyplot.png","url":"https://assets-eu.researchsquare.com/files/rs-8296596/v1/e1937ffeba495cbf4dbe3ed6.png"},{"id":99321194,"identity":"5469ef3d-b8cd-4d73-a16f-a485ecbf171c","added_by":"auto","created_at":"2025-12-31 16:39:16","extension":"pdf","order_by":3,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":74748,"visible":true,"origin":"","legend":"","description":"","filename":"coverLetterSpringer.pdf","url":"https://assets-eu.researchsquare.com/files/rs-8296596/v1/5dc725b817a00d7ed482586c.pdf"},{"id":99280895,"identity":"194cc80d-5eee-4e48-b162-1e216b9ea900","added_by":"auto","created_at":"2025-12-31 08:26:32","extension":"eps","order_by":4,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":304,"visible":true,"origin":"","legend":"","description":"","filename":"example.eps","url":"https://assets-eu.researchsquare.com/files/rs-8296596/v1/abe8528f3cb3b5de9a580701.eps"},{"id":99280890,"identity":"3385f049-da38-47fb-b69b-47d5b6cfe7ff","added_by":"auto","created_at":"2025-12-31 08:26:32","extension":"pdf","order_by":5,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":2431,"visible":true,"origin":"","legend":"","description":"","filename":"example.pdf","url":"https://assets-eu.researchsquare.com/files/rs-8296596/v1/93e93e3d27eccb8c2e6669b0.pdf"},{"id":99320738,"identity":"9904d40f-c083-4f6f-b6ce-7afbb0c383f9","added_by":"auto","created_at":"2025-12-31 16:38:53","extension":"png","order_by":6,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":45758,"visible":true,"origin":"","legend":"","description":"","filename":"heatmaprns357.png","url":"https://assets-eu.researchsquare.com/files/rs-8296596/v1/ff9eaab65fde9b569c769c8f.png"},{"id":99319236,"identity":"431559a5-3113-4d8c-be7e-4e8e8daa95ed","added_by":"auto","created_at":"2025-12-31 16:36:43","extension":"txt","order_by":7,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":1290,"visible":true,"origin":"","legend":"","description":"","filename":"history.txt","url":"https://assets-eu.researchsquare.com/files/rs-8296596/v1/dcc6d59370edd95eba00c94a.txt"},{"id":99280898,"identity":"4dac1447-b621-4822-845c-1d93fac51fd0","added_by":"auto","created_at":"2025-12-31 08:26:32","extension":"png","order_by":8,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":24699,"visible":true,"origin":"","legend":"","description":"","filename":"lossplot.png","url":"https://assets-eu.researchsquare.com/files/rs-8296596/v1/03a77f5d06a82babedaf157e.png"},{"id":99321226,"identity":"c4febd31-9c48-42a8-a778-9436030e4776","added_by":"auto","created_at":"2025-12-31 16:39:17","extension":"txt","order_by":9,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":1707,"visible":true,"origin":"","legend":"","description":"","filename":"readme.txt","url":"https://assets-eu.researchsquare.com/files/rs-8296596/v1/7799ba6607b919e448b7bc69.txt"},{"id":99280902,"identity":"50b2b631-a1f5-41b8-9bbc-ed3eca1ec554","added_by":"auto","created_at":"2025-12-31 08:26:32","extension":"bst","order_by":10,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":33237,"visible":true,"origin":"","legend":"","description":"","filename":"spbasic.bst","url":"https://assets-eu.researchsquare.com/files/rs-8296596/v1/fb735be8d1bd67f8556a7240.bst"},{"id":99320297,"identity":"0193acb9-a3d2-4005-bcb7-1b02d2b2a3ad","added_by":"auto","created_at":"2025-12-31 16:38:28","extension":"bst","order_by":11,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":30130,"visible":true,"origin":"","legend":"","description":"","filename":"spmpsci.bst","url":"https://assets-eu.researchsquare.com/files/rs-8296596/v1/f2f0abc013963522facc3ab4.bst"},{"id":99280904,"identity":"dc57014b-0f14-4b20-a06d-a9e7a4f19dcf","added_by":"auto","created_at":"2025-12-31 08:26:32","extension":"bst","order_by":12,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":28636,"visible":true,"origin":"","legend":"","description":"","filename":"spphys.bst","url":"https://assets-eu.researchsquare.com/files/rs-8296596/v1/e76de1e47692d0c80f3ec74d.bst"},{"id":99318875,"identity":"9688615c-2ab5-4b3c-8600-41ac22c21d05","added_by":"auto","created_at":"2025-12-31 16:35:32","extension":"clo","order_by":13,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":3696,"visible":true,"origin":"","legend":"","description":"","filename":"svglov3.clo","url":"https://assets-eu.researchsquare.com/files/rs-8296596/v1/fc09411299f322e051d1a33c.clo"},{"id":99280900,"identity":"5f2e9bc4-7c6d-44f7-8862-78d27ada4aa2","added_by":"auto","created_at":"2025-12-31 08:26:32","extension":"cls","order_by":14,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":47679,"visible":true,"origin":"","legend":"","description":"","filename":"svjour3.cls","url":"https://assets-eu.researchsquare.com/files/rs-8296596/v1/d03228f18f23d093b5c5860d.cls"},{"id":99320347,"identity":"15211898-d0da-4951-a111-ec86ec5e8b7c","added_by":"auto","created_at":"2025-12-31 16:38:31","extension":"pdf","order_by":15,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":190374,"visible":true,"origin":"","legend":"","description":"","filename":"usrguid3.pdf","url":"https://assets-eu.researchsquare.com/files/rs-8296596/v1/ce2d683003e21729b6862141.pdf"},{"id":99280905,"identity":"89ef0227-a8bf-482e-90df-ec957b2595d6","added_by":"auto","created_at":"2025-12-31 08:26:32","extension":"xml","order_by":16,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":80331,"visible":true,"origin":"","legend":"","description":"","filename":"dfaf9b18edbb4fb6a296bf247d88de321structuring.xml","url":"https://assets-eu.researchsquare.com/files/rs-8296596/v1/60bfa19dc90f852391605cbe.xml"},{"id":106005694,"identity":"c89daf84-7812-4ab9-9ed9-38f6a259e880","added_by":"auto","created_at":"2026-04-02 10:42:53","extension":"pdf","order_by":1,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":378993,"visible":true,"origin":"","legend":"","description":"","filename":"QuantumMRNS.pdf","url":"https://assets-eu.researchsquare.com/files/rs-8296596/v1_covered_a5e99c24-d47b-4cb5-a2e2-f9bc68ad4d1c.pdf"}],"financialInterests":"No competing interests reported.","formattedTitle":"\u003cp\u003eVariational Quantum RNS Comparator: A Cluster-Inspired Quantum Machine Learning Architecture for Residue Number Systems\u003c/p\u003e","fulltext":[],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":false,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":true,"hideJournal":true,"highlight":"","institution":"","isAcceptedByJournal":false,"isAuthorSuppliedPdf":true,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":true,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"","lastPublishedDoi":"10.21203/rs.3.rs-8296596/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-8296596/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eResidue Number Systems (RNS) offer a highly parallel and carry-freerepresentation for arithmetic, yet the fundamental operation of magnitude compar-ison is notoriously non-trivial due to the loss of positional ordering across residues.In 2010, the first cluster-based method for RNS comparison was introduced, show-ing that global ordering can be recovered from algebraic partitions of the residuedomain. In this work we reformulate this principle in the quantum setting and pro-pose ClusterNet, a variational quantum architecture whose entanglement structuremirrors the cluster geometry of the RNS domain. ClusterNet embeds the residuesof two integers into a multi-register quantum state, uses intra- and inter-registerentanglement to encode relative structure, and extracts a comparator bit through aparameterized flag qubit. We show that ClusterNet can exactly represent the RNScomparator via a reversible quantum circuit and prove expressivity guarantees forthe ansatz family.\u003c/p\u003e\n\u003cp\u003eBecause large-scale variational training of quantum circuits remains challeng-ing, we validate the underlying inductive bias through a classical surrogate modelthat preserves ClusterNet’s residue decomposition. A two-hidden-layer neural net-work trained on the full RNS domain (3, 5, 7) successfully learns the magnituderelation X \u0026gt; Y with 95–97% accuracy and reveals geometric patterns correspond-ing to the same residue clusters that structure our quantum design. The learneddecision boundary exhibits a sharp diagonal and highly interpretable modular stri-ations, demonstrating that the cluster-based representation is both natural andlearnable.\u003c/p\u003e\n\u003cp\u003eTaken together, our theoretical construction and empirical results show thatClusterNet provides a principled quantum representation of the RNS compari-son problem and captures the algebraic geometry underlying magnitude ordering.This establishes cluster-structured residue embeddings as a promising direction forquantum arithmetic, hybrid quantum-classical architectures, and future quantumaccelerators for modular computation.\u003c/p\u003e","manuscriptTitle":"Variational Quantum RNS Comparator: A Cluster-Inspired Quantum Machine Learning Architecture for Residue Number Systems","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-12-31 08:26:27","doi":"10.21203/rs.3.rs-8296596/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"4b4488ae-21a6-47be-92e4-d5e30fc294ab","owner":[],"postedDate":"December 31st, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[],"tags":[],"updatedAt":"2026-04-02T10:42:32+00:00","versionOfRecord":[],"versionCreatedAt":"2025-12-31 08:26:27","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-8296596","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-8296596","identity":"rs-8296596","version":["v1"]},"buildId":"8U1c8b4HqxoKbykW_rLl7","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}
Text is read by the "Ask this paper" AI Q&A widget below.
Extraction quality varies by source — PMC NXML preserves structure
cleanly, OA-HTML may include some navigation residue, and OA-PDF can
have broken hyphenation. The publisher copy
(via DOI)
is the canonical version.