Test support device and test support method

The test support device and method efficiently test quantum programs by dividing them into blocks, evaluating quantum states, and calculating cost-effectiveness indices to identify errors accurately, addressing inefficiencies in classical and quantum computer testing.

JP2025012271APending Publication Date: 2025-01-24HITACHI LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2023114994
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-07-13
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

Existing methods for testing quantum programs on classical computers are inefficient and inaccurate, as they cannot complete large-scale calculations within practical time, and testing on quantum computers is difficult due to the challenge of accurately confirming quantum states post-execution, leading to issues in determining error locations and accuracy depending on the number of projection measurements.

Method used

A test support device and method that divides quantum software into blocks, uses a storage unit to hold quantum software, and performs quantum state evaluations based on predetermined measurement methods, calculating test effectiveness and cost indices to identify error locations efficiently.

Benefits of technology

The solution provides a highly cost-effective test procedure for quantum programs by determining error presence and location through a cost-effectiveness analysis, improving accuracy and reducing computational costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025012271000001_ABST
    Figure 2025012271000001_ABST
Patent Text Reader

Abstract

To enable a test procedure having high cost effectiveness to be presented in a test of a quantum program.SOLUTION: A test support device 100 includes a storage unit 101 for holding quantum software divided by a block, and an operation unit 104 for acquiring a test result by an evaluation test of a quantum state based on a prescribed measurement method for each measurement position defined about the block, calculating a test effect index value about a possibility of specifying error presence / absence in the block and a test cost index value about a calculation amount required for test execution on the basis of the test result, calculating a cost effectiveness value for each measurement position from these values, and outputting information of effective measurement position on the basis of the cost effectiveness value.SELECTED DRAWING: Figure 11
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a test support device and a test support method. [Background technology]

[0002] A quantum program, which is a program for a quantum computer, consists of quantum bits that hold quantum information and gates that represent operations on the quantum bits. A quantum program written with these quantum bits and gates is also called a quantum circuit. Simulation using a classical computer (hereafter referred to as classical simulation) is an effective way to test whether a quantum program behaves as expected by its designer.

[0003] In classical simulation, at any calculation step of a quantum program, it is possible to accurately check the state of the quantum bit at that point (hereafter referred to as the quantum state). In other words, just like with conventional classical programs, the correctness of the behavior can be tested by checking the quantum state at the end of the program or the quantum state when the program is executed halfway. For example, an arbitrary quantum state φ of a certain quantum bit can be expressed by the following equation (1), where α and β are complex numbers and are called the amplitude.

[0004] [Formula 1] JPEG2025012271000002.jpg9170

[0005] Using classical simulation, it is possible to check the values ​​of α and β at each computational step of a quantum program.

[0006] By the way, the greatest value that quantum computers provide is that they can perform enormous calculations that cannot be performed by classical computers. Therefore, it is highly likely that the computational processes that are implemented in society as quantum programs cannot be completed within a practical time frame by classical computers.

[0007] Of course, classical computers can also execute programs within a practical time frame, but there are cases where it is desirable to use quantum computers to process data faster. In what follows, we consider quantum programs that cannot be completed within a practical time frame on classical computers.

[0008] If we assume such a quantum program, its behavior cannot be tested by the classical simulation described above. In order to test the behavior of a quantum program, it is necessary to actually execute it using a quantum computer. However, when executing a quantum program on a quantum computer, it is difficult to accurately confirm the quantum state after execution, so it is estimated using the method shown below.

[0009] Quantum computers can hold a superposition of the values ​​0 and 1. They can also form entangled states with other quantum bits. There is an operation called projective measurement as a means of confirming these quantum states.

[0010] When a projection measurement is performed on a quantum bit, the superposition of 0 and 1 is eliminated, and the value observed is either 0 or 1. By performing this projection measurement multiple times, the probability of observing 0 and 1 can be derived.

[0011] The theoretical value of these probabilities is the square of the magnitude of the above amplitudes, i.e., |α| 2 and |β| 2 Therefore, by performing the projection measurement multiple times and calculating the average value, |β| 2 We can estimate the value of |α| 2 is |α| 2 =1-|β| 2 If the projection measurement is repeated infinitely, the average value will eventually converge to the theoretical value, but since the number of actual measurements is finite, a certain amount of error will occur. Also, the only thing obtained by the projection measurement is |α| 2 or |β| 2 , and the exact values ​​of α and β cannot be confirmed. However, the |α| obtained by the projection measurement 2 or |β| 2If the approximate value of is significantly different from the value assumed by the developer, it can be assumed that the quantum program contains an error. Therefore, it can be used as a means of testing quantum programs.

[0012] Another method for understanding the quantum state is quantum state tomography. By performing quantum state tomography, information about the quantum state can be obtained in the form of a density matrix. The density matrix represents a mixture of multiple quantum states expressed in the form of equation (1).

[0013] The density matrix ρ is expressed as follows: i is the quantum state φ i This represents the probability that [Formula 2] JPEG2025012271000003.jpg16170

[0014] In the case of one quantum bit, quantum state tomography estimates the density matrix ρ based on the following equation (3). [Formula 3] JPEG2025012271000004.jpg22170

[0015] Here, σ can be expressed by the following equation (4). [Formula 4] JPEG2025012271000005.jpg38170

