Self-calibration self-adaptive sampling system and method for Gaussian sampling and matrix inversion

By employing a self-calibrating adaptive sampling method, the problems of distribution deviation and low sampling efficiency of SPU in Gaussian sampling and matrix inversion are solved, achieving efficient and accurate Gaussian sampling and matrix inversion, and supporting online self-tuning deployment and embedding into existing AI/control systems.

CN122068901APending Publication Date: 2026-05-19YISI GYROMAGNETIC (JIAXING) ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
YISI GYROMAGNETIC (JIAXING) ELECTRONICS CO LTD
Filing Date
2026-02-09
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing SPUs suffer from component tolerance, temperature drift, parasitic effects, and discrete quantization errors during Gaussian sampling and matrix inversion. They also lack adaptive sampling control, resulting in distribution bias and low sampling efficiency, making them difficult to integrate into existing AI/control systems.

Method used

A self-calibrating adaptive sampling method is adopted, including task definition and input modeling, matrix compilation and mapping, controllable noise injection, online self-calibration and error compensation, and adaptive equalization control. Through online statistical estimation and adaptive sampling control, Gaussian sampling and matrix inversion with controllable distribution accuracy and verifiable error are achieved.

Benefits of technology

It achieves high-throughput, low-power Gaussian sampling and matrix inversion, with controllable output accuracy and verifiable errors. It supports online self-tuning deployment and is suitable for probabilistic AI and edge control systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122068901A_ABST
    Figure CN122068901A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of probability calculation and mixed signal coprocessors, in particular to a self-calibration self-adaptive sampling system and method for Gaussian sampling and matrix inversion, and the technical scheme is characterized by comprising the steps of 1, task definition and input modeling, 2, matrix compilation mapping and discrete quantization, and 3, matrix compilation mapping and discrete quantization. The method comprises the following steps of 1, carrying out controllable noise injection and effective temperature setting, 4, carrying out on-line self-calibration and error compensation closed loop, 5, carrying out adaptive equalization / sampling control and stop criterion setting, and 6, outputting a result and carrying out system deployment. According to the method, the advantages of high throughput and low energy consumption of thermodynamic calculation are kept, and meanwhile, through online self-calibration and self-adaptive sampling control, controllable output distribution precision, verifiable errors and deployable and extensible Gaussian sampling and matrix inversion operators are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of probability calculation and mixed-signal coprocessor technology, specifically to a self-calibrating adaptive sampling system and method for Gaussian sampling and matrix inversion. Background Technology

[0002] In the field of probabilistic computing and mixed-signal coprocessor technology, this paper relates to an engineering method for implementing high-dimensional Gaussian sampling and matrix inversion / linear equation solving using a programmable thermodynamic stochastic processing unit (SPU). In recent years, probabilistic artificial intelligence tasks (such as Bayesian inference, diffusion models, and graphical model inference) and uncertainty quantification have widely relied on Gaussian sampling, covariance / precision matrix operations, and linear algebra primitives (matrix inversion, linear system solving, and preconditioning). Traditional digital hardware typically requires a large number of floating-point operations and memory accesses, resulting in high energy consumption and latency, and making it difficult to meet power consumption and latency constraints in edge computing or real-time scenarios.

[0003] Thermodynamic calculations propose "encoding" the target distribution into the energy function / coupling structure of the physical system, enabling the system to reach thermal equilibrium under noise and naturally generate samples of the target distribution. A typical SPU consists of d RLC cells, which are connected by programmable coupling branches to form an equivalent Maxwell capacitance matrix (or an equivalent precision matrix mapping network). By injecting a controllable approximate Gaussian noise current, the voltage vector of the system exhibits a zero-mean Gaussian distribution in steady state, and its covariance satisfies an analytical relationship with the coupling parameter matrix. This covariance can be used to generate target Gaussian samples, and matrix inversion and other operations can be performed through sample covariance estimation.

