A light adjustment task control method of a coherent light quantum computer and related equipment

By introducing task-level mutually exclusive global locks and global runtime event flags into a coherent optical quantum computer, the state of the optical parametric oscillator is monitored, the hardware conflict problem caused by concurrent dimming tasks is solved, and the controllable interruption and graceful exit of dimming tasks are realized, thereby improving dimming and computing efficiency.

CN122044903BActive Publication Date: 2026-07-31BEIJING BOSE QUANTUM TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING BOSE QUANTUM TECHNOLOGY CO LTD
Filing Date
2026-02-14
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

In existing coherent optical quantum computers, dimming task control schemes fail to effectively prevent hardware resource conflicts caused by concurrent dimming tasks, thereby disrupting the coherence of the OPO pulse sequence and affecting dimming and computation efficiency.

Method used

A task-level mutually exclusive global lock and a global runtime event flag are introduced to monitor the locking status of the optical parametric oscillator. A differentiated task interruption response strategy is adopted to ensure that the dimming task exits at a safe point.

Benefits of technology

It effectively prevents the device status from becoming chaotic due to the concurrent execution of multiple dimming tasks, realizes the controllable interruption and graceful exit of dimming tasks, and improves dimming and computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122044903B_ABST
    Figure CN122044903B_ABST
Patent Text Reader

Abstract

This invention relates to a dimming task control method and related equipment for a coherent optical quantum computer. The method includes: upon receiving a dimming task request, attempting to acquire a global lock; if successful, setting a global runtime event flag to a running state, executing the corresponding dimming task, monitoring the locking state of the optical parametric oscillator (OPO), and checking the global runtime event flag at a preset logic checkpoint; upon receiving a task stop command, adjusting the global runtime event flag to a request-to-stop state; if the real-time locking state is an abnormal locking state, temporarily suspending the interrupt response and performing operations to restore the OPO to a stable locking state; if the real-time locking state is a stable locking state and the global runtime event flag is a request-to-stop state, safely interrupting the dimming task at the current or next logic checkpoint and releasing the global lock. This method improves dimming control effectiveness and increases dimming efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of optical quantum computer technology, and in particular to a dimming task control method and related equipment for a coherent optical quantum computer. Background Technology

[0002] Coherent optical quantum computers primarily utilize coherent optical pulse sequences generated by optical parametric oscillators (OPOs) to encode and manipulate quantum information. To ensure the accuracy and reliability of the computation process, the system needs to maintain the OPO in a highly stable locked state. Therefore, fine-grained dimming tasks must be executed periodically or on demand. However, in actual operation, the system may face concurrent dimming task requests from different clients or internal monitoring modules. If multiple dimming tasks are executed simultaneously without control, it will lead to instruction conflicts on shared hardware resources. For example, multiple dimming tasks may compete to set different laser powers or phases, easily disrupting the coherence of the OPO pulse sequence, causing the entire system to fall into an unpredictable state, and potentially even damaging expensive optical components.

[0003] The dimming task control solutions provided by related technologies usually only focus on concurrent isolation. When it is necessary to interrupt the task, a simple immediate interruption strategy is adopted, which may cause the OPO to remain in an unstable state. This not only destroys the current dimming results and affects the dimming control effect, but also requires a time-consuming system recalibration before subsequent calculation operations can be performed, resulting in a decrease in dimming efficiency and computational efficiency.

[0004] There is currently no effective solution to the aforementioned problems in the relevant technologies. Summary of the Invention

[0005] The present invention provides a dimming task control method and related equipment for a coherent optical quantum computer, which at least partially solves the problems of poor dimming control effect, low dimming efficiency and low computing efficiency in dimming task control schemes in related technologies.

[0006] To address the aforementioned problems, one aspect of this invention provides a method for controlling dimming tasks in a coherent optical quantum computer, comprising: In response to the activation of the dimming control system of the coherent optical quantum computer, a global lock for task-level mutual exclusion and a global running event flag for indicating the running status of the task are created and initialized. When a dimming task request is received, an attempt is made to acquire the global lock. If the acquisition is successful, the global running event flag is set to the running state, and the corresponding dimming task is executed. During the execution of the dimming task, the locking state of the optical parametric oscillator is monitored, and the global running event flag is checked at one or more logical checkpoints preset in the dimming task flow. When a task stop command is received, the global runtime event flag is adjusted to a stop request state. Based on the state of the global runtime event flag obtained at the logical checkpoint and the real-time lock state of the optical parametric oscillator, a task interruption response strategy is executed for the dimming task. The task interruption response strategy includes: if the real-time lock state is an abnormal lock state, the interruption response is suspended and the operation to restore the optical parametric oscillator to a stable lock state is executed; if the real-time lock state is a stable lock state and the global runtime event flag is a stop request state, the dimming task is safely interrupted at the current or next logical checkpoint, and the global lock is released.

[0007] In some embodiments, the step of performing the corresponding dimming task includes: Load the device configuration parameters corresponding to the dimming task indicated by the dimming task request from the storage; wherein, the device configuration parameters include one or more of the following: delay line position, scan step, bias range, and temperature target value; The task encapsulator is invoked to execute the dimming task; wherein the task encapsulator is configured to release the global lock after the dimming task is completed or after the task interruption response strategy is triggered.

[0008] In some embodiments, the dimming task includes a step of scanning and adjusting the optical delay line; wherein the scanning and adjustment employs a bidirectional boundary scanning method. Starting from the current position of the delay line, a scan is performed along the first direction with a preset step until the light signal intensity is detected to be lower than the threshold and continues to reach a predetermined number of times to determine the first boundary; Scan along the second direction with the preset step size until the light signal intensity is detected to be below the threshold again and continues to reach the predetermined number of times, in order to determine the second boundary; The logical checkpoint is set before each step scan is performed.

[0009] In some embodiments, the step of attempting to acquire the global lock includes: Call the non-blocking acquisition interface corresponding to the global lock; If the acquisition fails, a task start failure signal is returned to the requester of the dimming task request, and the task does not enter a blocking waiting state.

[0010] In some embodiments, the step of monitoring the lock-in state of the optical parametric oscillator includes: Receive and parse the status code returned from the field-programmable gate array that controls the optical parametric oscillator; If the status code is a predefined error code, the locking state is determined to be an abnormal locking state; if the status code is a non-predefined error code, the locking state is determined to be a stable locking state; wherein, the predefined error codes include a first error code for indicating that the optical parametric oscillator may lose lock and a second error code for indicating that the optical parametric oscillator is locked abnormally.

[0011] In some embodiments, the step of securely interrupting the dimming task includes: The parameters of the optical modulation device and the light source driver of the coherent optical quantum computer are set to safe state values.

[0012] In some embodiments, the method further includes: Without interfering with the execution of the dimming task, the system attempts to acquire the global lock in a non-blocking manner to determine the system state of the dimming control system, and performs heartbeat monitoring and reporting based on the system state; if the acquisition is successful, the system is determined to be in an idle state and the global lock is released; if the acquisition fails, the system is determined to be in a busy state.

[0013] In some embodiments, the logical checkpoints include one or more of the following types: Inter-stage checkpoints are set between multiple sequentially executed functional stages in the dimming task; Set as a loop iteration checkpoint before the start of each iteration in a parameter scan or optimization loop that includes multiple iterations; Set as a subtask boundary checkpoint in a task list consisting of multiple independent subtasks, before each subtask begins execution; Set a critical pre-operation checkpoint before the start of a long-running hardware operation or initialization operation.

