File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ """
2
+ \********************************************************************************
3
+ * Copyright (c) 2023 the Qrisp authors
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the Eclipse Public License 2.0 which is available at
7
+ * http://www.eclipse.org/legal/epl-2.0.
8
+ *
9
+ * This Source Code may also be made available under the following Secondary
10
+ * Licenses when the conditions for such availability set forth in the Eclipse
11
+ * Public License, v. 2.0 are satisfied: GNU General Public License, version 2
12
+ * with the GNU Classpath Exception which is
13
+ * available at https://www.gnu.org/software/classpath/license.html.
14
+ *
15
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ ********************************************************************************/
17
+ """
18
+
19
+ from qrisp import QuantumFloat , measure
20
+ from qrisp .jasp import boolean_simulation , jrange
21
+
22
+ def test_boolean_simulation ():
23
+
24
+ @boolean_simulation
25
+ def main (i , j ):
26
+
27
+ a = QuantumFloat (10 )
28
+
29
+ b = QuantumFloat (10 )
30
+
31
+ a [:] = i
32
+ b [:] = j
33
+
34
+ c = QuantumFloat (30 )
35
+
36
+ for i in jrange (150 ):
37
+ c += a * b
38
+
39
+ return measure (c )
40
+
41
+ for i in range (5 ):
42
+ for j in range (5 ):
43
+ assert main (i , j ) == 150 * i * j
You can’t perform that action at this time.
0 commit comments