[0004] However, existing SPU-related implementations still face key challenges in moving from prototypes to deployable operators: 1. Programmable elements have tolerances, temperature drift, parasitic effects, and discrete quantization errors, causing the actual coupling matrix to deviate from the target matrix and resulting in distribution bias; 2. The sampling process involves burn-in and correlation time. Without adaptive sampling control and stopping criteria, it is easy to encounter "sampling correlation leading to estimation bias" or "oversampling causing reduced throughput and energy waste"; 3. For non-positive definite, sparse, block-structured, or time-varying matrix tasks, there is a lack of hardware-constrained compilation mapping, stability checks, and dynamic reconfiguration processes; 4. There is a lack of standardized task interfaces and closed-loop calibration mechanisms between the digital side (CPU / FPGA) and the analog side (SPU, ADC), making it difficult to embed them into existing AI / control systems in a "callable operator service" manner. Summary of the Invention

[0005] To address the technical problems and shortcomings of existing technologies, this invention provides a self-calibrating adaptive sampling system and method for Gaussian sampling and matrix inversion. While maintaining the advantages of high throughput and low energy consumption in thermodynamic calculations, it achieves controllable output distribution accuracy, verifiable errors, and deployable and scalable Gaussian sampling and matrix inversion operators through online self-calibration and adaptive sampling control.

[0006] To achieve the above and other related objectives, the present invention adopts the following technical solution:

[0007] A self-calibrating adaptive sampling method for Gaussian sampling and matrix inversion includes:

[0008] Step 1: Define the task and model the input.

[0009] Step 2: Perform matrix compilation mapping and discrete quantization.

[0010] Step 3: Perform controlled noise injection and set the effective temperature.

[0011] Step 4: Perform online self-calibration and error compensation closed-loop.

[0012] Step 5: Perform adaptive equalization / sampling control and set stopping criteria.

[0013] Step 6: Output results and system deployment.

[0014] Preferably, in step 1, the target accuracy matrix P, target covariance Σ, input inverse matrix A, error tolerance ε, or maximum computation budget are input according to application requirements; symmetry, positive definiteness check and positive definiteness preprocessing are performed on the input matrix. The positive definiteness preprocessing includes diagonal shift, spectral truncation and block / low-rank decomposition to meet the feasible conditions of thermodynamic steady-state sampling.

[0015] Preferably, in step 2, a "matrix compiler" is constructed to map the target precision matrix into an equivalent coupling parameter matrix based on the analytical relationship of the SPU steady-state distribution. A scale factor k or an equivalent temperature coefficient is introduced to ensure that the hardware components fall within the implementation range. Subsequently, under given topological constraints and component codebook, continuous parameters are quantized and constrained projection to generate switch matrix configuration codes and noise / timing configuration parameters for FPGA to execute.

[0016] Preferably, in step 3, controllable noise is generated by digital control and injected into each unit to achieve equivalent temperature regulation or β regulation. In the startup phase, short-window pre-sampling is used to estimate the marginal variance and key covariance terms. After comparing with the target statistics, the noise amplitude is adaptively adjusted to form an effective temperature closed loop, enabling the system to quickly enter the usable operating range.

[0017] Preferably, in step 4, the sample statistics are estimated online during runtime: the sample covariance S is calculated and the error index E is evaluated. If E exceeds the threshold, the configuration is fine-tuned according to the error direction, including: step a, adjusting the scaling factor / noise amplitude to correct the overall variance level; step b, locally updating the discrete gears of key coupling branches to correct structural biases; step c, optionally applying a linear transformation to the samples on the digital side for post-processing compensation; the above process is iterated until the error threshold is met or the iteration limit is reached.

[0018] Preferably, in step 5, the integral autocorrelation time τ̂corr or the effective sample number ESS is estimated online during the sampling process, and the equilibrium time Tb, sampling interval Δt, and sampling rate q are automatically determined. When the task is Gaussian sampling, the covariance error and marginal moment error are used as stopping criteria. When the task is matrix inversion / linear solution, the deviation between A·S and the identity matrix or the linear system residual is used as stopping criteria. This adaptive control reduces invalid sampling and ADC data readback overhead while ensuring accuracy.