[0014] To address the aforementioned problems, one aspect of this invention provides a dimming task control device for a coherent optical quantum computer, comprising: The initialization module is used to create and initialize a global lock for task-level mutual exclusion and a global runtime event flag to indicate the running status of the task in response to the startup of the dimming control system of the coherent optical quantum computer. The task execution control module is used to attempt to acquire the global lock when a dimming task request is received. If the acquisition is successful, the global running event flag is set to the running state, and the corresponding dimming task is executed. During the execution of the dimming task, the locking state of the optical parametric oscillator is monitored, and the global running event flag is checked at one or more logical checkpoints preset in the dimming task process. The task interruption control module is used to adjust the global running event flag to a request-to-stop state when a task stop command is received. Based on the state of the global running event flag obtained at the logical checkpoint and the real-time lock state of the optical parametric oscillator, it executes a task interruption response strategy for the dimming task. The task interruption response strategy includes: if the real-time lock state is an abnormal lock state, then the interruption response is temporarily suspended and the operation to restore the optical parametric oscillator to a stable lock state is executed; if the real-time lock state is a stable lock state and the global running event flag is a request-to-stop state, then the dimming task is safely interrupted at the current or next logical checkpoint, and the global lock is released.

[0015] To address the aforementioned problems, one aspect of this invention provides a non-transitory machine-readable medium storing computer instructions for causing a computer to execute any of the aforementioned coherent optical quantum computer dimming task control methods.

[0016] The beneficial effects of this invention are as follows: By employing a dimming control system responsive to the coherent optical quantum computer, a global lock for task-level mutual exclusion and a global running event flag for indicating the task's running status are created and initialized. When a dimming task request is received, an attempt is made to acquire the global lock. If successful, the global running event flag is set to the running state, and the corresponding dimming task is executed. During the execution of the dimming task, the locking status of the optical parametric oscillator (OPO) is monitored, and the global running event flag is checked at one or more logic checkpoints preset in the dimming task flow. When a task stop command is received, the global running event flag is adjusted to the request-to-stop state. Based on the state of the global running event flag obtained at the logic checkpoint and the real-time locking status of the OPO, a task interruption response strategy is executed for the dimming task. The task interruption response strategy includes: if the real-time locking status is an abnormal locking status, the interruption response is temporarily suspended, and operations are performed to restore the OPO to a stable locking state; if the real-time locking status is abnormal, the interruption response is temporarily suspended, and operations are performed to restore the OPO to a stable locking state. The technique of safely interrupting the dimming task and releasing the global lock at the current or next logical checkpoint when the time-locked state is stable and the global runtime event flag is in a stop request state overcomes the problem of poor dimming control, low dimming efficiency, and low computational efficiency in related dimming task control schemes that only consider concurrency isolation. By introducing a global lock for task-level mutual exclusion in the dimming task control of coherent optical quantum computers, the device state chaos caused by the concurrent execution of multiple dimming tasks can be effectively prevented. The introduction of a global runtime event flag to indicate the task running status enables controllable interruption within the task. This dual control mechanism takes into account both security and controllability, significantly improving the dimming task control effect. At the same time, when a stop command is received, a differentiated task interruption response strategy is executed based on the monitoring status of the optical parametric oscillator, realizing intelligent interruption priority decision based on system health, achieving deterministic and graceful exit at the safe point, and achieving the technical effect of improving dimming efficiency and subsequent computational efficiency.

[0017] Details of one or more embodiments of the present invention are set forth in the following drawings and description, so that other features, objects and advantages of the invention will be more readily understood. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings without creative effort.

[0019] Figure 1This is a schematic flowchart of the dimming task control method for a coherent optical quantum computer according to one embodiment of the present invention. Figure 2 This is a flowchart illustrating a dimming task control method for a coherent optical quantum computer, which is yet another embodiment of the present invention. Figure 3 This is a flowchart illustrating the execution of a dimming task when logical checkpoints are set between the main stages of the dimming task, as described in one embodiment of the present invention. Figure 4 This is a schematic diagram of the main modules of the dimming task control device of a coherent optical quantum computer according to one embodiment of the present invention; Figure 5 This is a schematic diagram of the main framework of the dimming task control device for a coherent optical quantum computer, which is yet another embodiment of the present invention. Figure 6 This is a schematic diagram illustrating the interaction between various modules within the dimming control system after receiving a dimming task request, according to one embodiment of the present invention. Figure 7 This is a schematic diagram illustrating the interaction between various modules within the dimming control system after receiving a stop command, according to one embodiment of the present invention. Figure 8 This is a schematic diagram illustrating the interaction between modules within the dimming control system when multiple clients concurrently initiate dimming task requests, according to one embodiment of the present invention. Figure 9 This is a schematic diagram of the electronic device of the present invention. Detailed Implementation

[0020] Embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. While some embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the invention. It should be understood that the accompanying drawings and embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the invention.

[0021] The existing technologies have significant shortcomings in addressing the concurrent control and secure interruption requirements of coherent optical quantum computer dimming tasks. These shortcomings are mainly reflected in the following aspects: First, the solutions in these technologies typically employ a simple immediate interruption strategy. This is dangerous for optical devices like the OPO, which have extremely high requirements for state continuity. Forced interruption may cause the OPO to remain in an unsteady state, not only destroying the dimming results but also potentially preventing subsequent calculations and requiring a time-consuming system-wide recalibration. Second, the solutions in these technologies do not consider the varying vulnerability of the system at different stages of the dimming task. For example, an interruption during a single optical operation has a significantly different impact on the system state compared to an interruption between two relatively independent adjustment steps. These technologies lack the ability to decide on interruption responses based on the real-time state of the system (such as the stability of the OPO), resulting in poor intelligence and adaptability in dimming task control.

[0022] To address the aforementioned problems, embodiments of the present invention provide a method for controlling dimming tasks in a coherent optical quantum computer, such as... Figure 1 As shown, the dimming task control method of this coherent optical quantum computer mainly includes: Step S101: In response to the startup of the dimming control system of the coherent optical quantum computer, a global lock for task-level mutual exclusion and a global running event flag for indicating the running status of the task are created and initialized.

[0023] Step S102: When a dimming task request is received, attempt to acquire the global lock. If successful, set the global running event flag to the running state and execute the corresponding dimming task. During the execution of the dimming task, monitor the locking state of the optical parametric oscillator and check the global running event flag at one or more logical checkpoints preset in the dimming task process.

[0024] Step S103: When a task stop command is received, the global run event flag is adjusted to the request stop state. Based on the state of the global run event flag obtained at the logical checkpoint and the real-time lock state of the optical parametric oscillator, a task interruption response strategy is executed for the dimming task. The task interruption response strategy includes: if the real-time lock state is an abnormal lock state, the interruption response is suspended and an operation to restore the optical parametric oscillator to a stable lock state is performed; if the real-time lock state is a stable lock state and the global run event flag is in the request stop state, the dimming task is safely interrupted at the current or next logical checkpoint, and the global lock is released.

[0025] Based on the above settings, by introducing a global lock for task-level mutual exclusion in the dimming task control of the coherent optical quantum computer, the concurrent execution of multiple dimming tasks can effectively prevent the device state from becoming chaotic. Introducing a global runtime event flag to indicate the task's running status enables controllable interruption within the task. This dual control mechanism balances security and controllability, significantly improving the dimming task control effect. Simultaneously, upon receiving a stop command, a differentiated task interruption response strategy is executed based on the monitoring status of the optical parametric oscillator, realizing intelligent interruption priority decision-making based on system health. This achieves deterministic and graceful exit at a safe point, resulting in improved dimming efficiency and subsequent computational efficiency.

[0026] Specifically, step S101 above provides an initialization step. The essence of a lock is serialized access. When a dimming task acquires the lock, other dimming tasks attempting to acquire the lock will be blocked or fail, thus physically preventing them from sending potentially conflicting control signals simultaneously. Therefore, by creating and initializing a global lock for task-level mutual exclusion, it is ensured that at most one dimming task can enter and execute control instructions on optical hardware (such as delay lines and modulators) at any given time. This establishes an isolation mechanism to prevent hardware operation conflicts, fundamentally avoiding device parameter chaos and OPO coherence corruption caused by concurrent instructions. At the same time, the global running event flag is a variable shared between the task thread and the external control thread. Its state (running state / stopped state) is visible to all threads. This allows the dimming task to periodically check the flag to learn about the external control intent, thereby proactively deciding whether and how to respond to interrupts at appropriate points in its own code logic. This achieves cooperative interruption rather than preemptive interruption. Therefore, by creating and initializing a global runtime event flag to indicate the running status of a task, a predictable and collaborative interrupt signaling channel is established, providing a unified and thread-safe stop switch for the dimming task in execution. The stop command can transmit an interrupt request to the task by modifying the flag's state, rather than forcibly interrupting the process.