[0016] T r (σ i ρ) represents the expectation value of the projection measurement results in each Pauli basis, so by repeating the projection measurements and calculating the average of the results, T r (σ i From the above, the density matrix ρ can be estimated by tomography from the results of multiple projection measurements, and the correctness of a quantum program can be tested by comparing this estimated value with the value assumed by the developer.

[0017] Quantum amplitude estimation is also known as a method for efficiently acquiring the magnitude of the amplitude of a quantum state. In quantum amplitude estimation, a quantum program consisting of algorithms for quantum phase estimation and inverse quantum Fourier transform is executed on the quantum state to be estimated, and multiple projection measurements are performed on the resulting quantum state. This identifies a basis vector with a maximum amplitude, and the magnitude of the amplitude of the quantum state to be estimated is estimated from that basis vector. In other words, when a quantum program is given, the quantum amplitude estimation operation is executed on the quantum state after the execution of the program, and multiple projection measurements are performed on the result, so that the magnitude of the amplitude after the execution of the target quantum program can be estimated. The quantum program is tested by comparing this estimated value with the value expected by the developer.

[0018] So far, we have given examples of methods for testing quantum programs, but these methods have the following two characteristics in common.

[0019] Based on the average of multiple projection measurements, an estimate of the quantum state after the quantum program is executed is derived. - Check whether there are any errors in the quantum program by comparing the above estimated values ​​with the expected values ​​defined by the developer.

[0020] In what follows, we will use as an example a testing method that detects errors in quantum programs by estimating the squared value of the amplitude magnitude through projection measurement and comparing this estimated value with the developer's expected value. However, the same can be said for other testing methods based on the above characteristics, such as methods that utilize quantum state tomography.

[0021] In addition, a conventional technology (see Patent Document 1) has been proposed that selects test cases to be executed with priority based on the results of past tests in order to detect errors in classical programs early on. However, this technology does not address the evaluation perspective specific to quantum programs. [Prior art documents] [Patent documents]

[0022] [Patent Document 1] Patent No. 6890795 Summary of the Invention [Problem to be solved by the invention]

[0023] In classical program development, a method is used to divide a program into multiple blocks (often subroutines) and test each block separately in order to reduce the time required for one test run or to make it easier to identify the location of errors.

[0024] If the execution result of a block differs from the developer's expectations (often defined as a specification), then there is an error in that block, and the scope of the error can be identified.

[0025] For quantum programs, it is also effective to divide a program into blocks and test each block. For example, the quantum program shown in Figure 1 is divided as shown in Figure 2, and blocks 1, 2, 3, and 4 are tested respectively.

[0026] In the case of a quantum program, the input state of a block is given as the execution result of all blocks preceding it. We assume that the quantum program in question is not classically simulatable, and we also assume that these blocks are not classically simulatable.

[0027] Of course, if the number of block divisions is increased, the number of gates contained in each block will be reduced, and the possibility of performing classical simulation will increase accordingly.

[0028] However, if the quantum bit is divided into many blocks from the beginning, it becomes difficult to narrow down the error. Also, if the number of quantum bits is huge, it is difficult to perform classical simulation even if it is divided into many blocks. Therefore, even if it is assumed that classical simulation cannot be performed on a block basis, the usefulness of the present invention is not significantly impaired.

[0029] In the test of block 1, the gate of block 1 is executed on the initial state, quantum state 0, and a projection measurement is performed on the quantum state resulting from that execution (state 1). By repeating this procedure, the squared value of the amplitude of the quantum state (hereafter referred to as the magnitude) is estimated. This estimated value is then compared with the value assumed by the developer, and if a certain similarity does not hold, it is determined that there is an error in block 1.

[0030] In the case of quantum computers, the introduction of noise can cause the quantum state to deviate from the theoretical value, but we will assume here that the effects of noise have already been taken into account. In other words, we will compare the estimated value and the expected value while taking into account the effects of noise to determine whether there is an error.

[0031] The basic procedure for testing block 2 is similar. However, please note that quantum state 1, which is the input to block 2, cannot be created without executing the gate of block 1. Since this test assumes a quantum program that cannot be classically simulated, it is not possible to arbitrarily set the quantum state that is the input to block 2 using the simulator's functions. In other words, to create quantum state 1, which is the input to block 2, block 1 must be executed on a quantum computer.

[0032] The procedure for testing block 2 is as follows: First, execute the gate of block 1 to create state 1, then execute the gate of block 2 using that as input. Then, perform a projection measurement on state 2 obtained as a result of that execution.

[0033] This procedure is repeated to perform multiple projection measurements to create an estimate of the squared magnitude of state 2. This estimate is then compared to the developer's assumption. Thus, blocks further back in the chain are more computationally expensive to test than blocks further forward. In other words, the computational cost of testing depends on the blocks ahead of the block being tested.

[0034] Let us consider a case where the estimated values ​​obtained by repeated projection measurements are compared with the developer's expected values ​​and there is no certain similarity between the estimated values ​​and the expected values. In this case, if it has been confirmed that there is no error in block 1, it can be said that there is a high possibility that there is an error in block 2.

[0035] However, if block 1 has not been tested and it is uncertain whether block 1 has an error, then either block 1 or block 2, or both, may have an error.

[0036] In this way, when a later block is tested, the blocks preceding it are implicitly included in the test target, so that the presence or absence of an error in that block cannot be determined based only on the test result of the test target block.

[0037] As mentioned above, the test of the quantum program is based on the average value of the projected measurement results. For example, if the quantum state of one quantum bit is expressed as φ=α|0>+β|1>, the projected measurement shows that the probability of observing |0> and |1> is |α| 2 and |β| 2 This corresponds to sampling from a Bernoulli distribution, where |0> and |1> are observed multiple times, and the average number of times that is observed is calculated.

[0038] This average value is |α| 2 or |β| 2 These are estimates of the probability of a quantum program being executed, so these values ​​are compared with the developer's assumptions. Since the estimate is derived from the average of the projective measurement results, the accuracy of the estimate depends on the number of projective measurements. In other words, the accuracy of the test results of a quantum program depends on the number of projective measurements.

[0039] For example, in the case of one quantum bit, if the number of projection measurements is N, then |β| 2 The estimation accuracy is expressed by the standard deviation σ in the following equation (5). [Formula 5] JPEG2025012271000006.jpg19170

[0040] The smaller the value of this estimation accuracy σ, the higher the accuracy. |β| 2 The relationship between N and σ is shown in the graph below, taking =0.5 as an example. The horizontal axis represents the value of N (0 to 60), and the vertical axis represents the value of σ (0 to 0.6). JPEG2025012271000007.jpg51170

[0041] Furthermore, from this graph, it can be seen that once the number of projection measurements exceeds about 20, the estimation accuracy does not improve significantly (the value of σ does not decrease significantly). This means that even with the same projection measurement, the information obtained differs depending on the number of projection measurements. For example, when the N=2 projection measurement is performed, the value of σ decreases by about 0.15 compared to the N=1 projection measurement. On the other hand, when the N=11 projection measurement is performed, the value of σ decreases by only about 0.0074 compared to the N=10 projection measurement. In this way, as the number of projection measurements increases, it becomes more difficult to improve the estimation accuracy. In other words, the effect of test execution (quantum program execution and projection measurement) changes depending on the cumulative number of projection measurements.

[0042] From the above, quantum program testing has the following characteristics: The computational cost of testing varies depending on the position of the block being tested. The test results for a test block alone cannot determine whether or not there is an error in that block. The accuracy of the test results depends on the number of projection measurements. The effectiveness of test execution varies depending on the cumulative number of projection measurements.

[0043] Due to these characteristics, a cost-effective testing procedure for quantum programs is not self-evident. Here, cost refers to the computational cost, and effectiveness refers to detecting errors and identifying their locations. In testing classical programs, if the number of steps in a block (subroutine) is the same, the cost of testing is the same, and the only object inspected is the block in question. Furthermore, the only information obtained by testing is whether or not there is an error in that block, and it does not depend on the status of past testing. Therefore, there is no difference in cost-effectiveness regardless of which block the test is started from.

[0044] On the other hand, in the case of quantum programs, the cost and effectiveness of testing depend on the block position and past test implementation status, so if test target blocks are selected arbitrarily, there is a possibility that a test with low cost-effectiveness will be performed. In particular, if a quantum program contains an error, the time until the error is detected will increase if a cost-ineffective test is performed.

[0045] Therefore, an object of the present invention is to provide a technique that can present a highly cost-effective test procedure in testing a quantum program. [Means for solving the problem]

[0046] The test support device of the present invention, which solves the above-mentioned problems, is characterized by having a memory unit that stores quantum software divided into blocks, and a calculation unit that obtains test results for each measurement position defined for the blocks by performing an evaluation test of a quantum state based on a predetermined measurement method, calculates a test effectiveness index value related to the possibility of identifying the presence or absence of an error in the block based on the test results and a test cost index value related to the amount of calculation required to execute the test, calculates a cost-effectiveness value for each measurement position from the test effectiveness index value and the test cost index value, and outputs information on valid measurement positions based on the cost-effectiveness value.

[0047] In addition, the test support method of the present invention is characterized in that an information processing device stores quantum software divided into blocks in a memory unit, obtains test results for each measurement position defined for the blocks by performing an evaluation test of a quantum state based on a predetermined measurement method, calculates a test effect index value related to the possibility of identifying the presence or absence of an error in the block and a test cost index value related to the amount of calculation required to execute the test based on the test results, calculates a cost-effectiveness value for each measurement position from the test effect index value and the test cost index value, and outputs information on valid measurement positions based on the cost-effectiveness value. Effect of the Invention

[0048] According to the present invention, it is possible to present a highly cost-effective test procedure for testing a quantum program. [Brief description of the drawings]

[0049] [Figure 1] FIG. 1 is a diagram illustrating an example of a quantum program. [Diagram 2] FIG. 13 is a diagram illustrating an example of division of a quantum program. [Diagram 3] 1 is a functional block diagram of a test support device according to an embodiment of the present invention; [Figure 4] 1 is a diagram showing an example of the relationship between blocks constituting a quantum program and measurement positions in this embodiment. FIG. [Diagram 5] FIG. 13 is a diagram illustrating an example of Bayesian updating of the Dirichlet distribution in the present embodiment. [Figure 6] 1A to 1C are diagrams illustrating examples of a prediction distribution (categorical distribution) and a concept of measurement result prediction in this embodiment. [Figure 7] 11 is a diagram showing an example of a concept of inter-block reflection of the degree of certainty of error in this embodiment. FIG. [Figure 8] 11A and 11B are diagrams illustrating an example of a concept of narrowing down erroneous blocks in the present embodiment; [Figure 9] FIG. 11 is a diagram illustrating an example of a calculation concept of an error narrowing down degree in the present embodiment. [Figure 10] FIG. 11 is a diagram showing a conceptual example of suggesting a next measurement position in this embodiment. [Figure 11] FIG. 2 is a diagram illustrating an example of a hardware configuration of a test support device according to the present embodiment. [Figure 12] FIG. 2 is a diagram showing an example of a flow of a test support method according to the present embodiment. [Figure 13] FIG. 13 is a diagram illustrating an example of Bayesian updating in the present embodiment. [Figure 14] FIG. 11 is a diagram illustrating an example of calculating the actual value of the Dirichlet distribution in this embodiment. [Figure 15] 11A and 11B are diagrams illustrating a specific example of an error narrowing down degree in the present embodiment. [Figure 16] FIG. 13 is a diagram showing an example of presentation of the next measurement result in this embodiment. [Figure 17] FIG. 13 is a diagram showing an example of a measurement result prediction in another embodiment. [Figure 18] FIG. 13 is a diagram illustrating a conceptual example of determining the confidence level of an error using KL-Divergence in another embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0050] <Functional configuration> Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings. Fig. 3 is a functional block diagram of a test support device 100 in this embodiment. The test support device 100 shown in Fig. 3 is a computer that can present a highly cost-effective test procedure in testing a quantum program.