[0019] Preferably, in step 6, Gaussian sampling is performed: the output sample stream v and statistics satisfy v≈N(0, P^{-1}) or v≈N(0, Σ);

[0020] Matrix inversion: Output the inverse matrix estimate S≈A^{-1};

[0021] Linear equation solving: After obtaining S, calculate x = S·b or iterate and correct the output x according to the residual. The system provides operator interfaces for CPU / FPGA / ADC and supports offline batch processing and online self-tuning deployment.

[0022] On the other hand, a self-calibrating adaptive sampling system for Gaussian sampling and matrix inversion is also provided, comprising:

[0023] The task input and matrix compilation module takes P / Σ / A and error tolerance as input, performs positive definiteness checking, positive definiteness preprocessing, topological constraint projection and discrete quantization, and generates coupled configuration codes and noise / timing parameters.

[0024] The reconfigurable coupled network control module (FPGA) sends out switch matrix configurations to control the coupling branch positions, noise injection, and equalization / sampling timing.

[0025] Thermodynamic random processing unit (SPU) module, composed of a multi-unit RLC network, reaches steady state under noise-driven conditions and outputs voltage samples that satisfy the target Gaussian distribution;

[0026] The sampling and quantization module (ADC) synchronously samples and quantizes multi-channel voltages, then uploads the data to the digital side for statistical analysis and error assessment.

[0027] Online self-calibration and adaptive sampling control module: Based on covariance error, autocorrelation time and ESS, it adjusts the noise amplitude and configuration code in a closed loop and provides a stopping criterion;

[0028] Output and Deployment Module: Outputs sample streams / covariance / inverse matrix estimates or solutions to linear equations, supporting callable operators for probabilistic AI and edge control systems.

[0029] Preferably, when performing the method of claim 1, the task input and matrix compilation module performs step 1; the reconfigurable coupled network control module (FPGA) performs step 2; the thermodynamic random processing unit (SPU) module performs step 3; the sampling and quantization module (ADC) performs step 4; the online self-calibration and adaptive sampling control module performs step 5; and the result output and deployment module performs step 6.

[0030] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0031] 1. Reliable compilation and mapping: The target precision matrix / covariance matrix input by the user is compiled into a programmable coupled network configuration under hardware-realizable constraints, and online reconfiguration is supported;

[0032] 2. High sampling efficiency and controllable error: While ensuring the effective independent sample count (ESS) and covariance error threshold, it automatically reduces invalid sampling and data transfer overhead;

[0033] 3. Adaptive sampling control: Online estimation of correlation time and equalization time, automatic determination of burn-in, sampling interval and thinning rate, and provision of stopping criteria;

[0034] 4. Online self-calibration and error compensation: Closed-loop calibration / compensation is introduced to address component tolerances, parasitic parameters, and temperature drift, making the output sample approximate the target Gaussian distribution and improving the accuracy of matrix inversion;

[0035] 5. Good engineering deployability: It provides task orchestration and interface for CPU / FPGA / ADC collaboration, which is convenient for integration into systems such as probabilistic AI inference, edge control and online optimization.

[0036] Other additional advantages and benefits of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0037] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0038] Figure 1This is a flowchart illustrating the steps of the method described in this application;

[0039] Figure 2 This is a schematic diagram of the system modules;

[0040] Figure 3 This application describes the Gaussian sampling and matrix inverse operation workflow that uses an SPU (Speed ​​Processing Unit) combined with QGA (Quantum Genetic Algorithm) and DL (Deep Learning). Detailed Implementation

[0041] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings. The following specific examples illustrate the embodiments of the present invention, and those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.

[0042] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. The illustrations only show the components related to the present invention and are not drawn according to the number, shape and size of the components in actual implementation. In actual implementation, the form, quantity and proportion of each component can be changed at will, and the layout of the components may also be more complex.