[0027] According to an embodiment of the present invention, step S102 provides a task initiation step. By acquiring a global lock and adjusting the global running event flag to the running state, it is ensured that the allowed dimming task is started in the correct state (i.e., the global running event flag is in the running state). Simultaneously, monitoring the locking state of the OPO provides a reference for subsequent interrupt response decisions. Furthermore, by pre-setting logical checkpoints in the process, continuous task execution is discretized into a series of interruptible safety steps. The dimming task only evaluates interrupt requests at the pre-set logical checkpoints, avoiding sudden interruptions during critical hardware operations (such as changes in drive voltage), thereby protecting operational consistency and hardware security. For example, after one adjustment sub-step is completed and before the next adjustment sub-step begins, a check is performed to determine if an interrupt is needed. At this point, the hardware has just completed a relatively complete operation cycle and is in a well-defined, parameter-stable static state. Pausing the dimming task in this state allows the system to remain in a known, recoverable configuration, thus protecting the already executed dimming sub-steps and effectively improving the execution efficiency of the entire dimming task, thereby contributing to improving the computational efficiency of the coherent optical quantum computer.

[0028] In some embodiments, step S103 above provides an interrupt response step: when a stop command is received, the event flag is adjusted; based on the flag state obtained at a preset logical checkpoint and the real-time lock state of the OPO, a differentiated task interrupt response strategy is executed. If the OPO is abnormal, the interruption is temporarily suspended and the OPO state is restored first; if the OPO is stable and the flag is in a stopped state, a safe interrupt task is executed at the current or next preset checkpoint and the global lock is released. This step implements intelligent interrupt priority decision based on system health. This strategy breaks the simple logic of immediately interrupting upon receiving a stop command. When the OPO state is abnormal, the system determines that maintaining the basic working state of the quantum hardware has a higher priority than directly responding to the stop command, thus choosing to repair the hardware first, thereby protecting the fragile quantum state and preventing a longer system downtime due to forced interruption in a locked state. Meanwhile, execution is only allowed to stop at preset logical checkpoints when the OPO is stable. This ensures that the timing of the dimming task's exit action is controllable and the hardware state is safe. At this point, resource release (releasing the global lock) and state reset are performed, ensuring that the system can smoothly and definitively return to an acceptable idle state, preparing for the start of the next dimming task.

[0029] It is also understandable that releasing the global lock is the final step in the safe interruption dimming task process, and placed after the task interruption response decision logic based on OPO status checks. This ensures that as long as the dimming task is aborted (regardless of the strategy), the global lock will be released, thereby preventing the system from permanently deadlocking due to the global lock not being released.

[0030] like Figure 2 As shown, the flow of the dimming task control method for a coherent optical quantum computer provided in a specific embodiment of the present invention includes: Task startup process: After receiving a dimming task request, an attempt is made to acquire the global lock. If the acquisition fails, a task startup failure signal is returned; if the acquisition is successful, the global running event flag (event) is set to the running state (running_event). Task execution process: The dimming task is executed. At each logical checkpoint, it is determined whether to interrupt the task. If the global running event flag (event) is in the running state, execution continues; if the global running event flag (event) requests to stop and the OPO state is stable, the task is interrupted (the execution of the dimming task is exited). Resource release process: Regardless of whether the task ends or is interrupted, the global lock is released and the trigger source is cleared.

[0031] In some embodiments, the steps of executing the corresponding dimming task include: loading the device configuration parameters corresponding to the dimming task indicated by the dimming task request from storage; wherein the device configuration parameters include one or more of delay line position, scan step, bias range, and temperature target value; and invoking the task wrapper to execute the dimming task; wherein the task wrapper is configured to release the global lock after the dimming task is completed or after the task interruption response policy is triggered.

[0032] Based on the above settings, when a dimming task starts, the pre-determinism of the dimming task execution is ensured from the status input level by first loading the corresponding device configuration parameters, and the post-safety of the task execution is ensured from the resource management level by configuring a task encapsulator to ensure lock release when the task terminates (task completion or task interruption). At the same time, the two also work together to enhance the robustness and reliability of the dimming task control process.

[0033] According to embodiments of the present invention, the device configuration parameters (delay line position, scan step, bias range, target temperature value, etc.) directly correspond to the optical hardware parameters that need to be precisely controlled during the dimming process of a coherent optical quantum computer. Loading these parameters from storage (such as configuration files or databases), rather than using temporary values ​​or global variables in memory, prevents parameter contamination caused by residual system states or accidental coupling between different tasks. This ensures that each dimming task begins adjustment based on a clear and well-defined set of target parameters, avoiding dimming tasks running from outdated, incorrect, or random initial states. This provides a repeatable and predictable starting point for the dimming process (a consistent starting point helps ensure repeatable results).

[0034] Understandably, loading the device configuration parameters corresponding to the dimming task is essentially a standard initialization step before the dimming task is executed. It aligns the software control state of the dimming control system with the preset and verified configuration scheme, thereby anchoring the operation of the dimming task to a set starting point, which helps to improve the dimming control effect.

[0035] In this embodiment of the invention, the encapsulation structure of the task encapsulator is a try-finally code structure, and the operation of releasing the global lock is located in the finally code block. This encapsulation structure is configured such that, regardless of whether the dimming task function returns normally, is interrupted by an exception, or actively throws an exception, the operation of releasing the global mutex lock is forcibly executed in the finally code block before exiting.

[0036] In some examples, when the task wrapper calls the actual dimming task function, the wrapper structure establishes a controlled execution environment, which places the dimming task function in a fixed layer of management logic. This layer of management logic is configured to release the global lock after the dimming task is completed or after the task interruption response strategy is triggered.

[0037] Meanwhile, it's understandable that placing the critical operation of releasing the global lock within the post-processing logic of the task wrapper (such as within a finally block) ensures structurally that the lock release operation is independent of the main task logic's exit path. Whether exiting normally via a return statement, or exiting via break, raise exceptions, or responding to interrupt signals, the program execution flow must ultimately pass through this post-processing point. This transforms resource release from a method requiring manual maintenance by each developer across all branch paths into an automated mechanism executed by the architecture, significantly reducing the possibility of resource leaks due to programming oversights.

[0038] In some embodiments, the dimming task includes a step of scanning and adjusting an optical delay line; wherein the scanning adjustment employs a bidirectional boundary scanning method: starting from the current position of the delay line, scanning is performed along a first direction with a preset step until the light signal intensity is detected to be below a threshold and continues to reach a predetermined number of times, to determine a first boundary; scanning is performed along a second direction with a preset step until the light signal intensity is detected to be below the threshold again and continues to reach a predetermined number of times, to determine a second boundary; wherein a logical checkpoint is set before each step scan.

[0039] Based on the above settings, a specific implementation method for scanning and adjusting an optical delay line using a bidirectional boundary scanning method is provided in a dimming task. This method can automatically and accurately find the two boundary positions of the effective (or optimal) working range of the light pulse on the delay line without manual intervention or repeated trials, achieving automated and highly robust calibration of the delay line's working boundary. Furthermore, by requiring the light signal intensity to remain below a threshold for a predetermined number of times before confirming the boundary, it effectively filters out occasional signal drops caused by environmental noise, instantaneous fluctuations, or measurement errors, preventing misjudgments and ensuring the stability and reliability of the found boundary, thus improving the anti-interference capability and reliability of the adjustment process. Simultaneously, by setting a logical checkpoint before each step scan, the scanning cycle, which might otherwise involve dozens or hundreds of steps, is no longer an uninterrupted dimming task. Before each tiny movement step begins, the system has the opportunity to respond to an external stop command. Through this fine-grained stop checkpoint (i.e., a preset logical point), the stop flag is checked before each critical operation, ensuring timely response to interruption requests.