[0051] In addition, as shown in FIG. 3, the test support apparatus 100 of this embodiment has, as functional units, a measurement execution unit 110, a test result calculation unit 111, a next measurement result prediction unit 112, an error identification index value calculation unit 113, a test cost index calculation unit 114, and a next measurement position suggestion unit 115.

[0052] Of these, the measurement execution unit 110 has the function of reading out the quantum program 1201 held in the quantum program holding unit 120, and inputting the values ​​(real values) that are actually input when combining blocks for each block (the entire quantum program divided in advance; see FIG. 4) that constitutes this quantum program 1201, thereby inspecting the presence or absence of errors and the location of errors. The measurement results here are stored in the measurement result holding unit 121.

[0053] In addition, the test result calculation unit 111 is a functional unit that performs a predetermined evaluation of the above-mentioned measurement results, and derives a statistical estimate based on the results of performing the above-mentioned measurements multiple times (projection measurement results), and evaluates whether the estimate is similar to the developer's expected value to a certain extent (including quantum state tomography, etc.).

[0054] More specifically, a categorical distribution is used as a random variable for each measurement position, i.e., each of the above-mentioned blocks, and a Dirichlet distribution is associated with it, which returns its probability density. This Dirichlet distribution is a function that accepts a categorical distribution representing a quantum state (the square of the magnitude of the amplitude) as input and returns the confidence that the quantum state is true. Therefore, if the expected value (specification value) of the quantum state is m, the area within the range of m±k in the above-mentioned Dirichlet distribution (the shaded area in Graph 1 below) represents the probability that the quantum state is within the range of m±k (k is a parameter).