[0043] It should be noted that in the description of this application, the terms "upper," "lower," "left," "right," "inner," and "outer," etc., indicating directional or positional relationships, are based on the directional or positional relationships shown in the accompanying drawings. These are merely for ease of description and do not indicate or imply that the device or element must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting the invention. Furthermore, it should be noted that in the description of this application, unless otherwise explicitly specified and limited, the terms "installed," "connected," "linked," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication between two elements. Those skilled in the art can understand the specific meaning of the above terms in the invention based on the specific circumstances.

[0044] Example 1:

[0045] This invention discloses a self-calibrating adaptive sampling method for Gaussian sampling and matrix inversion, an end-to-end approach for SPUs (Speed ​​Processing Units). While maintaining the advantages of high throughput and low energy consumption in thermodynamic calculations, it achieves controllable output distribution accuracy, verifiable errors, and deployable scalable Gaussian sampling and matrix inversion operators through online self-calibration and adaptive sampling control. (Reference) Figure 1 and Figure 3 .

[0046] Step 1. Task definition and input modeling.

[0047] Based on application requirements, input the target accuracy matrix P (symmetric positive definite / semi-positive definite) or the target covariance Σ, or input the inverse matrix A to be calculated, the error tolerance ε, and the maximum computational budget (number of samples / time). Perform symmetry transformation, positive definiteness checks, and necessary positive definite preprocessing (e.g., diagonal shift, spectral truncation, block / low-rank decomposition) on the input matrix to meet the feasibility conditions of thermodynamic steady-state sampling.

[0048] By performing symmetry transformation and positive definiteness checks, the mathematical properties of the matrix are ensured during the sampling process, thereby improving the stability and efficiency of sampling. Symmetric positive definite matrices have better numerical properties, such as all eigenvalues ​​being positive, which helps avoid numerical instability problems during the sampling process. The positive definiteness preprocessing step adjusts the matrix structure to make it closer to an ideal positive definite matrix. This helps reduce error accumulation during the sampling process, improving sampling accuracy and convergence speed.

[0049] This step allows users to input different types of matrices (precision matrix, covariance matrix, or matrix to be inverted) and related parameters (error tolerance, maximum computational budget) according to specific application requirements. This flexibility enables the method to be widely applied in various fields, such as finance, signal processing, and machine learning. Based on the specific properties of the input matrix, this step can automatically select an appropriate preprocessing strategy (such as diagonal shifting, spectral truncation, etc.). This customized preprocessing strategy helps to better adapt to the characteristics of different matrices, improving the targeting and effectiveness of sampling.

[0050] Through steps such as symmetry transformation, positive definiteness checks, and positive definiteness preprocessing, this step ensures that the input matrix satisfies the feasibility conditions for thermodynamic steady-state sampling. This contributes to a more stable and efficient sampling process, resulting in more accurate sampling results.

[0051] Step 2. Matrix compilation mapping and discrete quantization (matrix → configuration code).

[0052] A "matrix compiler" is constructed to map the target precision matrix to an equivalent coupling parameter matrix (e.g., Maxwell capacitance matrix C) based on the analytical relationship of the SPU steady-state distribution, and introduces a scale factor k (or equivalent temperature coefficient) to ensure that the hardware components fall within the realizable range. Subsequently, under given topological constraints (fully connected / sparse / block diagonal) and component codebook (discrete levels), continuous parameters are quantized and constrained projection to generate switch matrix configuration codes and noise / timing configuration parameters for FPGA execution.

[0053] Since the physical parameters (such as resistance and capacitance values) of hardware components (such as resistors and capacitors) can typically only vary within a certain range, the parameters obtained by direct mapping may exceed the range that the hardware can realize. By introducing a scaling factor k (or equivalent temperature coefficient), the mapped parameters are scaled to fall within the range of realizable parameters of the hardware components. This step ensures compatibility between the mathematical model and the physical implementation.

[0054] This innovative step tightly integrates the mathematical objective (target accuracy matrix) with the physical implementation (hardware component parameters). Through analytical relation mapping and scaling, it achieves a seamless conversion from the mathematical model to the physical implementation, reducing performance losses caused by mismatch between the mathematical model and the physical implementation. The flexibility of topological constraints and quantization processing ensures the feasibility and stability of the hardware implementation while maintaining a high performance level.