[0040] It should be noted that the logic checkpoint settings in the dimming task that performs scanning adjustment of the optical delay line described above are only examples. It is understood that in other dimming tasks, logic checkpoints can also be set before each critical operation to ensure that the dimming task can respond to interruptions in a timely manner without affecting the OPO state through this fine-grained logic detection, thereby ensuring the overall operating efficiency of the dimming task and improving the granularity of dimming task control.

[0041] Specifically, setting the logic checkpoint before each step scan is directly aligned with the minimum controllable cycle of the hardware action. A single step scan comprises a complete pair of operations: moving the delay line one step and subsequent signal detection. Checking before this operation begins means the system is always at a stable point—a standstill, measurement complete, and state known—to evaluate whether to continue. Even if an interruption occurs at this point, the optical system state is clearly defined because the delay line is in a well-defined position, avoiding any impact on the optics.

[0042] It is also understandable that the design of setting logical checkpoints before each step scan allows external stop commands to act on each iteration of the dimming task's internal loop. In essence, it binds the loop control variable (whether to continue iterating) with external event flags (whether to request a stop). Thus, the admission conditions for each iteration include not only whether the scan boundary has been reached, but also whether the external environment allows continuation (or whether the external environment requests an interruption). This discretizes a long, continuous operation into a sequence of subtasks separated by preset logical checkpoints, thereby achieving fine-grained flow control and further improving the dimming task control effect.