[0055] [Graph 1] JPEG2025012271000008.jpg61170

[0056] Therefore, this probability is regarded as the "certainty of the absence of an error." The results of such evaluation are stored in the test result storage unit 123. Note that the test result calculation unit 111 also Bayesian updates the above-mentioned Dirichlet distribution and stores and updates it in the Dirichlet distribution storage unit 122 every time a measurement is performed by the measurement execution unit 110. The confidence of the absence of an error in the test result storage unit 123 is also updated (see FIG. 5).

[0057] In addition, the next measurement result prediction unit 112 is a functional unit that predicts the next S measurement results by calculating a predictive distribution (categorical distribution) based on the above-mentioned test result storage unit 123 and Dirichlet distribution storage unit 122, and predicts how the “degree of error narrowing down” will change due to the next S measurements from that result (see FIG. 6).

[0058] Moreover, the error identification index value calculation unit 113 is a functional unit that reflects the degree of certainty that there is no error for each of the above-mentioned measurement positions to the block corresponding to the measurement position and the block located in front of the block (see Figure 7), and calculates an error identification index value that indicates the degree to which errors have been identified from the test results based on the reflected degree of certainty that there is no error.

[0059] As shown in FIG. 8, the degree to which the error has been identified, i.e., the degree to which the error has been narrowed down, is considered to be in a "narrowed down" state when, for example, in a block located immediately adjacent to an untested block, the confidence level of the absence of an error is lower than a certain standard or is relatively lower than among blocks (e.g., confidence level 10), and the confidence levels of the absence of errors in each of the blocks located prior to that block are all higher than a certain standard or are relatively higher than among blocks.

[0060] On the other hand, the state of "errors not narrowed down" is, for example, when the confidence of the absence of an error in a given block is higher than a certain standard or relatively higher than other blocks (e.g. confidence 90), and the confidence of the absence of an error in any of the blocks located before that block is lower than a certain standard or relatively lower than other blocks. To give a more specific example, if the confidence of the absence of an error in each block is block 1: 90, block 2: 10, block 3: 90, block 4: 10, for example, blocks 1 and 2, which are inputs (indirectly and directly) to block 3, include block 2 with confidence 10, and it is unlikely that the confidence of block 3, whose input is the execution result of block 2, will be 90. This can be said to be a state in which it is suspected that either the test result of block 2 (confidence 10) or the test result of block 3 (confidence 90) is incorrect, and the error has not been narrowed down.

[0061] To summarize the state of each block that increases the degree of "narrowing down the errors" described above, as shown in Figure 9, among the blocks located before the "unexecuted" block in the test, the blocks immediately preceding the unexecuted block (blocks n+1 to m) should have a smaller number of blocks and a lower certainty, while block n located even further before that should have a lower certainty, and blocks 1 to n-1 located before block n should have a higher certainty.

[0062] A specific method for calculating the degree to which errors have been narrowed down (hereinafter, the degree of error narrowing down) will be described later.

[0063] The test cost index calculation unit 114 is a functional unit that counts the number of gates included in each block constituting the quantum program and identifies the result of the count as a test cost index. The value of the test cost index identified here is stored in the test cost index holding unit 126. For example, if the number of gates included in a certain block is 20, the test cost index of the block is "20".

[0064] Of course, the type of gate may also be taken into consideration. For example, for each type of gate included in a certain block, a weight value (e.g., a coefficient of 1 or more determined according to the load or time required during test execution) is multiplied by the number of gates of the corresponding type, and the results of the above multiplication for all types of gates included in the block are totaled to calculate the test cost index.

[0065] In addition, the next measurement position suggestion unit 115 is a functional unit that calculates the amount of calculation (test cost index) required for the next S measurements and the improvement in the degree of error narrowing down for each measurement position in each block based on the error identification index value and test cost index obtained up to this point, derives a cost-to-evaluation value, and adopts and suggests the measurement position with the highest cost-effectiveness in error narrowing down as the next measurement point (see Figure 10).

[0066] <Hardware configuration> The hardware configuration of the test support device 100 of this embodiment is as shown in Fig. 4. That is, the test support device 100 includes a storage unit 101, a memory 103, a calculation unit 104, and a communication unit 105.

[0067] Of these, the storage unit 101 is configured with an appropriate non-volatile storage element such as an SSD (Solid State Drive) or a hard disk drive.

[0068] The memory 103 is composed of a volatile storage element such as a RAM (Random Access Memory).

[0069] The calculation unit 104 is a CPU (Central Processing Unit) that reads out the program 102 held in the storage unit 101 into the memory 103 and executes it to generally control the device itself and also performs various types of judgment, calculation, and control processing.

[0070] By executing the program 102 by the calculation unit 104, each of the functional units, namely, the measurement execution unit 110, the test result calculation unit 111, the next measurement result prediction unit 112, the error identification index value calculation unit 113, the test cost index calculation unit 114, and the next measurement position suggestion unit 115, which are also explained in FIG. 3, are implemented.

[0071] The communication unit 105 is assumed to be a network interface card or chip set that is connected to an appropriate network such as a LAN (Local Area Network), a WAN (Wide Area Network), the Internet, or a mobile phone network, and handles communication processing with a terminal (not shown) of a developer, etc. Of course, if the test support device 100 of this embodiment is a stand-alone machine and is operated in a manner that does not require communication with external terminals, etc., the communication unit 105 is not necessary.

[0072] The test support device 100 may include an input unit that accepts key input or voice input from a user such as a developer. The test support device 100 may also include an output unit such as a display or a speaker that outputs the processing result of the calculation unit 104.

[0073] In addition to a program 102 for implementing the functions required for the test support device of this embodiment, the memory unit 101 stores the following data: a quantum program 1201, a measurement result 1211, a Dirichlet distribution 1221, a test result 1231, a prediction of the next measurement result 1241, an error identification index value 1251, and a test cost index 1261.