[0055] Step 3. Controllable noise injection and effective temperature setting.

[0056] Controllable noise (such as an approximate Gaussian noise current obtained by shaping and filtering a random bit stream) is generated by digital control and injected into each unit to achieve equivalent temperature (or β) regulation. During the startup phase, short-window pre-sampling is used to estimate the marginal variance and key covariance terms. After comparing them with the target statistics, the noise amplitude is adaptively adjusted to form an effective temperature closed loop, enabling the system to quickly enter the usable operating range.

[0057] Traditional methods may rely on long-term natural evolution or fixed noise injection, resulting in slow convergence. This step significantly shortens the transition time from the initial state to the steady state through short-window presampling and adaptive noise adjustment. Closed-loop control enables the system to respond in real time to external disturbances (such as changes in target statistics) and quickly reconverge by adjusting the noise amplitude, enhancing the system's robustness. The digitally generated Gaussian noise has high precision (e.g., 16-bit resolution) and its amplitude can be finely adjusted to ensure that the statistical matching error is within a controllable range. By focusing on adjusting key covariance terms, overfitting or underfitting problems that may occur with global noise adjustment are avoided, improving the approximation quality of the target distribution. Noise generation and amplitude adjustment are implemented entirely through digital circuits, eliminating the need for complex analog circuits, reducing hardware design complexity, and supporting flexible modification of the control strategy through software updates.

[0058] Step 4. Online self-calibration and error compensation closed loop.

[0059] To suppress matrix bias caused by component tolerances, parasitic capacitance / resistance, and temperature drift, sample statistics are estimated online during runtime: the sample covariance S is calculated and the error index E (such as ||S−Σ|| / ||Σ|| or matrix inversion relative error) is evaluated. If E exceeds a threshold, the configuration is fine-tuned according to the error direction: including (a) adjusting the scaling factor / noise amplitude to correct the overall variance level; (b) locally updating the discrete levels of key coupled branches to correct structural bias; and (c) optionally applying a linear transformation to the samples on the digital side for post-processing compensation. The above process is iterated until the error threshold is met or the iteration limit is reached.

[0060] This step dynamically compensates for matrix deviations caused by non-ideal hardware factors (such as component tolerances, parasitic parameters, and temperature drift) through online sample statistics estimation and adaptive closed-loop correction, ensuring that the actual statistical characteristics of the system are consistent with the target value. During system operation, output samples (such as voltage, current, or state variables of each unit) are continuously collected, and the sample covariance matrix S is calculated. S reflects the actual coupling characteristics of the system, and its ideal value should be the target covariance matrix Σ. If the error manifests as an overall variance deviation (such as diagonal elements of S generally being greater than or less than Σ), it indicates noise injection or improper scaling factor settings. The overall system variance level is corrected by dynamically adjusting the noise amplitude (such as increasing / decreasing the variance of Gaussian noise) or the scaling factor k through digital control. If the error manifests as a structural deviation (such as significant differences between some off-diagonal elements of S and Σ), it indicates that the discrete positions of key coupling branches (such as resistance and capacitance values) deviate from the ideal value due to tolerances or parasitic parameters, and this has been corrected. If hardware correction is limited (such as the position reaching its limit or insufficient adjustment speed), or the error is of a type that can be compensated by linear transformation (such as rotation or scaling), further correction is needed. A digital linear transformation post-processing was employed for correction. Iterative closed-loop control approximates the optimal solution. The process, involving online statistical monitoring, error direction analysis, adaptive hardware / software correction, and iterative closed-loop control, achieves dynamic compensation for hardware non-ideal factors. Its core advantages lie in high-precision statistical matching, strong robustness, hardware friendliness, and real-time response capabilities.

[0061] Step 5. Adaptive equalization / sampling control and stopping criteria.