[0043] like Figure 3 As shown, in a specific embodiment of the present invention, when setting logical checkpoints between the main stages of a dimming task, the dimming task execution steps include: the dimming task in this embodiment involves three stages. The first stage is a rapid modification task, mainly executing fine-tuning of the delay line. After the fine-tuning of the delay line is completed, and before executing the next stage task, checkpoint 1 is set to determine whether the interrupt response strategy is satisfied. If yes, it safely exits; if no, it continues to execute the second stage task (main adjustment task). The second stage main adjustment task mainly includes sub-tasks such as delay line main adjustment and temperature control compensation adjustment. Logical checkpoints are set after each sub-task is completed and before the next sub-task is executed ( Figure 3 Checkpoints 3 and 4 in the process determine whether the interrupt response strategy is met. If yes, the process exits safely; otherwise, the third-stage task (sequential task) continues. The sequential task in the third stage mainly includes sub-tasks such as IM1 bias adjustment, IM2 bias adjustment, and temperature control fine-tuning. The task execution and interruption checks are still performed according to the above logic. It should be noted that the specific stages and sub-tasks included in the dimming task are examples and are not intended to limit the invention. It should also be noted that the above determination of whether the interrupt response strategy is met also requires judging whether "if the real-time lock state is an abnormal lock state, the interrupt response is suspended and an operation to restore the optical parametric oscillator to a stable lock state is performed; if the real-time lock state is a stable lock state and the global running event flag is in a request-to-stop state, the dimming task is safely interrupted at the current or next logical checkpoint and the global lock is released." Only when the OPO is in a stable state and the global running event flag is set to a request-to-stop state is the judgment result determined to be yes, and the task exit operation is performed (i.e., the current dimming task is interrupted).

[0044] In some of these embodiments, the steps of attempting to acquire the global lock include: calling the non-blocking acquisition interface corresponding to the global lock; if the acquisition fails, returning a task start failure signal to the requester of the dimming task request, without entering a blocking waiting state.

[0045] Based on the above settings, by utilizing the instantaneous attempt and confirmation return characteristics of the non-blocking lock acquisition interface, the dimming task admission control is transformed from a wait-notification model that may cause delays and resource uncertainties into an instant decision-making and instant feedback model, which significantly improves the system's response speed, resource utilization and behavior predictability in concurrent request scenarios.

[0046] The design purpose and protocol of the non-blocking acquisition interface provided in the embodiments of the present invention is to perform a one-time, instantaneous lock state check and acquisition attempt. Its underlying implementation is usually an atomic test and set instruction, which will return the result immediately regardless of success or failure. Physically, there is no code path to put the calling thread into sleep or waiting queue, thereby achieving instant feedback and non-blocking.

[0047] In some embodiments, when the system cannot accept a new dimming task because a dimming task is already running, the requester can receive a clear failure response immediately (usually within microseconds) after initiating the request, without experiencing an uncertain waiting time, thus achieving immediate and deterministic feedback to the requester. At the same time, since failed dimming task requests do not enter the blocking queue, there is no need to allocate or maintain additional waiting resources (such as thread suspension, context switching, memory overhead) for these failed dimming task requests, thereby preventing resource exhaustion and performance degradation caused by request backlog, and avoiding the invalid occupation of system resources while waiting. Furthermore, for any dimming task request, the requester either receives the task successfully and executes it, or immediately rejects it, which simplifies the upper-layer scheduling logic and exception handling process, and maintains the high predictability of the system's external response.

[0048] In some embodiments, the step of monitoring the locking state of the optical parametric oscillator includes: receiving and parsing a status code returned from the field programmable gate array controlling the optical parametric oscillator; if the status code is a predefined error code, determining that the locking state is an abnormal locking state; if the status code is a non-predefined error code, determining that the locking state is a stable locking state; wherein the predefined error codes include a first error code for indicating that the optical parametric oscillator may lose lock and a second error code for indicating that the optical parametric oscillator is locked abnormally.

[0049] Based on the above settings, the complex simulated operating states (locked, unlocked, abnormal) of the OPO optical physical component are transformed into discrete digital status codes that can be directly understood and processed by the software layer, establishing a direct, digital sensing channel for the core hardware state of the quantum system. At the same time, by strictly defining abnormal states as matching a few predefined error codes, and treating all other status codes (including normal codes and other undefined codes) as stable states, a clear and unambiguous judgment rule is established. This effectively filters out unknown or sporadic noise signals that may occur in hardware communication and prevents the system from overreacting due to false alarms, thereby improving the determinism and high signal-to-noise ratio of state determination.

[0050] The FPGA is the hardware controller that manipulates the OPO pulse sequence, enabling real-time monitoring of key parameters such as the OPO's locking loop, power, and phase. The status codes generated by the FPGA provide accurate and timely feedback on the OPO's internal operating status. By receiving and parsing the FPGA status codes, diagnostic information can be read from the source control unit, ensuring the authenticity and timeliness of the monitored OPO status information.

[0051] According to a specific embodiment of the present invention, the step of determining the lock status of OPO based on the FPGA return status code may include: comparing the received status code with a known predefined error code list, and triggering an abnormal status determination only when the status code completely matches a specific pattern (such as the value 124 or the value 125) in the predefined error code list. This makes the determination logic extremely deterministic and predictable, avoiding the uncertainty that may be brought about by the determination based on thresholds or fuzzy rules.

[0052] The specific values ​​and semantics of the first error code (e.g., 124, indicating possible lock loss) and the second error code (e.g., 125, indicating a lock failure) are predefined by the FPGA firmware developers based on the physical characteristics of the OPO. Each code corresponds to a specific, identified abnormal operating condition. Using these codes is equivalent to inheriting and applying the expert knowledge embedded in the hardware control logic.

[0053] In another specific embodiment of the present invention, if the status code is a non-predefined error code, the locked state is determined to be a stable locked state. This adopts a whitelist or anomaly list approach, treating all states not explicitly marked as abnormal as stable. This means that unless the system receives conclusive evidence of an anomaly (matching a predefined error code), it will maintain the stable state judgment and continue operation or prepare for a safe interruption. This minimizes false alarms and misoperations caused by communication interference, unknown states, or future expansion of new status codes, enhancing the system's robustness in complex environments.

[0054] In some of these embodiments, the steps of the above-mentioned secure interruption of the dimming task include: setting the parameters of the optical modulation device and the light source driver of the coherent optical quantum computer to a secure state value.

[0055] Based on the above settings, when the dimming task is aborted, not only are software processes and logical resources (such as global locks) cleaned up, but the controlled optical physical devices are also ensured to be actively placed in a predefined, lowest-risk hardware operating state (i.e., the corresponding parameters are set to safe state values), realizing a closed loop from software control flow interruption to hardware physical state safety. Furthermore, it avoids optical components (such as intensity modulators, phase modulators, and laser sources) remaining at unsafe operating points due to sudden interruption of the dimming task, such as excessively high drive power, unstable bias points, or parameter ranges that may cause thermal damage or nonlinear effects, thereby protecting the expensive and precise quantum optical hardware.

[0056] Furthermore, by resetting the hardware to a unified and known safe state, the uncertainty caused by the system remaining in an unclear intermediate state when the last dimming task was interrupted is eliminated. This ensures that the system starts from a clear and consistent hardware baseline, whether it is restarting the dimming task or performing other computing tasks. This simplifies the recovery logic and improves the overall availability of the system.

[0057] The safety state values ​​provided in this embodiment of the invention are a set of specific parameters determined based on the physical characteristics of optical devices and system safety operation specifications. For example, for a light source driver, the safety value might be setting the output power to a low power or standby power far below the damage threshold; for an optical modulator, it might be setting the bias voltage at the midpoint of the linear operating region or at zero bias. The specific numerical settings corresponding to the safety state values ​​take into account safety knowledge such as preventing hardware overload, avoiding accidental light emission, and maintaining thermal stability, thereby realizing the elimination of physical risks through direct hardware intervention.

[0058] According to a specific embodiment of the present invention, the operation of setting the parameters of the optical device to a safe state value does not rely on the power-off reset or default state of the hardware, but is a parameter configuration command initiated by the software with a clear objective. It covers any instantaneous parameters that the hardware may have when an interrupt is executed, and guides it to a safe working range that has been pre-verified and defined by the system designer.

[0059] Meanwhile, defining the operation of setting the parameters of the optical device to a safe state value is defined as an inherent component of the safe interruption dimming task step, meaning that the parameter setting operation is logically and temporally strongly bound to the dimming task exit process. Based on this, the process design ensures that whenever a safe interruption dimming task step occurs, the hardware safety settings will inevitably be executed, thus establishing a mandatory hardware security guarantee at the system behavior level.

[0060] In some embodiments, the method further includes: attempting to acquire a global lock in a non-blocking manner to determine the system state of the dimming control system without interfering with the execution of the dimming task, and implementing heartbeat monitoring and reporting based on the system state; wherein, if the acquisition is successful, it is determined that the system is in an idle state and the global lock is released; if the acquisition fails, it is determined that the system is in a busy state.

[0061] Based on the above settings, an external monitoring mechanism for a dimming control system is provided. This mechanism achieves zero-overhead, highly reliable, and non-intrusive system status monitoring and heartbeat reporting. Without increasing system complexity or performance burden, it significantly improves the observability and maintainability of the coherent quantum computer control system (especially the dimming control system). This external monitoring mechanism can continuously and periodically acquire the critical system busy / idle status. This monitoring behavior itself does not occupy the mutex resources (global locks) required for dimming task execution, nor does it require any complex synchronization or communication with task threads. Therefore, it has no impact on the performance and timing of the core control flow, achieving non-intrusive, zero-overhead real-time monitoring of the system's core operating status. Simultaneously, the system status (idle / busy) query results can serve as the most basic and stable heartbeat data, periodically reported to the upper-level monitoring system or user interface. This provides a foundation for system observability, enabling maintenance personnel or automated scripts to understand in real time whether the system is executing tasks.

[0062] In one specific implementation, the system sends a heartbeat message containing the current system state at fixed intervals (e.g., 5 seconds).

[0063] Furthermore, the above method provides an elegant state inference mechanism based on existing resources. This method does not introduce additional state variables or complex flags. Instead, it directly reuses the existing architectural attribute of global lock occupancy as the criterion for determining the busy / idle state of the system. This makes the state judgment logic extremely simple and direct, and maintains intrinsic consistency with the core concurrency control mechanism of the system.

[0064] Specifically, the non-blocking acquisition attempt involves calling the lock's acquisition interface in non-blocking mode. This is the core of ensuring that the dimming task's execution is not interfered with. The non-blocking lock acquisition interface operation performs a transient check: if the lock is already held, it immediately returns a failure result, and the calling thread is not suspended or placed in a waiting queue. This means that the monitoring thread will never be blocked by performing a status query, nor will it ever compete for lock resources with or cause the worker thread executing the task to block, making the monitoring behavior completely transparent at the concurrency level.

[0065] According to a specific embodiment of the present invention, when the monitoring thread detects that the lock is in an idle state (successfully acquired), it immediately releases the lock after determining that it is in an idle state. This atomic sequence of "acquisition-determination-release" operations ensures that monitoring behavior does not actually steal or occupy lock resources. Immediately after the monitoring query, the system returns to the state before the query (the lock is still idle), ready to respond to new task requests at any time. This prevents monitoring behavior from accidentally blocking the start of actual tasks and avoids the occupation of lock resources.

[0066] In some of these embodiments, the aforementioned logical checkpoints include one or more of the following types: inter-stage checkpoints set between multiple sequentially executed functional stages in a dimming task; loop iteration checkpoints set before the start of each iteration in a parameter scanning or optimization loop containing multiple iterations; subtask boundary checkpoints set before the start of each subtask in a task list consisting of multiple independent subtasks; and critical operation pre-checkpoints set before the start of long-running hardware operations or initialization operations.

[0067] Based on the above setup, a multi-layered, tightly coupled safety interruption mesh is constructed by systematically deploying logical checkpoints at the natural boundaries of multiple levels of the dimming task control flow (between stages, before iterations, before subtasks, and before long operations). By discretizing the continuous flow and providing interruption opportunities at the gaps between discrete units, it simultaneously achieves timely interruption response, system state security, and flexible strategy deployment without hindering the main task logic.

[0068] The inter-stage checkpoints provided in this embodiment of the invention are set between functional stages, which may be large steps, such as delay line adjustment stages or temperature control adjustment stages. Setting checkpoints between these functional stages means that the system can be interrupted after a complete functional stage is completed, rather than interrupted in the middle. This ensures that when interrupted, the system is in a relatively complete functional state, avoiding an inconsistency where some parameters are adjusted while others remain unadjusted due to interruption in the middle of a stage.

[0069] The iterative checkpoint provided in this embodiment of the invention is set before the start of each iteration. For a loop operation (such as scanning), each iteration is typically a relatively independent operation (such as moving one step and then measuring). Setting a logical checkpoint before the start of an iteration means that a decision can be made before each iteration to continue, allowing for timely interruption of long-running loops without waiting for the entire loop to complete. Furthermore, since the logical checkpoint is before the start of an iteration, it means that when interrupted, the loop has not yet executed the current iteration, and the system state is the state after the previous iteration ended, which is clear.

[0070] The subtask boundary checkpoints provided in this embodiment of the invention are set before each subtask begins execution. The task list consists of multiple independent subtasks, each of which may adjust different devices or parameters. Setting a checkpoint before a subtask begins means that a decision can be made before executing a subtask, allowing interruptions to occur before the subtask begins, rather than during its execution. This ensures that when an interruption occurs, the current subtask has already been completed and the system state is intact.

[0071] The key pre-operation checkpoint provided in this embodiment of the invention is set before the start of a long-running hardware operation or initialization operation. Long-running operations may last for a considerable period; if the operation is interrupted during execution, the hardware may become unstable. By setting a checkpoint before the operation begins, it can be determined whether the operation should be executed. If a stop command is received, the long-running operation can be skipped, avoiding unnecessary waiting and potential risks.

[0072] According to embodiments of the present invention, by setting logical checkpoints at the aforementioned specific locations, the continuous task flow is discretized into safely interruptible atomic units. That is, the entire dimming task is decomposed into a series of relatively independent execution units separated at checkpoints. This ensures that external stop commands can only be responded to at the boundaries between adjacent execution units, thereby ensuring that the system is not in an intermediate state of execution of a certain unit when an interruption occurs, maintaining the consistency of the system state. Simultaneously, different types of checkpoints cover different levels of logical boundaries in the task flow: inter-stage checkpoints correspond to the boundaries of macroscopic functional modules; loop iteration checkpoints correspond to the boundaries of microscopic loop steps; subtask boundary checkpoints correspond to the boundaries of the task list; and pre-critical operation checkpoints correspond to the boundaries of high-risk operations. This achieves multi-granularity coverage of interrupt response, ensuring timely interrupt response at an appropriate granularity for both macroscopic flows and microscopic loops.

[0073] Furthermore, based on the above settings, the system can respond quickly to interrupts at logical checkpoints such as loop iterations and subtask boundaries, avoiding long waiting times. Setting checkpoints before critical operations can prevent the inability to interrupt in a timely manner due to long-running operations. At the same time, all these checkpoints are set before the start of the operation or after the completion of a stage, ensuring that the system is in a stable and well-defined state during interruptions, thus balancing the timeliness of response and the safety of interruptions.

[0074] Furthermore, the existence of different types of logical checkpoints allows system designers to selectively deploy checkpoints based on the specific structure and risk points of the dimming task, thus providing a foundation for flexible and configurable interrupt response strategies. For example, mandatory checkpoint setting before high-importance or high-risk operations provides an implementation vehicle for differentiated security strategies.

[0075] Of particular note are the emphasis on "before start" for loop iteration checkpoints, subtask boundary checkpoints, and pre-critical operation checkpoints. This principle ensures that interruption checks occur before operations that are about to consume resources or change the system state. If a stop command is received, the system can avoid executing the operation and directly enter the exit process, thus saving time and preventing unnecessary state changes. For loop iterations, checking before the iteration begins can avoid executing potentially invalid iteration steps; for long-running operations, checking before the start can avoid long wait times.

[0076] The dimming task control method for a coherent optical quantum computer provided in this embodiment of the invention creates and initializes a global lock for task-level mutual exclusion and a global running event flag to indicate the task's running status in response to the startup of the dimming control system of the coherent optical quantum computer. When a dimming task request is received, the global lock is acquired. If acquired successfully, the global running event flag is set to the running state, and the corresponding dimming task is executed. During the execution of the dimming task, the locking status of the optical parametric oscillator is monitored, and the global running event flag is checked at one or more logical checkpoints preset in the dimming task flow. When a task stop command is received, the global runtime event flag is adjusted to a stop request state. Based on the state of the global runtime event flag obtained at the logical checkpoint and the real-time lock state of the optical parametric oscillator, a task interruption response strategy is executed for the dimming task. The task interruption response strategy includes: if the real-time lock state is an abnormal lock state, the interruption response is temporarily suspended and operations are performed to restore the optical parametric oscillator to a stable lock state; if the real-time lock state is a stable lock state and the global runtime event flag is a stop request state, the dimming task is safely interrupted at the current or next logical checkpoint, and the global lock is released. By introducing a global lock for task-level mutual exclusion in the dimming task control of a coherent optical quantum computer, the concurrent execution of multiple dimming tasks can effectively prevent device state chaos. Introducing a global runtime event flag to indicate the task's running status enables controllable interruption within the task. This dual control mechanism balances security and controllability, significantly improving the dimming task control effect. Simultaneously, upon receiving a stop command, a differentiated task interruption response strategy is executed based on the monitoring status of the optical parametric oscillator, achieving intelligent interrupt priority decision-making based on system health. This enables deterministic and graceful exit at safe points, achieving the technical effects of improving dimming efficiency and subsequent computational efficiency.

[0077] Based on the dimming task control method for a coherent optical quantum computer provided in the embodiments of the present invention, the embodiments of the present invention also provide a dimming task control device for a coherent optical quantum computer. Figure 4As shown, the dimming task control device 400 of the coherent optical quantum computer includes: Initialization module 401 is used to create and initialize a global lock for task-level mutual exclusion and a global running event flag for indicating the running status of the task in response to the start of the dimming control system of the coherent optical quantum computer. The task execution control module 402 is used to attempt to acquire a global lock when a dimming task request is received. If the acquisition is successful, the global running event flag is set to the running state and the corresponding dimming task is executed. During the execution of the dimming task, the locking state of the optical parametric oscillator is monitored, and the global running event flag is checked at one or more logical checkpoints preset in the dimming task process. The task interruption control module 403 is used to adjust the global running event flag to a request-to-stop state when a task stop command is received. Based on the state of the global running event flag obtained at the logical checkpoint and the real-time lock state of the optical parametric oscillator, the module executes a task interruption response strategy for the dimming task. The task interruption response strategy includes: if the real-time lock state is an abnormal lock state, the interruption response is suspended and operations are performed to restore the optical parametric oscillator to a stable lock state; if the real-time lock state is a stable lock state and the global running event flag is a request-to-stop state, the dimming task is safely interrupted at the current or next logical checkpoint, and the global lock is released.

[0078] Based on the above settings, by introducing a global lock for task-level mutual exclusion in the dimming task control of the coherent optical quantum computer, the concurrent execution of multiple dimming tasks can effectively prevent the device state from becoming chaotic. Introducing a global runtime event flag to indicate the task's running status enables controllable interruption within the task. This dual control mechanism balances security and controllability, significantly improving the dimming task control effect. Simultaneously, upon receiving a stop command, a differentiated task interruption response strategy is executed based on the monitoring status of the optical parametric oscillator, realizing intelligent interruption priority decision-making based on system health. This achieves deterministic and graceful exit at a safe point, resulting in improved dimming efficiency and subsequent computational efficiency.

[0079] It should be noted that the specific modules within the dimming task control device 400 of the aforementioned coherent optical quantum computer are defined primarily based on the corresponding operations to be performed, and are not intended as limitations on the specific modules.

[0080] like Figure 5This diagram illustrates the main framework of a dimming task control device for a coherent optical quantum computer according to another embodiment of the present invention. The dimming task control device (also referred to as a dimming control system) may include: an external interface layer, a concurrency control layer, a checkpoint layer, and a dimming execution layer. The external interface layer is mainly used for receiving dimming task requests, receiving stop commands, and receiving system status query requests. The concurrency control layer mainly includes constructing and maintaining a task mutex lock (task_lock, i.e., the aforementioned global lock), running status events (running_event, i.e., the aforementioned global running event flag), and a task wrapper (task_wrapper). The checkpoint layer is used to preset logical checkpoints, which may include inter-stage checkpoints, loop iteration checkpoints, subtask boundary checkpoints, etc. The dimming execution layer is used to execute specific dimming tasks, such as delay line adjustment, IM bias calibration, temperature control adjustment, and FPGA status verification.

[0081] For example Figure 6 , Figure 7 and Figure 8 The diagrams illustrate the interactions between modules within the dimming control system when a dimming task request is received, a stop command is received, and multiple clients concurrently initiate dimming task requests. In this example, the dimming control system includes a host computer, a main control unit, a mutex lock management unit, a runtime event status maintenance unit, and task threads. The specific interaction processes have been described above and will not be repeated here.

[0082] In some embodiments, the task execution control module 402 is further configured to: load the device configuration parameters corresponding to the dimming task indicated by the dimming task request from storage; wherein the device configuration parameters include one or more of delay line position, scan step, bias range, and temperature target value; and call the task wrapper to execute the dimming task; wherein the task wrapper is configured to: perform the operation of releasing the global lock after the dimming task is completed or after the task interruption response strategy is triggered.

[0083] Based on the above settings, when a dimming task starts, the pre-determinism of the dimming task execution is ensured from the status input level by first loading the corresponding device configuration parameters, and the post-safety of the task execution is ensured from the resource management level by configuring a task encapsulator to ensure lock release when the task terminates (task completion or task interruption). At the same time, the two also work together to enhance the robustness and reliability of the dimming task control process.

[0084] In some embodiments, the dimming task includes a step of scanning and adjusting the optical delay line; the task execution control module 402 is further configured to: employ a bidirectional boundary scanning method for scanning adjustment, starting from the current position of the delay line, scanning along a first direction with a preset step until the light signal intensity is detected to be lower than a threshold and continues to reach a predetermined number of times, to determine a first boundary; scanning along a second direction with a preset step until the light signal intensity is detected to be lower than the threshold again and continues to reach a predetermined number of times, to determine a second boundary; wherein, a logical checkpoint is set before each step scan.

[0085] Based on the above settings, a specific implementation method for scanning and adjusting an optical delay line using a bidirectional boundary scanning method is provided in a dimming task. This method can automatically and accurately find the two boundary positions of the effective (or optimal) working range of the light pulse on the delay line without manual intervention or repeated trials, achieving automated and highly robust calibration of the delay line's working boundary. Furthermore, by requiring the light signal intensity to remain below a threshold for a predetermined number of times before confirming the boundary, it effectively filters out occasional signal drops caused by environmental noise, instantaneous fluctuations, or measurement errors, preventing misjudgments and ensuring that the found boundary is stable and reliable, thus improving the anti-interference capability and reliability of the adjustment process. Simultaneously, by setting a logical checkpoint before each step scan, the scanning cycle, which might otherwise involve dozens or hundreds of steps, is no longer an uninterrupted dimming task. Before each tiny movement step begins, the system has the opportunity to respond to an external stop command. Through this fine-grained stop checkpoint (i.e., the preset logical checkpoint), the stop flag is checked before each critical operation, ensuring timely response to interruption requests.

[0086] In some embodiments, the task execution control module 402 is further configured to: call the non-blocking acquisition interface corresponding to the global lock; if the acquisition fails, return a task start failure signal to the requester of the dimming task request, and not enter the blocking waiting state.

[0087] Based on the above settings, by utilizing the instantaneous attempt and confirmation return characteristics of the non-blocking lock acquisition interface, the dimming task admission control is transformed from a wait-notification model that may cause delays and resource uncertainties into an instant decision-making and instant feedback model, which significantly improves the system's response speed, resource utilization and behavior predictability in concurrent request scenarios.

[0088] In some embodiments, the task execution control module 402 is further configured to: receive and parse the status code returned from the field-programmable gate array controlling the optical parametric oscillator; if the status code is a predefined error code, determine that the locking state is an abnormal locking state; if the status code is a non-predefined error code, determine that the locking state is a stable locking state; wherein the predefined error codes include a first error code for indicating that the optical parametric oscillator may lose lock and a second error code for indicating that the optical parametric oscillator is locked abnormally.

[0089] Based on the above settings, the complex simulated operating states (locked, unlocked, abnormal) of the OPO optical physical component are transformed into discrete digital status codes that can be directly understood and processed by the software layer, establishing a direct, digital sensing channel for the core hardware state of the quantum system. At the same time, by strictly defining abnormal states as matching a few predefined error codes, and treating all other status codes (including normal codes and other undefined codes) as stable states, a clear and unambiguous judgment rule is established. This effectively filters out unknown or sporadic noise signals that may occur in hardware communication, prevents the system from overreacting due to false alarms, and improves the determinism and high signal-to-noise ratio of state determination.

[0090] In some embodiments, the task interruption control module 403 is further configured to: set the parameters of the optical modulation device and the light source driver of the coherent optical quantum computer to a safe state value during the execution of a safe interruption dimming task.

[0091] Based on the above settings, when the dimming task is aborted, not only are software processes and logical resources (such as global locks) cleared, but the controlled optical physical devices are also actively placed in a predefined, lowest-risk hardware operating state (i.e., the corresponding parameters are set to safe state values), achieving a closed loop from software control flow interruption to hardware physical state safety. Simultaneously, it avoids optical components (such as intensity modulators, phase modulators, and laser sources) remaining at unsafe operating points due to sudden dimming task interruption, such as excessively high drive power, unstable bias points, or parameter ranges that may cause thermal damage or nonlinear effects, thus protecting the expensive and precise quantum optical hardware.

[0092] In some embodiments, the dimming task control device 400 of the coherent optical quantum computer further includes a system status query module, which is used to: attempt to acquire a global lock in a non-blocking manner to determine the system status of the dimming control system without interfering with the execution of the dimming task, and realize heartbeat monitoring and reporting based on the system status; wherein, if the acquisition is successful, it is determined that the system is in an idle state and the global lock is released; if the acquisition fails, it is determined that the system is in a busy state.

[0093] Based on the above settings, an external monitoring mechanism for a dimming control system is provided. This mechanism achieves zero-overhead, highly reliable, and non-intrusive system status monitoring and heartbeat reporting. Without increasing system complexity or performance burden, it significantly improves the observability and maintainability of the coherent quantum computer control system (especially the dimming control system). This external monitoring mechanism can continuously and periodically acquire the critical system busy / idle status. This monitoring behavior itself does not occupy the mutex resources (global locks) required for dimming task execution, nor does it require any complex synchronization or communication with task threads. Therefore, it has no impact on the performance and timing of the core control flow, achieving non-intrusive, zero-overhead real-time monitoring of the system's core operating status. Simultaneously, the system status (idle / busy) query results can serve as the most basic and stable heartbeat data, periodically reported to the upper-level monitoring system or user interface. This provides a foundation for system observability, enabling maintenance personnel or automated scripts to understand in real time whether the system is executing tasks.

[0094] In some of these embodiments, the aforementioned logical checkpoints include one or more of the following types: inter-stage checkpoints set between multiple sequentially executed functional stages in a dimming task; loop iteration checkpoints set before the start of each iteration in a parameter scanning or optimization loop containing multiple iterations; subtask boundary checkpoints set before the start of each subtask in a task list consisting of multiple independent subtasks; and critical operation pre-checkpoints set before the start of long-running hardware operations or initialization operations.

[0095] Based on the above setup, a multi-layered, tightly coupled safety interruption mesh is constructed by systematically deploying logical checkpoints at the natural boundaries of multiple levels of the dimming task control flow (between stages, before iterations, before subtasks, and before long operations). By discretizing the continuous flow and providing interruption opportunities at the gaps between discrete units, it simultaneously achieves timely interruption response, system state security, and flexible strategy deployment without hindering the main task logic.

[0096] The dimming task control device for a coherent optical quantum computer provided in this embodiment of the invention employs an initialization module. This module, in response to the startup of the dimming control system of the coherent optical quantum computer, creates and initializes a global lock for task-level mutual exclusion and a global running event flag to indicate the task's running status. The task execution control module, upon receiving a dimming task request, attempts to acquire the global lock. If successful, it sets the global running event flag to the running state and executes the corresponding dimming task. During the execution of the dimming task, the locking status of the optical parametric oscillator is monitored, and checks are performed at one or more pre-defined logical checkpoints in the dimming task flow. A global runtime event flag; a task interruption control module, used to adjust the global runtime event flag to a request-to-stop state when a task stop command is received, and to execute a task interruption response strategy for the dimming task based on the state of the global runtime event flag obtained at the logical checkpoint and the real-time lock state of the optical parametric oscillator; wherein, the task interruption response strategy includes: if the real-time lock state is an abnormal lock state, then the interruption response is suspended and operations are performed to restore the optical parametric oscillator to a stable lock state; if the real-time lock state is a stable lock state and the global runtime event flag is a request-to-stop state, then the dimming task is safely interrupted at the current or next logical checkpoint and the global lock is released. By introducing a global lock for task-level mutual exclusion in the dimming task control of a coherent optical quantum computer, the concurrent execution of multiple dimming tasks can effectively prevent device state chaos. Introducing a global runtime event flag to indicate the task's running status enables controllable interruption within the task. This dual control mechanism balances security and controllability, significantly improving the dimming task control effect. Simultaneously, upon receiving a stop command, a differentiated task interruption response strategy is executed based on the monitoring status of the optical parametric oscillator, achieving intelligent interrupt priority decision-making based on system health. This enables deterministic and graceful exit at safe points, achieving the technical effects of improving dimming efficiency and subsequent computational efficiency.

[0097] This invention also provides a non-transitory machine-readable medium storing a computer program, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform a method according to an embodiment of this invention.

[0098] This invention also provides a computer program product, including a computer program, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform the methods of embodiments of this invention. The computer program product should be understood as a software product that primarily implements the methods of this invention through a computer program.

[0099] This invention also provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, which, when executed by the at least one processor, causes the electronic device to perform the method of this invention.

[0100] refer to Figure 9 The present invention will now be described in the form of a structural block diagram of an electronic device that can serve as an embodiment of the present invention, which is an example of a hardware device that can be applied to various aspects of the present invention. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0101] like Figure 9 As shown, the electronic device includes a computing unit 901, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 902 or a computer program loaded into a random access memory (RAM) 903 from a storage unit 908. The RAM 903 may also store various programs and data required for the operation of the electronic device. The computing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0102] Multiple components in the electronic device are connected to I / O interface 905, including: input unit 906, output unit 907, storage unit 908, and communication unit 909. Input unit 906 can be any type of device capable of inputting information into the electronic device. Input unit 906 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of the electronic device. Output unit 907 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 908 may include, but is not limited to, disks and optical discs. Communication unit 909 allows the electronic device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, and / or wireless communication transceivers, such as Bluetooth devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.