[0074] Of these, the quantum program holding unit 120 is a storage area that stores the quantum program to be tested during test support in this embodiment, and is implemented in the storage unit 101.

[0075] Moreover, the measurement result holding unit 121 is a storage area that stores the processing results by the measurement execution unit 110, and is implemented in the storage unit 101.

[0076] Moreover, the Dirichlet distribution storage unit 122 is a storage area that stores the processing results by the test result calculation unit 111, and is implemented in the storage unit 101.

[0077] Moreover, the test result holding unit 123 is a storage area that stores the processing results by the test result calculation unit 111, and is implemented in the storage unit 101.

[0078] Further, the next measurement result prediction holding unit 124 is a storage area that stores the processing results by the test result calculation unit 111, and is implemented in the storage unit 101.

[0079] The error identification index value holding unit 125 is a storage area that stores the processing results by the error identification index value calculation unit 113, and is implemented in the storage unit 101.

[0080] The test cost index holding unit 126 is a storage area that stores the processing results of the test cost index calculation unit 114, and is implemented in the storage unit 101.

[0081] The program 102 in this embodiment may be provided in various computer-readable recording media. Alternatively, the program 102 may be provided from an external system (such as a server device that distributes programs over a network). Alternatively, functions implemented by executing a program in such an external system may be provided via a network as each functional unit of the test support device 100 in this embodiment.

[0082] As already mentioned, the functional unit in this embodiment may assume a form in which hardware implemented by a specific electronic circuit cooperates with information processing implemented by the hardware. The above-mentioned electronic circuit is a circuit realized by combining a circuit, circuits, a processor, and a memory. In other words, it includes an application specific integrated circuit (ASIC), a programmable logic device (for example, a simple programmable logic device (SPLD), a complex programmable logic device (CPLD), and a field programmable gate array (FPGA)), etc.

[0083] Furthermore, the communication unit 105 is preferably a wired communication means such as USB, IEEE1394, Thunderbolt (registered trademark), wired LAN network communication, etc., but may also include wireless LAN network communication, mobile communication such as LTE / 3G / 4G / 5G, BLUETOOTH (registered trademark) communication, etc. as necessary. In other words, it is more preferable to implement it as a collection of these multiple communication means.

[0084] <Test support method> Next, the flow of the test support method of this embodiment will be described with reference to the drawings. Fig. 12 is a diagram showing an example of the flow of the test support method of this embodiment. In this case, the test support device 100 receives from a user such as a developer via an input device such as an external terminal an assumed value of a quantum state at a measurement position in a block constituting a quantum program to be tested (s10).

[0085] The above-mentioned assumed value M is a value (test oracle) assumed by the developer for the quantum state after executing each block. For example, if a test of block 3 is assumed, the developer determines and notifies the assumed value for the quantum state immediately after block 3.

[0086] In the case of a one-qubit system, the state of the qubit is It is written as JPEG2025012271000009.jpg8170. The probability that |0> is measured as a result of the measurement is |α| 2 , the probability of measuring |1>> is |β| 2 If the developer assumes that the quantum state immediately after block 3 is φ, then M = [m1, m2] = [|α| 2 ,|β| 2 ]. For example, [m1,m2]=[0.5,0.5].

[0087] On the other hand, if r is the result of a measurement, then, for example, If the quantum state of JPEG2025012271000010.jpg17170 is measured 10 times, the result will be r=[r1,r2]=[5,5] or r=[r1,r2]=[3,7]. Of course, since the results may show a similar pattern to the results of rolling a dice, the results may be biased if the number of trials (=measurements) is small.

[0088] The developer who defines this assumed value M defines the assumed value M of the squared amplitude of each basis for the quantum state at the measurement position as M = [m1, . . . , m i , , m I ] is defined and set in the form m1+···+m i +···m I =1.

[0089] For example, assuming two quantum bits, the configuration would be as follows. JPEG2025012271000011.jpg30170

[0090] The above-mentioned assumed value M has a categorical distribution as shown in Graph 2 below. [Graph 2] JPEG2025012271000012.jpg39170