[0062] During the sampling process, the integral autocorrelation time τ̂corr or the effective sample number ESS is estimated online, and the equilibrium time Tb (burn-in), sampling interval Δt, and decimation rate q (thinning) are automatically determined. When the task is Gaussian sampling, the covariance error and marginal moment error are used as stopping criteria; when the task is matrix inversion / linear solution, the deviation between A·S and the identity matrix or the linear system residual is used as stopping criteria. This adaptive control reduces invalid sampling and ADC data readback overhead while ensuring accuracy.

[0063] The stopping criterion is the deviation of A⋅S from the identity matrix or the residual of the linear system. A⋅S means: A is the target matrix (e.g., the matrix to be inverted), and S is the sample covariance matrix (or approximate inverse matrix). This step dynamically optimizes the sampling process (equilibrium time, sampling interval, sampling rate) through online statistical estimation and adaptive sampling control, reducing invalid sampling and hardware overhead (e.g., ADC data readback) while ensuring computational accuracy. This step achieves optimization of sampling accuracy and hardware efficiency through closed-loop control of online statistical estimation → adaptive sampling parameter adjustment → task-dependent stopping criteria. Its core advantages are: dynamic matching of system dynamics (e.g., τ̂corr changes); task-specific optimization (Gaussian sampling vs. matrix inversion); and significantly reduced hardware overhead.

[0064] Step 6. Output Results and System Deployment.

[0065] (1) Gaussian sampling: Output sample stream v and statistics (mean, covariance), satisfying v≈N(0, P^{-1}) or v≈N(0, Σ); (2) Matrix inversion: Output inverse matrix estimate S≈A^{-1}; (3) Solving linear equations: Calculate x=S·b after obtaining S or correct the output x by residual iteration. The system provides operator interfaces (sample / invert / solve) for CPU / FPGA / ADC, supporting offline batch processing and online self-tuning deployment.

[0066] This step, through task decoupling design and a hardware-friendly interface, unifies Gaussian sampling, matrix inversion, and linear equation solving into a reusable computational module. It supports both offline batch processing (high throughput) and online self-tuning (low latency) modes, and is compatible with heterogeneous hardware such as CPUs, FPGAs, and ADCs. The unified interface reduces development costs, adaptively balances accuracy and efficiency, and combines the flexibility of CPUs, the parallelism of FPGAs, and the analog computing advantages of ADCs, covering a wide range of application scenarios.

[0067] Example 2:

[0068] System Reference for this Solution Figure 2The overall processing flow can be understood as follows: 1. Task Input and Matrix Compilation Module: Inputs P / Σ / A and error tolerance, performs positive definiteness checks, positive definiteness preprocessing, topological constraint projection and discrete quantization, and generates coupled configuration codes and noise / timing parameters; 2. Reconfigurable Coupled Network Control Module (FPGA): Issues switch matrix configurations to control coupled branch positions, noise injection, and equalization / sampling timing; 3. Thermodynamic Stochastic Processing Unit (SPU) Module: Composed of a multi-unit RLC network, it reaches steady state under noise drive and outputs voltage samples that satisfy the target Gaussian distribution; 4. Sampling and Quantization Module (ADC): Performs synchronous sampling and quantization of multi-channel voltages, uploads them to the digital side for statistical and error evaluation; 5. Online Self-Calibration and Adaptive Sampling Control Module: Based on covariance error, autocorrelation time, and ESS, it adjusts noise amplitude and configuration codes in a closed loop and provides stopping criteria; 6. Result Output and Deployment Module: Outputs sample streams / covariance / inverse matrix estimates or linear equation solutions, supporting them as callable operators for probabilistic AI and edge control systems.

[0069] Key steps of “matrix → configuration code”: After the input matrix is ​​symmetric and positive definite, it is projected into a realizable structure according to the hardware topology constraints; then the continuous coupling parameters are quantized into a discrete element codebook to generate a switch configuration bit stream, and the scaling factor and related time priors are calculated at the same time for subsequent temperature closed-loop and sampling scheduling.

[0070] Runtime closed-loop description: Short window presampling → Estimating covariance S and autocorrelation time τ̂corr → Calculating error E and ESS → Dynamically adjusting noise amplitude, sampling interval, and local coupling level → Stopping and outputting results after the error threshold is met. This closed loop is used to resist distribution deviations caused by component tolerances, temperature drift, and parasitic parameters, and automatically compromises between throughput and accuracy.