[0103] The computing unit 901 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, CPUs, graphics processing units (GPUs), various special-purpose artificial intelligence (AI) computing units, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above. For example, in some embodiments, the method embodiments of the present invention can be implemented as a computer program tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed on an electronic device via ROM 902 and / or communication unit 909. In some embodiments, the computing unit 901 can be configured to perform the methods described above by any other suitable means (e.g., by means of firmware).

[0104] Computer programs for implementing the methods of embodiments of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0105] In the context of embodiments of the present invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable signal medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, or infrared systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0106] It should be noted that the term "comprising" and its variations used in the embodiments of the present invention are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The modifications of "one" and "multiple" mentioned in the embodiments of the present invention are illustrative and not restrictive. Those skilled in the art should understand that, unless explicitly indicated otherwise in the context, they should be understood as "one or more".

[0107] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in the embodiments of the present invention are all information and data that have been permitted by the user or have been fully agreed upon by all parties. Furthermore, the collection, use and processing of the relevant data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to agree or refuse.

[0108] The steps described in the method embodiments provided by this invention can be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of protection of this invention is not limited in this respect.

[0109] The term "embodiment" in this specification refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of the invention. The appearance of this phrase in various places in the specification does not necessarily imply the same embodiment, nor does it imply independence or alternativeity from other embodiments. The various embodiments in this specification are described in a related manner, with reference to each other for similar or identical parts. In particular, for apparatus, device, and system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, and relevant details are referred to in the description of the method embodiments.