[0091] Next, the test support apparatus 100 associates a Dirichlet distribution Dir(x|α) with each measurement position. The random variable x of the Dirichlet distribution is an I-dimensional vector representing a categorical distribution, and x=[x1, . . . , x i ,x I Therefore, we use the Dirichlet distribution as a function that accepts a categorical distribution x representing a quantum state (the square of the magnitude of the amplitude) as input and returns the confidence that the quantum state is true.

[0092] The probability density function of the Dirichlet distribution is shown in Equation 6 below. [Formula 6] JPEG2025012271000013.jpg15170

[0093] If the normalization term is omitted from the above equation 6, the following equation 7 is obtained. [Formula 7] JPEG2025012271000014.jpg15170

[0094] Here, the test support apparatus 100 determines the hyperparameter α (Equation 8) of the Dirichlet distribution Dir(x|α), which is the prior distribution, based on the expected value M and the developer's impression information θ. [Formula 8] JPEG2025012271000015.jpg8170

[0095] It is assumed that the developer has basically made an effort to implement the quantum program 1201 as expected (according to the specifications), and therefore α is created based on the expected value M. However, if the developer believes that there is a high possibility of an error being included, the developer will reduce θ. As a result, the probability density in the case of x=M becomes relatively small. In other words, reducing θ reduces the certainty that the quantum state x is the expected value M. Conversely, since it can be determined that there is a low possibility of an error in a block constructed from (a combination of) existing libraries, θ will be increased.

[0096] In addition, when developers set the above-mentioned assumed value M (I-dimensional vector), if the target quantum program 1201 is large-scale, I becomes a huge number. In that case, [m1, ,m i ,···,m I It is difficult to define all of [ ] as direct values. Therefore, in this embodiment, the definition of the expected value M using a wildcard or set notation is accepted.

[0097] Among such definitions, an example of a definition using set notation is shown in the following formula 9. [Formula 9] JPEG2025012271000016.jpg18170

[0098] An example of a definition using a wildcard is also shown in Expression 10 below. [Formula 10] JPEG2025012271000017.jpg9170

[0099] Next, the test support device 100 performs 1 to N measurements on the block and obtains the results (s11). As already described, the results of such measurements are expressed as R=[r1, . . . , r i , ,r I ]. i is the number of times that rule |i-1> is observed. Therefore, r1+···+r i +···r I The relationship =N holds.

[0100] Next, the test support device 100 performs Bayesian updating using the measurement result R up to this point (s12). In this case, the test support device 100 performs Bayesian updating of the Dirichlet distribution Dir(x|α) using the measurement result R. Since the likelihood P(D|x) is a multinomial distribution, when the prior distribution Dir(x|α) is a Dirichlet distribution, the posterior distribution Dir(x|D) is also a Dirichlet distribution (Equation 11). [Formula 11] JPEG2025012271000018.jpg29170

[0101] For simplicity, if the marginal likelihood, which is a regularization term, is omitted, the above-mentioned Equation 11 becomes the following Equation 12. [Formula 12] JPEG2025012271000019.jpg8170

[0102] Here, the test support apparatus 100 first obtains a prior distribution Dir(x|α). The prior distribution Dir(x|α) is obtained as the following Equation 13 from the probability density function of the Dirichlet distribution and the hyperparameters (already shown in Equation 8). [Formula 13] JPEG2025012271000020.jpg13170

[0103] For example, in the case of one quantum bit, it takes the form of Equation 14 below. [Formula 14] JPEG2025012271000021.jpg8170

[0104] If this prior distribution were to be plotted, it would look like Graph 3 below. [Graph 3] JPEG2025012271000022.jpg33170

[0105] Next, the test support device 100 calculates the likelihood P(D|x) (s13). Since this is a multinomial distribution, its probability mass function is the probability of the measurement result R=[r1, ..., r i ,…,r I ], it can be expressed in the form of the following Equation 15. [Formula 15] JPEG2025012271000023.jpg16170

[0106] This gives the probability of obtaining a measurement result R when the squared magnitude of the amplitude matches the categorical distribution x. From the above, the posterior distribution Dir(x|D) after N measurements can be calculated using the following Equation 16. [Formula 16] JPEG2025012271000024.jpg16170

[0107] The posterior distribution Dir(x|D) is a Dirichlet distribution, and when an I-dimensional vector x (categorical distribution) that represents the squared magnitude of the amplitude of the quantum state is given, it returns its probability density. In other words, like the prior distribution Dir(x|α), the posterior distribution Dir(x|D) also accepts as input a categorical distribution that represents the quantum state (the squared magnitude of the amplitude), and returns the confidence that the distribution is the true distribution.

[0108] Next, the test support device 100 calculates the confidence that there is no error (s14). It is assumed that the Dirichlet distribution Dir(x|D), which is a posterior distribution updated based on the results of N measurements, gives the probability density for an I-dimensional vector representing the square of the amplitude of the quantum state.

[0109] In this Dirichlet distribution Dir(x|D), the assumed value m i If the probability density around is large, the assumed value m i In other words, the area within the range of m±k in the Dirichlet distribution represents the probability that the quantum state is within the range of m±k (k is a parameter).

[0110] From the above, the following Conf (Equation 17) is set as the confidence that there is no error. [Formula 17] JPEG2025012271000025.jpg22170 Note, x I =1-(x1+x2+···+x I-1) based on x appearing in Dir(x|D) I Let x1, x2, …, x I-1 has been replaced with.

[0111] Next, the test support apparatus 100 performs a Bayesian update in the same manner (s15) using the Dirichlet distribution Dir(x|D) created based on the N+1 to S measurement results R as the prior distribution. Note that an example of calculation of the Dirichlet distribution using real values ​​is illustrated in FIG.

[0112] However, if the number of quantum bits in the quantum program 1021 is huge, I also becomes huge, making it difficult to calculate Conf (Equation 17). In that case, the measurement result R=[r1, ..., r i ,…r I ], r i Only i > 0 is considered. In other words, R pos = [r1,…,r j ,…,r I ] (r j >0) and adopt the following [Equation 18]. [Formula 18] JPEG2025012271000026.jpg17170

[0113] In subsequent measurements (N+1 to S), if a basis |j-1> that has not been observed in the N measurements is observed, R pos Since the dimension of increases, the Bayesian update in Equation 19 below cannot be performed. [Formula 19] JPEG2025012271000027.jpg16170

[0114] In this case, the test support apparatus 100 does not perform Bayesian updating, but uses the following equation 20 to perform calculation as shown in the following equation 21. [Formula 20] JPEG2025012271000028.jpg6170[Formula 21] JPEG2025012271000029.jpg18170

[0115] Since the measurements can be performed only a number of times that can be handled by a classical computer, r i >0 can be kept to a number that can be handled by a classical computer. Or, the assumed value M = [m1, ..., m i ,…,m I ], m i A similar method may be applied to only i > 0.

[0116] Next, the test support device 100 executes calculation of the degree of error narrowing down (s16). In this case, the method of calculating the degree of error narrowing down of block n can adopt the following procedure, for example: 1) set the minimum value of the confidence from block 1 to block n-1 as a, and when n=1, set a=100, 2) set the confidence of block n as b, 3) calculate the total confidence from block n+1 to unexecuted blocks as c, and 4) calculate the degree of error narrowing down of block n=abc. The test support device 100 sets the largest value of the degree of error narrowing down of each block thus calculated as the degree of error narrowing down of the test result (see FIG. 15).

[0117] Next, the test support device 100 derives a predictive distribution from the Dirichlet distribution (s17). Here, the predictive distribution created from the Dirichlet distribution is a categorical distribution, and an I-dimensional vector representing this categorical distribution is expressed by the following formula 22. [Formula 22] JPEG2025012271000030.jpg10170

[0118] In addition, the hyperparameter α i (Equation 8) and the measurement result R(R = [r1, r i , r I ]) to determine the number of times each base was measured in N measurements. i Execute equation 23 to add: [Formula 23] JPEG2025012271000031.jpg9170

[0119] Using the results of this calculation in Equation 23, the predictive distribution can be calculated using Equation 24 below. [Formula 24] JPEG2025012271000032.jpg18170

[0120] Thereafter, the test support device 100 predicts the measurement results for the next S times based on the above-mentioned predictive distribution (categorical distribution), and based on that, predicts changes (improvement predictions) in the "degree of error narrowing" (by the next S times of measurements), and outputs information on the measurement position with the best cost-effectiveness in narrowing down errors (FIGS. 10 and 16) by comparing it with the computational cost related to the measurements (s18).