[0071] Other alternative implementations include the following: (1) Coupling implementation alternatives: In addition to switched capacitors, programmable resistors, transconductance units, active equivalent negative coupling, or transformer coupling can be used in the coupling branch to adapt to different processes and frequency bands; (2) Noise source alternatives: Noise can be implemented by on-chip true random sources, thermal noise amplification, ΔΣ modulation and noise shaping, etc., and can be extended to cross-channel correlated noise; (3) Compiler extensions: Low-rank / sparse decomposition, preconditioning and spectral constraints can be added to improve the approximation accuracy and stability under constrained topologies; (4) Stopping criterion extensions: In addition to covariance error, Wasserstein distance approximation, characteristic direction projection error or residual upper bound estimation can be added to adapt to the credibility requirements of different applications; (5) Application extensions: It can be extended to scenarios that require fast sampling / inversion, such as Kalman filtering, state estimation, financial risk covariance estimation, and signal processing MMSE estimation.

[0072] In summary, compared with thermodynamic calculation prototypes that rely solely on fixed configurations and sampling strategies, and Gaussian sampling / matrix inversion implementations using traditional digital hardware, this scheme has the following significant advantages and beneficial effects:

[0073] 1. More reliable distribution accuracy: The introduction of online self-calibration and error compensation enables the distribution to approximate the target Gaussian distribution even when there are component tolerances, temperature drift and parasitic effects, which significantly improves the accuracy of matrix inversion and linear solution.

[0074] 2. Significantly improved sampling efficiency: By using autocorrelation time and ESS-driven adaptive sampling control and stopping criteria, invalid sampling and data readback are reduced, thus lowering energy consumption and latency;

[0075] 3. Reusable compilation and mapping: A hardware-constrained matrix compilation and discrete quantization process is proposed, which supports sparse / block matrices and dynamic reconfiguration, improving the versatility of operators;

[0076] 4. Engineering Deployment Friendly: Provides a task interface and runtime management mechanism for CPU / FPGA / ADC collaboration, which can be embedded into existing AI / control systems as a "sample / invert / solve" operator service;

[0077] 5. High scalability: Supports parallel sampling and block matrix splicing of multiple boards / chips to meet higher dimensionality and higher throughput requirements;

[0078] 6. Applicable to probabilistic AI and real-time control: In edge or real-time scenarios, it can reduce the computing power and power consumption of traditional digital solutions while meeting the error threshold, and provide key operator support for generative AI, Bayesian inference and uncertainty assessment.

[0079] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. For those skilled in the art, the present invention can have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A self-calibrating adaptive sampling method for Gaussian sampling and matrix inversion, characterized in that, include: Step 1: Define the task and model the input. Step 2: Perform matrix compilation mapping and discrete quantization. Step 3: Perform controlled noise injection and set the effective temperature. Step 4: Perform online self-calibration and error compensation closed-loop. Step 5: Perform adaptive equalization / sampling control and set stopping criteria. Step 6: Output results and system deployment.

2. The self-calibrating adaptive sampling method for Gaussian sampling and matrix inversion according to claim 1, characterized in that, In step 1, the target accuracy matrix P, target covariance Σ, input inverse matrix A to be calculated, error tolerance ε, or maximum computation budget are input according to application requirements. Symmetry transformation, positive definiteness check and positive definiteness preprocessing are performed on the input matrix. The positive definiteness preprocessing includes diagonal shift, spectral truncation and block / low-rank decomposition to meet the feasible conditions of thermodynamic steady-state sampling.

3. The self-calibrating adaptive sampling method for Gaussian sampling and matrix inversion according to claim 1, characterized in that, In step 2, a "matrix compiler" is constructed. Based on the analytical relationship of the SPU steady-state distribution, the target precision matrix is ​​mapped to an equivalent coupling parameter matrix. A scale factor k or an equivalent temperature coefficient is introduced to ensure that the hardware components fall within the implementation range. Subsequently, under given topological constraints and component codebook, continuous parameters are quantized and constrained projection to generate switch matrix configuration codes and noise / timing configuration parameters for FPGA to execute.