[0110] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.

Claims

1. A method for controlling a light adjustment task of a coherent light quantum computer, characterized by, include: In response to the activation of the dimming control system of the coherent optical quantum computer, a global lock for task-level mutual exclusion and a global running event flag for indicating the running status of the task are created and initialized. When a dimming task request is received, an attempt is made to acquire the global lock. If the acquisition is successful, the global running event flag is set to the running state, and the corresponding dimming task is executed. During the execution of the dimming task, the locking state of the optical parametric oscillator is monitored, and the global running event flag is checked at one or more logical checkpoints preset in the dimming task flow. When a task stop command is received, the global runtime event flag is adjusted to a stop request state. Based on the state of the global runtime event flag obtained at the logical checkpoint and the real-time lock state of the optical parametric oscillator, a task interruption response strategy is executed for the dimming task. The task interruption response strategy includes: if the real-time lock state is an abnormal lock state, the interruption response is suspended and the operation to restore the optical parametric oscillator to a stable lock state is executed; if the real-time lock state is a stable lock state and the global runtime event flag is a stop request state, the dimming task is safely interrupted at the current or next logical checkpoint, and the global lock is released.

2. The method of claim 1, wherein, The steps for performing the corresponding dimming task include: Load the device configuration parameters corresponding to the dimming task indicated by the dimming task request from the storage; wherein, the device configuration parameters include one or more of the following: delay line position, scan step, bias range, and temperature target value; The task encapsulator is invoked to execute the dimming task; wherein the task encapsulator is configured to release the global lock after the dimming task is completed or after the task interruption response strategy is triggered.