[0121] At this time, as shown in FIG. 16, the test support device 100 indicates the measurement position 3 by adopting a form in which the degree of certainty that there are no errors in each block is expressed by differences in background color and its darkness, and by drawing a box (a rectangular frame formed by a thick black line) that surrounds the entire block in front of the measurement position 3, and also visualizes the cost of executing the test (type and number of gates).

[0122] <Other Examples: How to Calculate the Confidence of No Error> As a method for calculating the degree of certainty that there is no error, in addition to the above-mentioned embodiment, a method for obtaining the distribution of the maximum likelihood estimator can also be adopted.

[0123] JPEG2025012271000033.jpg21170

[0124] In this case, the estimated value ei of the square of the amplitude of the basis |i-1> is expressed by the following Equation 25 using the number of measurements N. [Formula 25] JPEG2025012271000034.jpg13170

[0125] In addition, the expectation and variance of ei can be expressed by the following Equations 26 and 27, respectively. [Formula 26] JPEG2025012271000035.jpg13170[Formula 27] JPEG2025012271000036.jpg12170

[0126] Let μ be the true value of the square of the amplitude of |i-1> (the value produced by the implemented program). i Then, the distribution of x(i,j) has a mean value μ i , variance μ i (1-μ i) This is the Bernoulli distribution.

[0127] Therefore, the estimator e i The expectation and variance of are shown in Equations 28 and 29, respectively. [Formula 28] JPEG2025012271000037.jpg13170[Formula 29] JPEG2025012271000038.jpg20170

[0128] Also, the estimator e i Since is the average value of N samples from the Bernoulli distribution mentioned above, the central limit theorem states that when N is sufficiently large, the distribution can be approximated to a normal distribution. Here, we are considering cases where N is not sufficiently large, but the estimator e i We approximate the distribution of e to a normal distribution. i shall comply with the following Equation 30. [Formula 30] JPEG2025012271000039.jpg15170

[0129] The quantum state (squared amplitude) estimate e, which is estimated by maximum likelihood estimation from the N measurements, is i For the estimator e i The average μ i = population mean (mean of Bernoulli distribution) μ i Therefore, the estimator e i is an invariant estimator.

[0130] If the null hypothesis of the Z-test is that the quantum program has no errors, then the unbiased estimator e i The average μ i(= the mean of the Bernoulli distribution, which is the parent distribution) is the assumed value m i Therefore, the estimator e i The (approximate) distribution of is the following normal distribution formula 31. This estimator e i The normal distribution of is shown in Graph 4. [Formula 31] JPEG2025012271000040.jpg14170[Graph 4] JPEG2025012271000041.jpg59170

[0131] JPEG2025012271000042.jpg19170[Formula 32] JPEG2025012271000043.jpg23170

[0132] Therefore, the test support device 100 calculates z i Extract the corresponding p-value and identify that value as the "certainty that there is no error."

[0133] Another approach to predicting the next S measurement results is shown in FIG. 17. Here, the measurement result R is defined as R=[r1, , r i , r I ] and r i is the number of times the basis |i-1> is observed, and r1+···+r i ,+···+r I =N. In this case, the categorical distribution shown in the middle part of FIG. 17 is obtained, and as a result, the predicted measurement results for the next S times are as shown in the lower part of FIG.

[0134] As another method for calculating the confidence that there is no error, the Dirichlet distribution and Bayesian estimation are used as in the embodiment already described, but a calculation method based on KL-Divergence instead of integrating around m can also be adopted. This method derives the "confidence that there is an error" by comparing the Dirichlet distribution with the Kullback-Leibler divergence.

[0135] In this case, the test support device 100 creates a Dirichlet distribution Dir for each measurement position in the same manner as described above, and performs Bayesian updating every time a measurement is made. This Dirichlet distribution Dir is a function that receives as input a categorical distribution x representing a quantum state (the square of the magnitude of the amplitude) and returns the degree of confidence that the quantum state is true.

[0136] In addition to the Dirichlet distribution, we will now consider the Dirichlet distribution Dir spec Create (Equation 33, Equation 34). [Formula 33] JPEG2025012271000044.jpg8170[Formula 34] JPEG2025012271000045.jpg14170

[0137] The test support device 100 compares the Dirichlet distribution Dir created for each measurement position with the Dirichlet distribution Dir spec These are compared and evaluated using KL-Divergence (Figure 18), and the resulting value is taken as the "certainty that an error exists." Note that because the value of KL-Divergence is the "certainty that an error exists," certain changes are required in the calculation of the certainty that there is no error and the degree of error narrowing down, but this can be easily inferred and so an explanation is omitted here.

[0138] Although the best mode for carrying out the present invention has been specifically described above, the present invention is not limited to this, and various modifications can be made without departing from the spirit and scope of the present invention.

[0139] According to this embodiment, it is possible to present a highly cost-effective test procedure for testing a quantum program.

[0140] The description in this specification makes at least the following clear: That is, in the test support device of this embodiment, the calculation unit may determine the test cost index value based on at least one of the number and the type of quantum operators constituting each of a block corresponding to the measurement position and a block located in front of the block. This makes it possible to specify the test cost index value with high accuracy based on the specific configuration of the block.

[0141] Furthermore, in the test support device of this embodiment, the calculation unit may calculate, as the test result, a degree of certainty that there is no error for each measurement position, reflect the degree of certainty that there is no error in the block corresponding to the measurement position and the block located in front of that block, calculate an error identification index value indicating the degree to which an error has been identified from the test result based on the reflected degree of certainty, and treat the error identification index value as the test effect index value. This makes it possible to specify a test effect index value, which is an error identification index value, in a form that appropriately takes into account the influence of the absence of errors, that is, the propagation, associated with the input / output relationships between blocks in a quantum program.

[0142] In addition, in the test support device of this embodiment, the calculation unit may receive an assumed value of the quantum state at the measurement position from a user, and calculate a degree of confidence that there is no error based on the assumed value, the measurement result at the measurement position using the measurement method, and information related to the estimated value of the quantum state calculated from the measurement result. This makes it possible to calculate the degree of confidence that there is no error, based on the specifications, i.e., assumed values, set by the user for the quantum program.