4. The self-calibrating adaptive sampling method for Gaussian sampling and matrix inversion according to claim 1, characterized in that, In step 3, controllable noise is generated by digital control and injected into each unit to achieve equivalent temperature regulation or β regulation. During the startup phase, short-window pre-sampling is used to estimate the marginal variance and key covariance terms. After comparing with the target statistics, the noise amplitude is adaptively adjusted to form an effective temperature closed loop, enabling the system to quickly enter the usable operating range.

5. The self-calibrating adaptive sampling method for Gaussian sampling and matrix inversion according to claim 1, characterized in that, In step 4, the sample statistics are estimated online during runtime: the sample covariance S is calculated and the error index E is evaluated. If E exceeds the threshold, the configuration is fine-tuned according to the error direction, including: step a, adjusting the scaling factor / noise amplitude to correct the overall variance level; step b, locally updating the discrete gears of key coupling branches to correct structural biases; step c, optionally applying a linear transformation to the samples on the digital side for post-processing compensation; the above process is iterated until the error threshold is met or the iteration limit is reached.

6. The self-calibrating adaptive sampling method for Gaussian sampling and matrix inversion according to claim 1, characterized in that, In step 5, the integral autocorrelation time τ̂corr or the effective sample number ESS is estimated online during the sampling process, and the equilibrium time Tb, sampling interval Δt, and sampling rate q are automatically determined. When the task is Gaussian sampling, the covariance error and marginal moment error are used as stopping criteria. When the task is matrix inversion / linear solution, the deviation between A·S and the identity matrix or the linear system residual is used as stopping criteria. This adaptive control reduces invalid sampling and ADC data readback overhead while ensuring accuracy.

7. The self-calibrating adaptive sampling method for Gaussian sampling and matrix inversion according to claim 1, characterized in that, In step 6, Gaussian sampling: output sample stream v and statistics, satisfying v≈N(0, P^{-1}) or v≈N(0, Σ); Matrix inversion: Output the inverse matrix estimate S≈A^{-1}; Linear equation solving: After obtaining S, calculate x = S·b or iterate and correct the output x according to the residual. The system provides operator interfaces for CPU / FPGA / ADC and supports offline batch processing and online self-tuning deployment.

8. A self-calibrating adaptive sampling system for Gaussian sampling and matrix inversion, characterized in that, include: The task input and matrix compilation module takes P / Σ / A and error tolerance as input, performs positive definiteness checking, positive definiteness preprocessing, topological constraint projection and discrete quantization, and generates coupled configuration codes and noise / timing parameters. The reconfigurable coupled network control module (FPGA) sends out switch matrix configurations to control the coupling branch positions, noise injection, and equalization / sampling timing. Thermodynamic random processing unit (SPU) module, composed of a multi-unit RLC network, reaches steady state under noise-driven conditions and outputs voltage samples that satisfy the target Gaussian distribution; The sampling and quantization module (ADC) synchronously samples and quantizes multi-channel voltages, then uploads the data to the digital side for statistical analysis and error assessment. Online self-calibration and adaptive sampling control module: Based on covariance error, autocorrelation time and ESS, it adjusts the noise amplitude and configuration code in a closed loop and provides a stopping criterion; Output and Deployment Module: Outputs sample streams / covariance / inverse matrix estimates or solutions to linear equations, supporting callable operators for probabilistic AI and edge control systems.

9. The self-calibrating adaptive sampling system for Gaussian sampling and matrix inversion according to claim 8, characterized in that, When performing the method of claim 1, the task input and matrix compilation module performs step 1; the reconfigurable coupled network control module (FPGA) performs step 2; the thermodynamic random processing unit (SPU) module performs step 3; and the sampling and quantization module (ADC) performs step 4. Online self-calibration and adaptive sampling control module: execute step 5; Result output and deployment module: execute step 6.