3. The method of claim 2, wherein, The dimming task includes a step of scanning and adjusting the optical delay line; wherein, the scanning and adjustment adopts a bidirectional boundary scanning method: Starting from the current position of the delay line, a scan is performed along the first direction with a preset step until the light signal intensity is detected to be lower than the threshold and continues to reach a predetermined number of times to determine the first boundary; Scan along the second direction with the preset step size until the light signal intensity is detected to be below the threshold again and continues to reach the predetermined number of times, in order to determine the second boundary; The logical checkpoint is set before each step scan is performed.

4. The method of claim 1, wherein, The steps of attempting to acquire the global lock include: Call the non-blocking acquisition interface corresponding to the global lock; If the acquisition fails, a task start failure signal is returned to the requester of the dimming task request, and the task does not enter a blocking waiting state.

5. The method of claim 1, wherein, The steps for monitoring the lock-up state of the optical parametric oscillator include: Receive and parse the status code returned from the field-programmable gate array that controls the optical parametric oscillator; If the status code is a predefined error code, the locking state is determined to be an abnormal locking state; if the status code is a non-predefined error code, the locking state is determined to be a stable locking state; wherein, the predefined error codes include a first error code for indicating that the optical parametric oscillator may lose lock and a second error code for indicating that the optical parametric oscillator is locked abnormally.

6. The method according to claim 1, characterized in that, The steps for safely interrupting the dimming task include: The parameters of the optical modulation device and the light source driver of the coherent optical quantum computer are set to safe state values.

7. The method of claim 1, wherein, The method further includes: Without interfering with the execution of the dimming task, the system attempts to acquire the global lock in a non-blocking manner to determine the system state of the dimming control system, and performs heartbeat monitoring and reporting based on the system state; if the acquisition is successful, the system is determined to be in an idle state and the global lock is released; if the acquisition fails, the system is determined to be in a busy state.

8. The method of claim 1, wherein, The logical checkpoints include one or more of the following types: Inter-stage checkpoints are set between multiple sequentially executed functional stages in the dimming task; Set as a loop iteration checkpoint before the start of each iteration in a parameter scan or optimization loop that includes multiple iterations; Set as a subtask boundary checkpoint in a task list consisting of multiple independent subtasks, before each subtask begins execution; Set a critical pre-operation checkpoint before the start of a long-running hardware operation or initialization operation.

9. A dimming task control device for a coherent optical quantum computer, characterized in that, include: The initialization module is used to create and initialize a global lock for task-level mutual exclusion and a global runtime event flag to indicate the running status of the task in response to the startup of the dimming control system of the coherent optical quantum computer. The task execution control module is used to attempt to acquire the global lock when a dimming task request is received. If the acquisition is successful, the global running event flag is set to the running state, and the corresponding dimming task is executed. During the execution of the dimming task, the locking state of the optical parametric oscillator is monitored, and the global running event flag is checked at one or more logical checkpoints preset in the dimming task process. The task interruption control module is used to adjust the global running event flag to a request-to-stop state when a task stop command is received. Based on the state of the global running event flag obtained at the logical checkpoint and the real-time lock state of the optical parametric oscillator, it executes a task interruption response strategy for the dimming task. The task interruption response strategy includes: if the real-time lock state is an abnormal lock state, then the interruption response is temporarily suspended and the operation to restore the optical parametric oscillator to a stable lock state is executed; if the real-time lock state is a stable lock state and the global running event flag is a request-to-stop state, then the dimming task is safely interrupted at the current or next logical checkpoint, and the global lock is released.

10. A non-transitory machine-readable medium having stored thereon computer instructions, wherein: The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 8.