[0143] Furthermore, in the test support device of this embodiment, the calculation unit may receive from a user an error probability index value indicating the possibility that an error has been embedded for each measurement position, calculate an initial value of a certainty that there is no error based on the error probability index value, and obtain the certainty that there is no error by updating the initial value based on the measurement result. This makes it possible to deal with situations other than those in which the developer is confident that the quantum program has been implemented as expected (according to the specifications), for example, the existence of a block that the developer believes to be highly likely to contain an error, and to process the block based on the low degree of confidence mentioned above (low confidence that the quantum state is the expected value).

[0144] Furthermore, in the test support device of this embodiment, the calculation unit may predict a next measurement result, which is the measurement result in the next test, for each measurement position based on the measurement result, predict a confidence level that the result of the next test will be free of errors based on the next measurement result, predict an error identification index value for the next test based on the predicted confidence level that there is no error, and treat the predicted error identification index value as the test effect index value. This makes it possible to efficiently determine the possibility that the implementation is as expected by using a probability density based on a Dirichlet distribution or the like obtained by performing measurements multiple times.

[0145] In the test support device of this embodiment, the calculation unit may provide an expected value editing function that defines the expected value in accordance with a notation including a wildcard that represents an arbitrary character string. This makes it possible to deal with situations in which, in the case of large-scale quantum programs, the number of assumed values ​​becomes enormous, making it difficult for developers and others to define them.

[0146] In addition, in the test support device of this embodiment, in order to execute the evaluation test at the measurement position, the calculation unit may create program code from the quantum software representing quantum operators that constitute each of the block corresponding to the measurement position and the block located in front of the block, and provide an interface that can be called from a test driver that executes the evaluation test. This enables test execution targets to be efficiently extracted from the quantum program, making it possible to appropriately improve test efficiency.

[0147] Furthermore, in the test support device of this embodiment, the calculation unit may indicate the valid measurement position by a rectangle that surrounds the block corresponding to the measurement position and all blocks located in front of the block, and change the display color of the block or the intensity of the display color based on the degree of certainty that there is no error calculated for each block. This makes it possible to present developers with visually clear information about each event, such as the degree of confidence that each block is error-free and the cost of running the test. [Explanation of symbols]

[0148] 100 Test Support Equipment 101 Storage section 102 Programs 103 Memory 104 Arithmetic section 105 Communications Department 110 Measurement Execution Unit 111 Test Result Calculation Unit 112 Next measurement result prediction section 113 Error identification index value calculation unit 114 Test Cost Index Calculation Unit 115 Next measurement location suggestion section 120 Quantum Program Storage Unit 121 Measurement result holding section 122 Dirichlet distribution storage unit 123 Test result storage unit 124 Next measurement result prediction storage unit 125 Error identification index value storage unit 126 Test Cost Index Storage Unit

Claims

1. A memory unit for storing quantum software divided into blocks; a calculation unit that obtains test results for each measurement position defined for the block by performing an evaluation test of a quantum state based on a predetermined measurement method, calculates a test effect index value related to the possibility of identifying the presence or absence of an error in the block based on the test results, and a test cost index value related to the amount of calculation required for test execution, calculates a cost-effectiveness value for each measurement position from the test effect index value and the test cost index value, and outputs information on valid measurement positions based on the cost-effectiveness value; A test support device having the above configuration.

2. The calculation unit is determining the test cost index value based on at least one of the number and the type of quantum operators constituting each of a block corresponding to the measurement position and a block located in front of the block; 2. The test support device according to claim 1.

3. The calculation unit is as the test result, a degree of certainty that there is no error is calculated for each of the measurement positions, the degree of certainty that there is no error is reflected in the block corresponding to the measurement position and in the block located in front of the block, and an error identification index value that indicates the degree to which an error has been identified from the test result is calculated based on the degree of certainty that has been reflected, and the error identification index value is treated as the test effect index value.

3. The test support device according to claim 2.

4. The calculation unit is receiving an assumed value of the quantum state at the measurement position from a user, and calculating a confidence level that the error is absent based on the assumed value, a measurement result at the measurement position by the measurement method, and information related to an estimated value of the quantum state calculated from the measurement result; 4. The test support device according to claim 3.

5. The calculation unit is receiving an error probability index value representing a possibility that an error has been embedded for each of the measurement positions from a user, calculating an initial value of a certainty that the error is absent based on the error probability index value, and updating the initial value based on the measurement result, thereby obtaining the certainty that the error is absent.

5. The test support device according to claim 4.

6. The calculation unit is predicting a next measurement result, which is a measurement result in a next test, for each of the measurement positions based on the measurement results; predicting a confidence level of the result of the next test, which is the absence of an error, based on the next measurement results; predicting an error identification index value for the next test based on the predicted confidence level of the absence of an error; and treating the predicted error identification index value as the test effect index value.

6. The test support device according to claim 5.

7. The calculation unit is As a method for defining the expected value, a function for editing the expected value is provided according to a notation including a wildcard that represents an arbitrary character string.

5. The test support device according to claim 4.

8. The calculation unit is In order to execute the evaluation test at the measurement position, a program code expressing quantum operators constituting a block corresponding to the measurement position and a block located in front of the block is created from the quantum software, and an interface that can be called from a test driver that executes the evaluation test is provided.

2. The test support device according to claim 1.

9. The calculation unit is suggesting the valid measurement position by using a rectangle that surrounds the block corresponding to the measurement position and all blocks located in front of the block, and changing the display color or the density of the display color of the block based on the degree of certainty that there is no error calculated for each block; 2. The test support device according to claim 1.

10. An information processing device, A memory unit stores quantum software divided into blocks; a test result is obtained for each measurement position defined for the block by performing an evaluation test of a quantum state based on a predetermined measurement method, a test effect index value relating to the possibility of identifying the presence or absence of an error in the block and a test cost index value relating to the amount of calculation required for test execution are calculated based on the test result, a cost-effectiveness value is calculated for each measurement position from the test effect index value and the test cost index value, and information on valid measurement positions is output based on the cost-effectiveness value; A test support method comprising:

Citation Information

Patent Citations

  • Program, method, information processing device, and system

    JP6890795B1