diff --git a/.gitignore b/.gitignore index d131395fe509..3c88ffd7c610 100644 --- a/.gitignore +++ b/.gitignore @@ -98,6 +98,7 @@ celerybeat-schedule .env # virtualenv +.asv/ .venv venv/ ENV/ diff --git a/asv.conf.json b/asv.conf.json new file mode 100644 index 000000000000..70e736e26f75 --- /dev/null +++ b/asv.conf.json @@ -0,0 +1,25 @@ +{ + "version": 1, + "project": "qiskit", + "project_url": "https://qiskit.org", + "repo": ".", + "install_command": [ + "in-dir={env_dir} python -mpip install {wheel_file}[all] python-constraint qiskit-experiments==0.3.0" + ], + "uninstall_command": [ + "return-code=any python -mpip uninstall -y {project}" + ], + "build_command": [ + "pip install -U setuptools-rust", + "python setup.py build_rust --release", + "PIP_NO_BUILD_ISOLATION=false python -mpip wheel --no-deps --no-index -w {build_cache_dir} {build_dir}" + ], + "branches": ["main"], + "dvcs": "git", + "environment_type": "virtualenv", + "show_commit_url": "http://github.com/Qiskit/qiskit-terra/commit/", + "pythons": ["3.8", "3.9", "3.10", "3.11"], + "benchmark_dir": "test/benchmarks", + "env_dir": ".asv/env", + "results_dir": ".asv/results" +} diff --git a/test/benchmarks/__init__.py b/test/benchmarks/__init__.py new file mode 100644 index 000000000000..c7325a848299 --- /dev/null +++ b/test/benchmarks/__init__.py @@ -0,0 +1,11 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. diff --git a/test/benchmarks/assembler.py b/test/benchmarks/assembler.py new file mode 100644 index 000000000000..3899c05e92bb --- /dev/null +++ b/test/benchmarks/assembler.py @@ -0,0 +1,49 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=no-member,invalid-name,missing-docstring,no-name-in-module +# pylint: disable=attribute-defined-outside-init,unsubscriptable-object + +from qiskit.compiler import assemble +from qiskit.assembler import disassemble + +from .utils import random_circuit + + +class AssemblerBenchmarks: + params = ([8], [4096], [1, 100]) + param_names = ["n_qubits", "depth", "number of circuits"] + timeout = 600 + version = 2 + + def setup(self, n_qubits, depth, number_of_circuits): + seed = 42 + self.circuit = random_circuit(n_qubits, depth, measure=True, conditional=True, seed=seed) + self.circuits = [self.circuit] * number_of_circuits + + def time_assemble_circuit(self, _, __, ___): + assemble(self.circuits) + + +class DisassemblerBenchmarks: + params = ([8], [4096], [1, 100]) + param_names = ["n_qubits", "depth", "number of circuits"] + timeout = 600 + + def setup(self, n_qubits, depth, number_of_circuits): + seed = 424242 + self.circuit = random_circuit(n_qubits, depth, measure=True, conditional=True, seed=seed) + self.circuits = [self.circuit] * number_of_circuits + self.qobj = assemble(self.circuits) + + def time_disassemble_circuit(self, _, __, ___): + disassemble(self.qobj) diff --git a/test/benchmarks/circuit_construction.py b/test/benchmarks/circuit_construction.py new file mode 100644 index 000000000000..6e984823dff0 --- /dev/null +++ b/test/benchmarks/circuit_construction.py @@ -0,0 +1,96 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=missing-docstring,invalid-name,no-member +# pylint: disable=attribute-defined-outside-init + +import itertools + +from qiskit import QuantumRegister, QuantumCircuit +from qiskit.circuit import Parameter + + +def build_circuit(width, gates): + qr = QuantumRegister(width) + qc = QuantumCircuit(qr) + + while len(qc) < gates: + for k in range(width): + qc.h(qr[k]) + for k in range(width - 1): + qc.cx(qr[k], qr[k + 1]) + + return qc + + +class CircuitConstructionBench: + params = ([1, 2, 5, 8, 14, 20], [8, 128, 2048, 8192, 32768, 131072]) + param_names = ["width", "gates"] + timeout = 600 + + def setup(self, width, gates): + self.empty_circuit = build_circuit(width, 0) + self.sample_circuit = build_circuit(width, gates) + + def time_circuit_construction(self, width, gates): + build_circuit(width, gates) + + def time_circuit_extend(self, _, __): + self.empty_circuit.extend(self.sample_circuit) + + def time_circuit_copy(self, _, __): + self.sample_circuit.copy() + + +def build_parameterized_circuit(width, gates, param_count): + params = [Parameter("param-%s" % x) for x in range(param_count)] + param_iter = itertools.cycle(params) + + qr = QuantumRegister(width) + qc = QuantumCircuit(qr) + + while len(qc) < gates: + for k in range(width): + param = next(param_iter) + qc.u2(0, param, qr[k]) + for k in range(width - 1): + param = next(param_iter) + qc.crx(param, qr[k], qr[k + 1]) + + return qc, params + + +class ParameterizedCircuitConstructionBench: + params = ([20], [8, 128, 2048, 8192, 32768, 131072], [8, 128, 2048, 8192, 32768, 131072]) + param_names = ["width", "gates", "number of params"] + timeout = 600 + + def setup(self, _, gates, params): + if params > gates: + raise NotImplementedError + + def time_build_parameterized_circuit(self, width, gates, params): + build_parameterized_circuit(width, gates, params) + + +class ParameterizedCircuitBindBench: + params = ([20], [8, 128, 2048, 8192, 32768, 131072], [8, 128, 2048, 8192, 32768, 131072]) + param_names = ["width", "gates", "number of params"] + timeout = 600 + + def setup(self, width, gates, params): + if params > gates: + raise NotImplementedError + self.circuit, self.params = build_parameterized_circuit(width, gates, params) + + def time_bind_params(self, _, __, ___): + self.circuit.bind_parameters({x: 3.14 for x in self.params}) diff --git a/test/benchmarks/converters.py b/test/benchmarks/converters.py new file mode 100644 index 000000000000..041e40dd6de1 --- /dev/null +++ b/test/benchmarks/converters.py @@ -0,0 +1,53 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=no-member,invalid-name,missing-docstring,no-name-in-module +# pylint: disable=attribute-defined-outside-init,unsubscriptable-object + +from qiskit import converters +from qiskit import qasm + +from .utils import random_circuit + + +class ConverterBenchmarks: + params = ([1, 2, 5, 8, 14, 20, 32, 53], [8, 128, 2048, 8192]) + param_names = ["n_qubits", "depth"] + timeout = 600 + + def setup(self, n_qubits, depth): + seed = 42 + # NOTE: Remove the benchmarks larger than 20x2048 and 14x8192, this is + # a tradeoff for speed of benchmarking, creating circuits this size + # takes more time than is worth it for benchmarks that take a couple + # seconds + if n_qubits >= 20: + if depth >= 2048: + raise NotImplementedError + elif n_qubits == 14: + if depth > 2048: + raise NotImplementedError + self.qc = random_circuit(n_qubits, depth, measure=True, conditional=True, seed=seed) + self.dag = converters.circuit_to_dag(self.qc) + self.qasm = qasm.Qasm(data=self.qc.qasm()).parse() + + def time_circuit_to_dag(self, *_): + converters.circuit_to_dag(self.qc) + + def time_circuit_to_instruction(self, *_): + converters.circuit_to_instruction(self.qc) + + def time_dag_to_circuit(self, *_): + converters.dag_to_circuit(self.dag) + + def time_ast_to_circuit(self, *_): + converters.ast_to_dag(self.qasm) diff --git a/test/benchmarks/import.py b/test/benchmarks/import.py new file mode 100644 index 000000000000..fcfb382919cb --- /dev/null +++ b/test/benchmarks/import.py @@ -0,0 +1,24 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=no-member,invalid-name,missing-docstring,no-name-in-module +# pylint: disable=attribute-defined-outside-init,unsubscriptable-object + +"""Module for estimating import times.""" + +from sys import executable +from subprocess import call + + +class QiskitImport: + def time_qiskit_import(self): + call((executable, "-c", "import qiskit")) diff --git a/test/benchmarks/isometry.py b/test/benchmarks/isometry.py new file mode 100644 index 000000000000..e4e696beba43 --- /dev/null +++ b/test/benchmarks/isometry.py @@ -0,0 +1,66 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=missing-docstring,invalid-name,no-member +# pylint: disable=attribute-defined-outside-init +# pylint: disable=unused-argument + +from qiskit import QuantumRegister, QuantumCircuit +from qiskit.compiler import transpile +from qiskit.quantum_info.random import random_unitary + + +class IsometryTranspileBench: + params = ([0, 1, 2, 3], [3, 4, 5, 6]) + param_names = ["number of input qubits", "number of output qubits"] + + def setup(self, m, n): + q = QuantumRegister(n) + qc = QuantumCircuit(q) + if not hasattr(qc, "iso"): + raise NotImplementedError + iso = random_unitary(2**n, seed=0).data[:, 0 : 2**m] + if len(iso.shape) == 1: + iso = iso.reshape((len(iso), 1)) + qc.iso(iso, q[:m], q[m:]) + self.circuit = qc + + def track_cnot_counts_after_mapping_to_ibmq_16_melbourne(self, *unused): + coupling = [ + [1, 0], + [1, 2], + [2, 3], + [4, 3], + [4, 10], + [5, 4], + [5, 6], + [5, 9], + [6, 8], + [7, 8], + [9, 8], + [9, 10], + [11, 3], + [11, 10], + [11, 12], + [12, 2], + [13, 1], + [13, 12], + ] + circuit = transpile( + self.circuit, + basis_gates=["u1", "u3", "u2", "cx"], + coupling_map=coupling, + seed_transpiler=0, + ) + counts = circuit.count_ops() + cnot_count = counts.get("cx", 0) + return cnot_count diff --git a/test/benchmarks/mapping_passes.py b/test/benchmarks/mapping_passes.py new file mode 100644 index 000000000000..fb6ca35316aa --- /dev/null +++ b/test/benchmarks/mapping_passes.py @@ -0,0 +1,251 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=no-member,invalid-name,missing-docstring,no-name-in-module +# pylint: disable=attribute-defined-outside-init,unsubscriptable-object +# pylint: disable=unused-wildcard-import,wildcard-import,undefined-variable + +from qiskit.transpiler import CouplingMap +from qiskit.transpiler.passes import * +from qiskit.converters import circuit_to_dag +from qiskit.providers.fake_provider import FakeSingapore + +from .utils import random_circuit + + +class PassBenchmarks: + + params = ([5, 14, 20], [1024]) + + param_names = ["n_qubits", "depth"] + timeout = 300 + + def setup(self, n_qubits, depth): + seed = 42 + self.circuit = random_circuit( + n_qubits, depth, measure=True, conditional=True, reset=True, seed=seed, max_operands=2 + ) + self.fresh_dag = circuit_to_dag(self.circuit) + self.basis_gates = ["u1", "u2", "u3", "cx", "iid"] + self.cmap = [ + [0, 1], + [1, 0], + [1, 2], + [1, 6], + [2, 1], + [2, 3], + [3, 2], + [3, 4], + [3, 8], + [4, 3], + [5, 6], + [5, 10], + [6, 1], + [6, 5], + [6, 7], + [7, 6], + [7, 8], + [7, 12], + [8, 3], + [8, 7], + [8, 9], + [9, 8], + [9, 14], + [10, 5], + [10, 11], + [11, 10], + [11, 12], + [11, 16], + [12, 7], + [12, 11], + [12, 13], + [13, 12], + [13, 14], + [13, 18], + [14, 9], + [14, 13], + [15, 16], + [16, 11], + [16, 15], + [16, 17], + [17, 16], + [17, 18], + [18, 13], + [18, 17], + [18, 19], + [19, 18], + ] + self.coupling_map = CouplingMap(self.cmap) + + layout_pass = DenseLayout(self.coupling_map) + layout_pass.run(self.fresh_dag) + self.layout = layout_pass.property_set["layout"] + full_ancilla_pass = FullAncillaAllocation(self.coupling_map) + full_ancilla_pass.property_set["layout"] = self.layout + self.full_ancilla_dag = full_ancilla_pass.run(self.fresh_dag) + enlarge_pass = EnlargeWithAncilla() + enlarge_pass.property_set["layout"] = self.layout + self.enlarge_dag = enlarge_pass.run(self.full_ancilla_dag) + apply_pass = ApplyLayout() + apply_pass.property_set["layout"] = self.layout + self.dag = apply_pass.run(self.enlarge_dag) + self.backend_props = FakeSingapore().properties() + + def time_stochastic_swap(self, _, __): + swap = StochasticSwap(self.coupling_map, seed=42) + swap.property_set["layout"] = self.layout + swap.run(self.dag) + + def time_sabre_swap(self, _, __): + swap = SabreSwap(self.coupling_map, seed=42) + swap.property_set["layout"] = self.layout + swap.run(self.dag) + + def time_basic_swap(self, _, __): + swap = BasicSwap(self.coupling_map) + swap.property_set["layout"] = self.layout + swap.run(self.dag) + + def time_csp_layout(self, _, __): + CSPLayout(self.coupling_map, seed=42).run(self.fresh_dag) + + def time_dense_layout(self, _, __): + DenseLayout(self.coupling_map).run(self.fresh_dag) + + def time_layout_2q_distance(self, _, __): + layout = Layout2qDistance(self.coupling_map) + layout.property_set["layout"] = self.layout + layout.run(self.dag) + + def time_apply_layout(self, _, __): + layout = ApplyLayout() + layout.property_set["layout"] = self.layout + layout.run(self.dag) + + def time_full_ancilla_allocation(self, _, __): + ancilla = FullAncillaAllocation(self.coupling_map) + ancilla.property_set["layout"] = self.layout + ancilla.run(self.fresh_dag) + + def time_enlarge_with_ancilla(self, _, __): + ancilla = EnlargeWithAncilla() + ancilla.property_set["layout"] = self.layout + ancilla.run(self.full_ancilla_dag) + + def time_check_map(self, _, __): + CheckMap(self.coupling_map).run(self.dag) + + def time_trivial_layout(self, _, __): + TrivialLayout(self.coupling_map).run(self.fresh_dag) + + def time_set_layout(self, _, __): + SetLayout(self.layout).run(self.fresh_dag) + + def time_noise_adaptive_layout(self, _, __): + NoiseAdaptiveLayout(self.backend_props).run(self.fresh_dag) + + def time_sabre_layout(self, _, __): + SabreLayout(self.coupling_map, seed=42).run(self.fresh_dag) + + +class RoutedPassBenchmarks: + params = ([5, 14, 20], [1024]) + + param_names = ["n_qubits", "depth"] + timeout = 300 + + def setup(self, n_qubits, depth): + seed = 42 + self.circuit = random_circuit( + n_qubits, depth, measure=True, conditional=True, reset=True, seed=seed, max_operands=2 + ) + self.fresh_dag = circuit_to_dag(self.circuit) + self.basis_gates = ["u1", "u2", "u3", "cx", "iid"] + self.cmap = [ + [0, 1], + [1, 0], + [1, 2], + [1, 6], + [2, 1], + [2, 3], + [3, 2], + [3, 4], + [3, 8], + [4, 3], + [5, 6], + [5, 10], + [6, 1], + [6, 5], + [6, 7], + [7, 6], + [7, 8], + [7, 12], + [8, 3], + [8, 7], + [8, 9], + [9, 8], + [9, 14], + [10, 5], + [10, 11], + [11, 10], + [11, 12], + [11, 16], + [12, 7], + [12, 11], + [12, 13], + [13, 12], + [13, 14], + [13, 18], + [14, 9], + [14, 13], + [15, 16], + [16, 11], + [16, 15], + [16, 17], + [17, 16], + [17, 18], + [18, 13], + [18, 17], + [18, 19], + [19, 18], + ] + self.coupling_map = CouplingMap(self.cmap) + + layout_pass = DenseLayout(self.coupling_map) + layout_pass.run(self.fresh_dag) + self.layout = layout_pass.property_set["layout"] + full_ancilla_pass = FullAncillaAllocation(self.coupling_map) + full_ancilla_pass.property_set["layout"] = self.layout + self.full_ancilla_dag = full_ancilla_pass.run(self.fresh_dag) + enlarge_pass = EnlargeWithAncilla() + enlarge_pass.property_set["layout"] = self.layout + self.enlarge_dag = enlarge_pass.run(self.full_ancilla_dag) + apply_pass = ApplyLayout() + apply_pass.property_set["layout"] = self.layout + self.dag = apply_pass.run(self.enlarge_dag) + self.backend_props = FakeSingapore().properties() + self.routed_dag = StochasticSwap(self.coupling_map, seed=42).run(self.dag) + + def time_cxdirection(self, _, __): + CXDirection(self.coupling_map).run(self.routed_dag) + + def time_check_cx_direction(self, _, __): + CheckCXDirection(self.coupling_map).run(self.routed_dag) + + def time_gate_direction(self, _, __): + GateDirection(self.coupling_map).run(self.routed_dag) + + def time_check_gate_direction(self, _, __): + CheckGateDirection(self.coupling_map).run(self.routed_dag) + + def time_check_map(self, _, __): + CheckMap(self.coupling_map).run(self.routed_dag) diff --git a/test/benchmarks/passes.py b/test/benchmarks/passes.py new file mode 100644 index 000000000000..1f93fcd9956e --- /dev/null +++ b/test/benchmarks/passes.py @@ -0,0 +1,212 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=no-member,invalid-name,missing-docstring,no-name-in-module +# pylint: disable=attribute-defined-outside-init,unsubscriptable-object +# pylint: disable=unused-wildcard-import,wildcard-import,undefined-variable + + +from qiskit.circuit.equivalence_library import SessionEquivalenceLibrary as SEL +from qiskit.transpiler.passes import * +from qiskit.converters import circuit_to_dag + +from .utils import random_circuit + + +class Collect2QPassBenchmarks: + params = ([5, 14, 20], [1024]) + + param_names = ["n_qubits", "depth"] + timeout = 300 + + def setup(self, n_qubits, depth): + seed = 42 + self.circuit = random_circuit( + n_qubits, depth, measure=True, conditional=True, reset=True, seed=seed + ) + self.dag = circuit_to_dag(self.circuit) + collect_blocks = Collect2qBlocks() + collect_blocks.run(self.dag) + self.block_list = collect_blocks.property_set["block_list"] + + def time_consolidate_blocks(self, _, __): + _pass = ConsolidateBlocks() + _pass.property_set["block_list"] = self.block_list + _pass.run(self.dag) + + +class CommutativeAnalysisPassBenchmarks: + params = ([5, 14, 20], [1024]) + + param_names = ["n_qubits", "depth"] + timeout = 300 + + def setup(self, n_qubits, depth): + seed = 42 + self.circuit = random_circuit( + n_qubits, depth, measure=True, conditional=True, reset=True, seed=seed + ) + self.dag = circuit_to_dag(self.circuit) + commutative_analysis = CommutationAnalysis() + commutative_analysis.run(self.dag) + self.commutation_set = commutative_analysis.property_set["commutation_set"] + + def time_commutative_cancellation(self, _, __): + _pass = CommutativeCancellation() + _pass.property_set["commutation_set"] = self.commutation_set + _pass.run(self.dag) + + +class UnrolledPassBenchmarks: + params = ([5, 14, 20], [1024]) + + param_names = ["n_qubits", "depth"] + timeout = 300 + + def setup(self, n_qubits, depth): + seed = 42 + self.circuit = random_circuit( + n_qubits, depth, measure=True, conditional=True, reset=True, seed=seed + ) + self.dag = circuit_to_dag(self.circuit) + self.basis_gates = ["u1", "u2", "u3", "cx", "id"] + self.unrolled_dag = Unroller(self.basis_gates).run(self.dag) + + def time_optimize_1q(self, _, __): + Optimize1qGates().run(self.unrolled_dag) + + +class MultipleBasisPassBenchmarks: + params = ( + [5, 14, 20], + [1024], + [["u", "cx", "id"], ["rx", "ry", "rz", "r", "rxx", "id"], ["rz", "x", "sx", "cx", "id"]], + ) + + param_names = ["n_qubits", "depth", "basis_gates"] + timeout = 300 + + def setup(self, n_qubits, depth, basis_gates): + seed = 42 + self.circuit = random_circuit(n_qubits, depth, measure=True, seed=seed) + self.dag = circuit_to_dag(self.circuit) + self.basis_gates = basis_gates + + def time_optimize_1q_decompose(self, _, __, ___): + Optimize1qGatesDecomposition(self.basis_gates).run(self.dag) + + def time_optimize_1q_commutation(self, _, __, ___): + Optimize1qGatesSimpleCommutation(self.basis_gates).run(self.dag) + + def time_basis_translator(self, _, __, ___): + BasisTranslator(SEL, self.basis_gates).run(self.dag) + + +class PassBenchmarks: + params = ([5, 14, 20], [1024]) + + param_names = ["n_qubits", "depth"] + timeout = 300 + + def setup(self, n_qubits, depth): + seed = 42 + self.circuit = random_circuit( + n_qubits, depth, measure=True, conditional=True, reset=True, seed=seed + ) + self.dag = circuit_to_dag(self.circuit) + self.basis_gates = ["u1", "u2", "u3", "cx", "id"] + + def time_unroller(self, _, __): + Unroller(self.basis_gates).run(self.dag) + + def time_depth_pass(self, _, __): + Depth().run(self.dag) + + def time_size_pass(self, _, __): + Size().run(self.dag) + + def time_width_pass(self, _, __): + Width().run(self.dag) + + def time_count_ops_pass(self, _, __): + CountOps().run(self.dag) + + def time_count_ops_longest_path(self, _, __): + CountOpsLongestPath().run(self.dag) + + def time_num_tensor_factors(self, _, __): + NumTensorFactors().run(self.dag) + + def time_resource_optimization(self, _, __): + ResourceEstimation().run(self.dag) + + def time_cx_cancellation(self, _, __): + CXCancellation().run(self.dag) + + def time_dag_longest_path(self, _, __): + DAGLongestPath().run(self.dag) + + def time_merge_adjacent_barriers(self, _, __): + MergeAdjacentBarriers().run(self.dag) + + def time_decompose_pass(self, _, __): + Decompose().run(self.dag) + + def time_unroll_3q_or_more(self, _, __): + Unroll3qOrMore().run(self.dag) + + def time_commutation_analysis(self, _, __): + CommutationAnalysis().run(self.dag) + + def time_remove_reset_in_zero_state(self, _, __): + RemoveResetInZeroState().run(self.dag) + + def time_collect_2q_blocks(self, _, __): + Collect2qBlocks().run(self.dag) + + def time_optimize_swap_before_measure(self, _, __): + OptimizeSwapBeforeMeasure().run(self.dag) + + def time_barrier_before_final_measurements(self, _, __): + BarrierBeforeFinalMeasurements().run(self.dag) + + def time_remove_diagonal_gates_before_measurement(self, _, __): + RemoveDiagonalGatesBeforeMeasure().run(self.dag) + + def time_remove_final_measurements(self, _, __): + RemoveFinalMeasurements().run(self.dag) + + def time_contains_instruction(self, _, __): + ContainsInstruction("cx").run(self.dag) + + def time_gates_in_basis(self, _, __): + GatesInBasis(self.basis_gates).run(self.dag) + + def time_remove_barriers(self, _, __): + RemoveBarriers().run(self.dag) + + +class MultiQBlockPassBenchmarks: + params = ([5, 14, 20], [1024], [1, 2, 3, 4, 5]) + + param_names = ["n_qubits", "depth", "max_block_size"] + timeout = 300 + + def setup(self, n_qubits, depth, _): + seed = 42 + self.circuit = random_circuit( + n_qubits, depth, measure=True, conditional=True, reset=True, seed=seed + ) + self.dag = circuit_to_dag(self.circuit) + + def time_collect_multiq_block(self, _, __, max_block_size): + CollectMultiQBlocks(max_block_size).run(self.dag) diff --git a/test/benchmarks/pulse/__init__.py b/test/benchmarks/pulse/__init__.py new file mode 100644 index 000000000000..c7325a848299 --- /dev/null +++ b/test/benchmarks/pulse/__init__.py @@ -0,0 +1,11 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. diff --git a/test/benchmarks/pulse/load_pulse_defaults.py b/test/benchmarks/pulse/load_pulse_defaults.py new file mode 100644 index 000000000000..1b7fa5cc1719 --- /dev/null +++ b/test/benchmarks/pulse/load_pulse_defaults.py @@ -0,0 +1,552 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=missing-docstring,invalid-name,no-member +# pylint: disable=attribute-defined-outside-init + +import numpy as np + +from qiskit.providers.models import PulseDefaults +from qiskit.compiler import schedule +from qiskit.circuit import QuantumCircuit, Gate + + +def gen_source(num_random_gate): + + # minimum data to instantiate pulse defaults. + # cmd def contains cx, rz, sx, u3, measure + # and random gate (custom waveform of 100 dt + 2 fc) + + qobj_dict = { + "qubit_freq_est": [5.0, 5.1], + "meas_freq_est": [7.0, 7.0], + "buffer": 0, + "pulse_library": [], + "cmd_def": [ + { + "name": "cx", + "qubits": [0, 1], + "sequence": [ + { + "ch": "d0", + "name": "fc", + "phase": -3.141592653589793, + "t0": 0, + }, + { + "ch": "d0", + "label": "Y90p_d0", + "name": "parametric_pulse", + "parameters": { + "amp": (0.0022743565483134 + 0.14767107967944j), + "beta": 0.5218372954777448, + "duration": 96, + "sigma": 24, + }, + "pulse_shape": "drag", + "t0": 0, + }, + { + "ch": "d0", + "label": "CR90p_d0_u1", + "name": "parametric_pulse", + "parameters": { + "amp": (0.03583301328943 - 0.0006486874906466j), + "duration": 1104, + "sigma": 64, + "width": 848, + }, + "pulse_shape": "gaussian_square", + "t0": 96, + }, + { + "ch": "d0", + "label": "CR90m_d0_u1", + "name": "parametric_pulse", + "parameters": { + "amp": (-0.03583301328943 + 0.000648687490646j), + "duration": 1104, + "sigma": 64, + "width": 848, + }, + "pulse_shape": "gaussian_square", + "t0": 1296, + }, + { + "ch": "d0", + "name": "fc", + "phase": -1.5707963267948966, + "t0": 2400, + }, + { + "ch": "d0", + "label": "X90p_d0", + "name": "parametric_pulse", + "parameters": { + "amp": (0.14766707017470 - 0.002521280908868j), + "beta": 0.5218372954777448, + "duration": 96, + "sigma": 24, + }, + "pulse_shape": "drag", + "t0": 2400, + }, + { + "ch": "d1", + "name": "fc", + "phase": -1.5707963267948966, + "t0": 0, + }, + { + "ch": "d1", + "label": "X90p_d1", + "name": "parametric_pulse", + "parameters": { + "amp": (0.19074973504459 + 0.004525711677119j), + "beta": -1.2815198779814807, + "duration": 96, + "sigma": 24, + }, + "pulse_shape": "drag", + "t0": 0, + }, + { + "ch": "d1", + "label": "Xp_d1", + "name": "parametric_pulse", + "parameters": { + "amp": (0.3872223088586379 + 0j), + "beta": -1.498502772395478, + "duration": 96, + "sigma": 24, + }, + "pulse_shape": "drag", + "t0": 1200, + }, + { + "ch": "d1", + "label": "Y90m_d1", + "name": "parametric_pulse", + "parameters": { + "amp": (0.00285052543950 - 0.19078212177897j), + "beta": -1.2815198779814807, + "duration": 96, + "sigma": 24, + }, + "pulse_shape": "drag", + "t0": 2400, + }, + { + "ch": "u0", + "name": "fc", + "phase": -1.5707963267948966, + "t0": 0, + }, + { + "ch": "u1", + "name": "fc", + "phase": -3.141592653589793, + "t0": 0, + }, + { + "ch": "u1", + "label": "CR90p_u1", + "name": "parametric_pulse", + "parameters": { + "amp": (-0.1629668182698 - 0.8902610676540j), + "duration": 1104, + "sigma": 64, + "width": 848, + }, + "pulse_shape": "gaussian_square", + "t0": 96, + }, + { + "ch": "u1", + "label": "CR90m_u1", + "name": "parametric_pulse", + "parameters": { + "amp": (0.16296681826986 + 0.8902610676540j), + "duration": 1104, + "sigma": 64, + "width": 848, + }, + "pulse_shape": "gaussian_square", + "t0": 1296, + }, + { + "ch": "u1", + "name": "fc", + "phase": -1.5707963267948966, + "t0": 2400, + }, + ], + }, + { + "name": "rz", + "qubits": [0], + "sequence": [ + { + "ch": "d0", + "name": "fc", + "phase": "-(P0)", + "t0": 0, + }, + { + "ch": "u1", + "name": "fc", + "phase": "-(P0)", + "t0": 0, + }, + ], + }, + { + "name": "rz", + "qubits": [1], + "sequence": [ + { + "ch": "d1", + "name": "fc", + "phase": "-(P0)", + "t0": 0, + }, + { + "ch": "u0", + "name": "fc", + "phase": "-(P0)", + "t0": 0, + }, + ], + }, + { + "name": "sx", + "qubits": [0], + "sequence": [ + { + "ch": "d0", + "label": "X90p_d0", + "name": "parametric_pulse", + "parameters": { + "amp": (0.14766707017470 - 0.002521280908868j), + "beta": 0.5218372954777448, + "duration": 96, + "sigma": 24, + }, + "pulse_shape": "drag", + "t0": 0, + } + ], + }, + { + "name": "sx", + "qubits": [1], + "sequence": [ + { + "ch": "d1", + "label": "X90p_d0", + "name": "parametric_pulse", + "parameters": { + "amp": (0.19074973504459 + 0.004525711677119j), + "beta": -1.2815198779814807, + "duration": 96, + "sigma": 24, + }, + "pulse_shape": "drag", + "t0": 0, + } + ], + }, + { + "name": "u3", + "qubits": [0], + "sequence": [ + { + "ch": "d0", + "name": "fc", + "phase": "-(P2)", + "t0": 0, + }, + { + "ch": "d0", + "label": "X90p_d0", + "name": "parametric_pulse", + "parameters": { + "amp": (0.14766707017470 - 0.002521280908868j), + "beta": 0.5218372954777448, + "duration": 96, + "sigma": 24, + }, + "pulse_shape": "drag", + "t0": 0, + }, + { + "ch": "d0", + "name": "fc", + "phase": "-(P0)", + "t0": 96, + }, + { + "ch": "d0", + "label": "X90m_d0", + "name": "parametric_pulse", + "parameters": { + "amp": (-0.14767107967944 + 0.002274356548313j), + "beta": 0.5218372954777448, + "duration": 96, + "sigma": 24, + }, + "pulse_shape": "drag", + "t0": 96, + }, + { + "ch": "d0", + "name": "fc", + "phase": "-(P1)", + "t0": 192, + }, + { + "ch": "u1", + "name": "fc", + "phase": "-(P2)", + "t0": 0, + }, + { + "ch": "u1", + "name": "fc", + "phase": "-(P0)", + "t0": 96, + }, + { + "ch": "u1", + "name": "fc", + "phase": "-(P1)", + "t0": 192, + }, + ], + }, + { + "name": "u3", + "qubits": [1], + "sequence": [ + { + "ch": "d1", + "name": "fc", + "phase": "-(P2)", + "t0": 0, + }, + { + "ch": "d1", + "label": "X90p_d1", + "name": "parametric_pulse", + "parameters": { + "amp": (0.19074973504459 + 0.004525711677119j), + "beta": -1.2815198779814807, + "duration": 96, + "sigma": 24, + }, + "pulse_shape": "drag", + "t0": 0, + }, + { + "ch": "d1", + "name": "fc", + "phase": "-(P0)", + "t0": 96, + }, + { + "ch": "d1", + "label": "X90m_d1", + "name": "parametric_pulse", + "parameters": { + "amp": (-0.19078212177897 - 0.002850525439509j), + "beta": -1.2815198779814807, + "duration": 96, + "sigma": 24, + }, + "pulse_shape": "drag", + "t0": 96, + }, + { + "ch": "d1", + "name": "fc", + "phase": "-(P1)", + "t0": 192, + }, + { + "ch": "u0", + "name": "fc", + "phase": "-(P2)", + "t0": 0, + }, + { + "ch": "u0", + "name": "fc", + "phase": "-(P0)", + "t0": 96, + }, + { + "ch": "u0", + "name": "fc", + "phase": "-(P1)", + "t0": 192, + }, + ], + }, + { + "name": "measure", + "qubits": [0, 1], + "sequence": [ + { + "ch": "m0", + "label": "M_m0", + "name": "parametric_pulse", + "parameters": { + "amp": (-0.3003200790496 + 0.3069634566518j), + "duration": 1792, + "sigma": 64, + "width": 1536, + }, + "pulse_shape": "gaussian_square", + "t0": 0, + }, + { + "ch": "m1", + "label": "M_m1", + "name": "parametric_pulse", + "parameters": { + "amp": (0.26292757124962 + 0.14446138680205j), + "duration": 1792, + "sigma": 64, + "width": 1536, + }, + "pulse_shape": "gaussian_square", + "t0": 0, + }, + { + "ch": "m0", + "duration": 1504, + "name": "delay", + "t0": 1792, + }, + { + "ch": "m1", + "duration": 1504, + "name": "delay", + "t0": 1792, + }, + { + "duration": 1792, + "memory_slot": [0, 1], + "name": "acquire", + "qubits": [0, 1], + "t0": 0, + }, + ], + }, + ], + } + + # add random waveform gate entries to increase overhead + for i in range(num_random_gate): + for qind in (0, 1): + samples = np.random.random(100) + + gate_name = f"ramdom_gate_{i}" + sample_name = f"random_sample_q{qind}_{i}" + + qobj_dict["pulse_library"].append( + { + "name": sample_name, + "samples": samples, + } + ) + qobj_dict["cmd_def"].append( + { + "name": gate_name, + "qubits": [qind], + "sequence": [ + { + "ch": f"d{qind}", + "name": "fc", + "phase": "-(P0)", + "t0": 0, + }, + { + "ch": f"d{qind}", + "label": gate_name, + "name": sample_name, + "t0": 0, + }, + { + "ch": f"d{qind}", + "name": "fc", + "phase": "(P0)", + "t0": 100, + }, + ], + }, + ) + + return qobj_dict + + +class PulseDefaultsBench: + + params = ([0, 10, 100, 1000],) + param_names = [ + "number of random gates", + ] + + def setup(self, num_random_gate): + self.source = gen_source(num_random_gate) + + def time_building_defaults(self, _): + PulseDefaults.from_dict(self.source) + + +class CircuitSchedulingBench: + + params = ([1, 2, 3, 15],) + param_names = [ + "number of unit cell repetition", + ] + + def setup(self, repeat_unit_cell): + source = gen_source(1) + defaults = PulseDefaults.from_dict(source) + + self.inst_map = defaults.instruction_schedule_map + self.meas_map = [[0, 1]] + self.dt = 0.222e-9 + + rng = np.random.default_rng(123) + + qc = QuantumCircuit(2) + for _ in range(repeat_unit_cell): + randdom_gate = Gate("ramdom_gate_0", 1, list(rng.random(1))) + qc.cx(0, 1) + qc.append(randdom_gate, [0]) + qc.sx(0) + qc.rz(1.57, 0) + qc.append(randdom_gate, [1]) + qc.sx(1) + qc.rz(1.57, 1) + qc.measure_all() + self.qc = qc + + def time_scheduling_circuits(self, _): + schedule( + self.qc, + inst_map=self.inst_map, + meas_map=self.meas_map, + dt=self.dt, + ) diff --git a/test/benchmarks/pulse/schedule_construction.py b/test/benchmarks/pulse/schedule_construction.py new file mode 100644 index 000000000000..13b889a19513 --- /dev/null +++ b/test/benchmarks/pulse/schedule_construction.py @@ -0,0 +1,174 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=missing-docstring,invalid-name,no-member +# pylint: disable=attribute-defined-outside-init + +import numpy as np + +from qiskit.circuit import Parameter, QuantumCircuit, Gate +from qiskit.pulse import builder, library, channels + + +class EchoedCrossResonanceConstructionBench: + def setup(self): + + with builder.build() as x_ctrl: + builder.play( + library.Drag(160, 0.2, 40, 1.5), + channels.DriveChannel(0), + ) + self.x_ctrl = x_ctrl + + with builder.build() as cr45p: + builder.play( + library.GaussianSquare(800, 0.4, 64, 544), + channels.ControlChannel(0), + ) + builder.play( + library.GaussianSquare(800, 0.1, 64, 544), + channels.DriveChannel(1), + ) + self.cr45p = cr45p + + def time_full_scratch(self): + # Full scratch in a single builder context + with builder.build(): + with builder.align_sequential(): + with builder.align_left(): + builder.play( + library.GaussianSquare(800, 0.4, 64, 544), + channels.ControlChannel(0), + ) + builder.play( + library.GaussianSquare(800, 0.1, 64, 544), + channels.DriveChannel(1), + ) + builder.play( + library.Drag(160, 0.2, 40, 1.5), + channels.DriveChannel(0), + ) + with builder.phase_offset( + np.pi, + channels.ControlChannel(0), + channels.DriveChannel(1), + ): + with builder.align_left(): + builder.play( + library.GaussianSquare(800, 0.4, 64, 544), + channels.ControlChannel(0), + ) + builder.play( + library.GaussianSquare(800, 0.1, 64, 544), + channels.DriveChannel(1), + ) + builder.play( + library.Drag(160, 0.2, 40, 1.5), + channels.DriveChannel(0), + ) + + def time_with_call(self): + # Call subroutine, internally creates reference and assign immediately + with builder.build(): + with builder.align_sequential(): + builder.call(self.cr45p) + builder.call(self.x_ctrl) + with builder.phase_offset( + np.pi, + channels.ControlChannel(0), + channels.DriveChannel(1), + ): + builder.call(self.cr45p) + builder.call(self.x_ctrl) + + def time_assign_later(self): + # Create placeholder and assign subroutine at a later time + with builder.build() as temp_sched: + with builder.align_sequential(): + builder.reference("cr45p", "q0", "q1") + builder.reference("x", "q0") + with builder.phase_offset( + np.pi, + channels.ControlChannel(0), + channels.DriveChannel(1), + ): + builder.reference("cr45p", "q0", "q1") + builder.reference("x", "q0") + + temp_sched.assign_references( + { + ("cr45p", "q0", "q1"): self.cr45p, + ("x", "q0"): self.x_ctrl, + }, + inplace=True, + ) + + +class ParameterizedScheduleBench: + + params = [3, 11, 31, 51] + + def setup(self, nscan): + self.p0 = Parameter("P0") + self.p1 = Parameter("P1") + self.p2 = Parameter("P2") + + with builder.build() as schedule: + builder.play( + library.Constant(self.p0, self.p1), + channels.DriveChannel(self.p2), + ) + self.schedule = schedule + + with builder.build() as outer_schedule: + builder.reference("subroutine") + outer_schedule.assign_references({("subroutine",): schedule}, inplace=True) + self.outer_schedule = outer_schedule + + gate = Gate("my_gate", 1, [self.p0, self.p1, self.p2]) + qc = QuantumCircuit(1) + qc.append(gate, [0]) + qc.add_calibration(gate, (0,), schedule) + self.qc = qc + + # list of parameters + self.amps = np.linspace(-1, 1, nscan) + + def time_assign_single_schedule(self, _): + + out = [] + for amp in self.amps: + assigned = self.schedule.assign_parameters( + {self.p0: 100, self.p1: amp, self.p2: 0}, + inplace=False, + ) + out.append(assigned) + + def time_assign_parameterized_subroutine(self, _): + + out = [] + for amp in self.amps: + assigned = self.outer_schedule.assign_parameters( + {self.p0: 100, self.p1: amp, self.p2: 0}, + inplace=False, + ) + out.append(assigned) + + def time_assign_through_pulse_gate(self, _): + + out = [] + for amp in self.amps: + assigned = self.qc.assign_parameters( + {self.p0: 100, self.p1: amp, self.p2: 0}, + inplace=False, + ) + out.append(assigned) diff --git a/test/benchmarks/pulse/schedule_lowering.py b/test/benchmarks/pulse/schedule_lowering.py new file mode 100644 index 000000000000..38b09a8411be --- /dev/null +++ b/test/benchmarks/pulse/schedule_lowering.py @@ -0,0 +1,85 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=missing-docstring,invalid-name,no-member +# pylint: disable=attribute-defined-outside-init + +import numpy as np + +from qiskit.pulse import builder, library, channels +from qiskit.pulse.transforms import target_qobj_transform + + +def build_complicated_schedule(): + + with builder.build() as schedule: + with builder.align_sequential(): + with builder.align_right(): + with builder.phase_offset(np.pi, channels.ControlChannel(2)): + with builder.align_sequential(): + for _ in range(5): + builder.play( + library.GaussianSquare(640, 0.1, 64, 384), + channels.ControlChannel(2), + ) + builder.play( + library.Constant(1920, 0.1), + channels.DriveChannel(1), + ) + builder.barrier( + channels.DriveChannel(0), + channels.DriveChannel(1), + channels.DriveChannel(2), + ) + builder.delay(800, channels.DriveChannel(1)) + with builder.align_left(): + builder.play( + library.Drag(160, 0.3, 40, 1.5), + channels.DriveChannel(0), + ) + builder.play( + library.Drag(320, 0.2, 80, 1.5), + channels.DriveChannel(1), + ) + builder.play( + library.Drag(480, 0.1, 120, 1.5), + channels.DriveChannel(2), + ) + builder.reference("sub") + with builder.align_left(): + for i in range(3): + builder.play( + library.GaussianSquare(1600, 0.1, 64, 1344), + channels.MeasureChannel(i), + ) + builder.acquire( + 1600, + channels.AcquireChannel(i), + channels.MemorySlot(i), + ) + + with builder.build() as subroutine: + for i in range(3): + samples = np.random.random(160) + builder.play(samples, channels.DriveChannel(i)) + schedule.assign_references({("sub",): subroutine}, inplace=True) + + return schedule + + +class ScheduleLoweringBench: + def setup(self): + self.schedule_block = build_complicated_schedule() + + def time_lowering(self): + # Lower schedule block to generate job payload + target_qobj_transform(self.schedule_block) diff --git a/test/benchmarks/qasm/20QBT_45CYC_.0D1_.1D2_3.qasm b/test/benchmarks/qasm/20QBT_45CYC_.0D1_.1D2_3.qasm new file mode 100644 index 000000000000..cdd0efb1afbc --- /dev/null +++ b/test/benchmarks/qasm/20QBT_45CYC_.0D1_.1D2_3.qasm @@ -0,0 +1,51 @@ +// Originally source from the QUEKO benchmark suite +// https://github.com/UCLA-VAST/QUEKO-benchmark +// A benchmark of the impact of gate density for IBMQ Tokyo with a depth of 45 +OPENQASM 2.0; +include "qelib1.inc"; +qreg q[20]; +cx q[12], q[9]; +cx q[6], q[12]; +cx q[8], q[6]; +cx q[6], q[10]; +cx q[7], q[6]; +cx q[6], q[10]; +cx q[6], q[10]; +cx q[6], q[10]; +cx q[11], q[6]; +cx q[11], q[6]; +cx q[11], q[6]; +cx q[8], q[11]; +cx q[8], q[7]; +cx q[7], q[6]; +cx q[15], q[7]; +cx q[7], q[13]; +cx q[13], q[9]; +cx q[12], q[9]; +cx q[12], q[10]; +cx q[12], q[10]; +cx q[12], q[10]; +cx q[6], q[10]; +cx q[6], q[10]; +cx q[9], q[10]; +cx q[6], q[10]; +cx q[6], q[9]; +cx q[6], q[9]; +cx q[6], q[12]; +cx q[6], q[12]; +cx q[12], q[9]; +cx q[12], q[9]; +cx q[9], q[10]; +cx q[6], q[10]; +cx q[11], q[6]; +cx q[11], q[6]; +cx q[6], q[9]; +cx q[6], q[10]; +cx q[9], q[10]; +cx q[9], q[10]; +cx q[12], q[10]; +cx q[12], q[10]; +cx q[12], q[10]; +cx q[6], q[10]; +cx q[6], q[10]; +cx q[9], q[10]; diff --git a/test/benchmarks/qasm/53QBT_100CYC_QSE_3.qasm b/test/benchmarks/qasm/53QBT_100CYC_QSE_3.qasm new file mode 100644 index 000000000000..af33099e9cd6 --- /dev/null +++ b/test/benchmarks/qasm/53QBT_100CYC_QSE_3.qasm @@ -0,0 +1,3770 @@ +// Originally source from the QUEKO benchmark suite +// https://github.com/UCLA-VAST/QUEKO-benchmark +// A benchmark of scalability for IBMQ rochester with a depth of 100 +OPENQASM 2.0; +include "qelib1.inc"; +qreg q[53]; +x q[41]; +x q[32]; +x q[20]; +x q[19]; +x q[29]; +x q[27]; +x q[50]; +x q[23]; +x q[18]; +x q[30]; +x q[39]; +x q[22]; +x q[2]; +x q[38]; +x q[48]; +x q[25]; +x q[34]; +x q[5]; +x q[15]; +x q[3]; +x q[40]; +x q[17]; +x q[45]; +x q[35]; +x q[47]; +x q[28]; +x q[36]; +x q[11]; +x q[33]; +x q[46]; +x q[13]; +cx q[42], q[16]; +cx q[7], q[8]; +cx q[31], q[52]; +cx q[49], q[10]; +cx q[21], q[0]; +cx q[43], q[44]; +cx q[6], q[14]; +cx q[9], q[24]; +x q[41]; +x q[0]; +x q[46]; +x q[35]; +x q[28]; +x q[27]; +x q[49]; +x q[5]; +x q[15]; +x q[22]; +x q[10]; +x q[40]; +x q[48]; +x q[3]; +x q[39]; +x q[8]; +x q[52]; +x q[45]; +x q[44]; +x q[34]; +x q[38]; +x q[42]; +x q[16]; +x q[24]; +x q[51]; +x q[32]; +cx q[20], q[17]; +cx q[43], q[29]; +cx q[14], q[9]; +cx q[1], q[21]; +cx q[47], q[6]; +cx q[19], q[13]; +cx q[37], q[2]; +cx q[23], q[31]; +cx q[4], q[7]; +cx q[11], q[50]; +cx q[33], q[25]; +cx q[18], q[12]; +x q[1]; +x q[42]; +x q[29]; +x q[6]; +x q[49]; +x q[11]; +x q[12]; +x q[20]; +x q[52]; +x q[26]; +x q[46]; +x q[28]; +x q[2]; +x q[40]; +x q[35]; +x q[27]; +x q[21]; +x q[14]; +x q[19]; +x q[22]; +x q[17]; +x q[13]; +x q[32]; +x q[15]; +x q[0]; +x q[4]; +cx q[34], q[41]; +cx q[45], q[30]; +cx q[43], q[44]; +cx q[9], q[24]; +cx q[33], q[25]; +cx q[7], q[8]; +cx q[5], q[37]; +cx q[38], q[36]; +cx q[50], q[16]; +cx q[10], q[48]; +cx q[51], q[47]; +cx q[23], q[31]; +x q[41]; +x q[22]; +x q[17]; +x q[42]; +x q[9]; +x q[47]; +x q[18]; +x q[29]; +x q[20]; +x q[19]; +x q[51]; +x q[46]; +x q[16]; +x q[44]; +x q[28]; +x q[15]; +x q[35]; +x q[4]; +x q[26]; +x q[34]; +x q[52]; +x q[13]; +x q[30]; +x q[32]; +x q[40]; +x q[6]; +x q[21]; +x q[27]; +cx q[7], q[8]; +cx q[23], q[31]; +cx q[14], q[0]; +cx q[5], q[37]; +cx q[33], q[25]; +cx q[39], q[2]; +cx q[11], q[50]; +cx q[24], q[3]; +cx q[49], q[10]; +cx q[36], q[43]; +cx q[12], q[38]; +x q[41]; +x q[13]; +x q[36]; +x q[48]; +x q[4]; +x q[49]; +x q[24]; +x q[17]; +x q[3]; +x q[22]; +x q[40]; +x q[0]; +x q[34]; +x q[50]; +x q[19]; +x q[7]; +x q[45]; +x q[52]; +x q[44]; +x q[33]; +x q[32]; +x q[5]; +x q[35]; +x q[25]; +cx q[39], q[26]; +cx q[1], q[21]; +cx q[23], q[31]; +cx q[42], q[16]; +cx q[14], q[9]; +cx q[43], q[29]; +cx q[51], q[47]; +cx q[37], q[2]; +cx q[30], q[18]; +cx q[15], q[46]; +cx q[10], q[11]; +cx q[12], q[38]; +x q[41]; +x q[25]; +x q[51]; +x q[38]; +x q[45]; +x q[33]; +x q[15]; +x q[24]; +x q[49]; +x q[21]; +x q[2]; +x q[29]; +x q[11]; +x q[46]; +x q[39]; +x q[27]; +x q[44]; +x q[40]; +x q[28]; +x q[30]; +x q[35]; +x q[16]; +x q[47]; +x q[13]; +x q[0]; +x q[34]; +x q[10]; +x q[26]; +x q[22]; +x q[6]; +x q[12]; +cx q[14], q[9]; +cx q[31], q[52]; +cx q[36], q[43]; +cx q[32], q[8]; +cx q[5], q[37]; +cx q[50], q[19]; +cx q[7], q[20]; +cx q[17], q[1]; +cx q[3], q[42]; +x q[41]; +x q[34]; +x q[38]; +x q[14]; +x q[18]; +x q[36]; +x q[27]; +x q[23]; +x q[5]; +x q[32]; +x q[10]; +x q[20]; +x q[11]; +x q[15]; +x q[35]; +x q[33]; +x q[48]; +x q[39]; +x q[52]; +x q[29]; +x q[4]; +x q[46]; +x q[6]; +x q[17]; +x q[19]; +x q[28]; +x q[49]; +x q[25]; +x q[40]; +cx q[31], q[22]; +cx q[21], q[0]; +cx q[50], q[16]; +cx q[51], q[47]; +cx q[9], q[24]; +cx q[7], q[8]; +cx q[3], q[42]; +cx q[45], q[30]; +cx q[37], q[2]; +cx q[43], q[44]; +x q[41]; +x q[13]; +x q[29]; +x q[0]; +x q[28]; +x q[24]; +x q[2]; +x q[35]; +x q[40]; +x q[15]; +x q[11]; +x q[17]; +x q[46]; +x q[32]; +x q[34]; +x q[5]; +x q[20]; +x q[9]; +x q[37]; +x q[23]; +x q[30]; +x q[27]; +x q[45]; +cx q[51], q[47]; +cx q[12], q[38]; +cx q[33], q[25]; +cx q[36], q[43]; +cx q[31], q[22]; +cx q[50], q[16]; +cx q[3], q[42]; +cx q[10], q[48]; +cx q[7], q[8]; +cx q[6], q[14]; +cx q[21], q[49]; +cx q[39], q[26]; +x q[33]; +x q[5]; +x q[6]; +x q[44]; +x q[36]; +x q[11]; +x q[8]; +x q[39]; +x q[32]; +x q[47]; +x q[4]; +x q[31]; +x q[51]; +x q[3]; +x q[23]; +x q[35]; +x q[40]; +x q[38]; +x q[15]; +x q[34]; +x q[18]; +x q[26]; +x q[46]; +x q[43]; +x q[49]; +x q[48]; +x q[10]; +x q[27]; +x q[2]; +x q[12]; +x q[22]; +x q[25]; +cx q[41], q[52]; +cx q[14], q[0]; +cx q[1], q[21]; +cx q[42], q[16]; +cx q[20], q[17]; +cx q[19], q[13]; +cx q[45], q[30]; +x q[41]; +x q[23]; +x q[50]; +x q[3]; +x q[11]; +x q[26]; +x q[16]; +x q[40]; +x q[45]; +x q[47]; +x q[34]; +x q[22]; +x q[49]; +x q[36]; +x q[44]; +x q[27]; +x q[5]; +x q[9]; +x q[30]; +x q[6]; +x q[37]; +x q[38]; +cx q[14], q[0]; +cx q[35], q[48]; +cx q[4], q[7]; +cx q[20], q[17]; +cx q[32], q[8]; +cx q[31], q[52]; +cx q[39], q[2]; +cx q[19], q[13]; +cx q[24], q[46]; +cx q[1], q[21]; +cx q[29], q[33]; +cx q[18], q[12]; +cx q[15], q[28]; +x q[41]; +x q[27]; +x q[34]; +x q[48]; +x q[52]; +x q[31]; +x q[12]; +x q[11]; +x q[30]; +x q[44]; +x q[7]; +x q[47]; +x q[8]; +x q[18]; +x q[24]; +x q[15]; +x q[25]; +x q[46]; +x q[28]; +x q[4]; +x q[6]; +x q[23]; +x q[35]; +x q[21]; +x q[1]; +x q[45]; +cx q[36], q[43]; +cx q[14], q[0]; +cx q[29], q[33]; +cx q[39], q[2]; +cx q[32], q[51]; +cx q[5], q[37]; +cx q[19], q[13]; +cx q[3], q[42]; +cx q[20], q[17]; +x q[15]; +x q[27]; +x q[1]; +x q[45]; +x q[2]; +x q[20]; +x q[35]; +x q[28]; +x q[48]; +x q[32]; +x q[34]; +x q[37]; +x q[26]; +x q[51]; +x q[43]; +x q[23]; +x q[0]; +x q[5]; +x q[50]; +x q[3]; +x q[40]; +x q[11]; +x q[25]; +x q[12]; +x q[10]; +cx q[41], q[52]; +cx q[31], q[22]; +cx q[24], q[46]; +cx q[21], q[49]; +cx q[30], q[18]; +cx q[19], q[13]; +cx q[47], q[6]; +cx q[7], q[8]; +cx q[14], q[9]; +cx q[29], q[33]; +cx q[42], q[16]; +cx q[38], q[36]; +x q[52]; +x q[6]; +x q[11]; +x q[3]; +x q[8]; +x q[30]; +x q[7]; +x q[0]; +x q[14]; +x q[18]; +x q[22]; +x q[24]; +x q[20]; +x q[17]; +x q[1]; +x q[41]; +x q[29]; +x q[4]; +x q[36]; +x q[28]; +x q[2]; +x q[13]; +x q[34]; +x q[10]; +x q[27]; +x q[43]; +x q[40]; +x q[9]; +x q[45]; +x q[15]; +x q[32]; +cx q[50], q[16]; +cx q[21], q[49]; +cx q[39], q[26]; +cx q[23], q[31]; +cx q[35], q[48]; +cx q[33], q[25]; +cx q[12], q[38]; +cx q[51], q[47]; +cx q[5], q[37]; +x q[52]; +x q[19]; +x q[5]; +x q[37]; +x q[42]; +x q[1]; +x q[22]; +x q[23]; +x q[27]; +x q[46]; +x q[8]; +x q[50]; +x q[9]; +x q[13]; +x q[25]; +x q[48]; +x q[29]; +x q[18]; +x q[33]; +x q[43]; +x q[35]; +x q[47]; +x q[31]; +x q[16]; +x q[30]; +x q[15]; +x q[11]; +cx q[21], q[0]; +cx q[17], q[44]; +cx q[6], q[14]; +cx q[28], q[40]; +cx q[45], q[4]; +cx q[32], q[51]; +cx q[34], q[41]; +cx q[39], q[2]; +cx q[24], q[3]; +cx q[7], q[20]; +cx q[38], q[36]; +cx q[49], q[10]; +x q[52]; +x q[16]; +x q[37]; +x q[4]; +x q[1]; +x q[40]; +x q[23]; +x q[6]; +x q[43]; +x q[8]; +x q[26]; +x q[32]; +x q[27]; +x q[34]; +x q[48]; +x q[38]; +x q[45]; +x q[30]; +x q[15]; +x q[17]; +x q[13]; +x q[50]; +x q[36]; +cx q[14], q[9]; +cx q[7], q[20]; +cx q[18], q[12]; +cx q[29], q[33]; +cx q[49], q[10]; +cx q[51], q[47]; +cx q[24], q[46]; +cx q[31], q[22]; +cx q[39], q[2]; +cx q[21], q[0]; +cx q[25], q[35]; +cx q[3], q[42]; +x q[52]; +x q[25]; +x q[6]; +x q[34]; +x q[5]; +x q[10]; +x q[30]; +x q[51]; +x q[44]; +x q[47]; +x q[28]; +x q[0]; +x q[2]; +x q[19]; +x q[37]; +x q[13]; +x q[41]; +x q[48]; +x q[29]; +x q[36]; +x q[24]; +x q[11]; +x q[33]; +x q[40]; +x q[45]; +x q[35]; +x q[27]; +cx q[14], q[9]; +cx q[21], q[49]; +cx q[32], q[8]; +cx q[3], q[42]; +cx q[18], q[12]; +cx q[31], q[22]; +cx q[39], q[26]; +cx q[17], q[1]; +cx q[15], q[46]; +cx q[4], q[7]; +x q[52]; +x q[41]; +x q[16]; +x q[18]; +x q[5]; +x q[12]; +x q[0]; +x q[8]; +x q[15]; +x q[51]; +x q[13]; +x q[46]; +x q[3]; +x q[47]; +x q[27]; +x q[9]; +x q[43]; +x q[19]; +x q[1]; +x q[48]; +x q[38]; +cx q[42], q[34]; +cx q[31], q[22]; +cx q[17], q[44]; +cx q[40], q[23]; +cx q[7], q[20]; +cx q[49], q[10]; +cx q[6], q[14]; +cx q[37], q[2]; +cx q[45], q[4]; +cx q[29], q[33]; +cx q[11], q[50]; +x q[52]; +x q[33]; +x q[10]; +x q[37]; +x q[45]; +x q[48]; +x q[22]; +x q[46]; +x q[26]; +x q[3]; +x q[27]; +x q[49]; +x q[16]; +x q[30]; +x q[2]; +x q[42]; +x q[34]; +x q[15]; +x q[21]; +x q[1]; +x q[39]; +x q[28]; +x q[8]; +x q[20]; +x q[0]; +cx q[38], q[36]; +cx q[51], q[47]; +cx q[18], q[12]; +cx q[25], q[35]; +cx q[6], q[14]; +cx q[4], q[7]; +cx q[43], q[29]; +cx q[13], q[5]; +cx q[9], q[24]; +cx q[23], q[31]; +cx q[11], q[50]; +cx q[17], q[44]; +x q[52]; +x q[3]; +x q[12]; +x q[39]; +x q[38]; +x q[4]; +x q[45]; +x q[35]; +x q[18]; +x q[13]; +x q[36]; +x q[25]; +x q[19]; +x q[28]; +x q[49]; +x q[46]; +x q[50]; +x q[22]; +x q[29]; +x q[40]; +x q[34]; +x q[15]; +x q[5]; +x q[11]; +cx q[43], q[44]; +cx q[42], q[16]; +cx q[23], q[31]; +cx q[7], q[8]; +cx q[37], q[2]; +cx q[47], q[6]; +cx q[14], q[0]; +cx q[9], q[24]; +cx q[32], q[51]; +cx q[10], q[48]; +cx q[20], q[17]; +cx q[41], q[27]; +cx q[1], q[21]; +x q[52]; +x q[4]; +x q[25]; +x q[51]; +x q[29]; +x q[11]; +x q[24]; +x q[3]; +x q[44]; +x q[40]; +x q[8]; +x q[28]; +x q[9]; +x q[45]; +x q[32]; +x q[37]; +x q[48]; +x q[7]; +x q[26]; +x q[2]; +cx q[13], q[5]; +cx q[31], q[22]; +cx q[14], q[0]; +cx q[27], q[39]; +cx q[15], q[46]; +cx q[20], q[17]; +cx q[36], q[43]; +cx q[1], q[21]; +cx q[30], q[18]; +cx q[50], q[19]; +cx q[47], q[6]; +cx q[12], q[38]; +cx q[42], q[16]; +cx q[34], q[41]; +x q[2]; +x q[33]; +x q[18]; +x q[27]; +x q[0]; +x q[29]; +x q[32]; +x q[51]; +x q[20]; +x q[15]; +x q[28]; +x q[47]; +x q[6]; +x q[12]; +x q[25]; +x q[4]; +x q[34]; +x q[22]; +x q[11]; +x q[16]; +x q[37]; +x q[21]; +x q[8]; +cx q[31], q[52]; +cx q[39], q[26]; +cx q[17], q[1]; +cx q[3], q[42]; +cx q[24], q[46]; +cx q[38], q[36]; +cx q[49], q[10]; +cx q[13], q[5]; +cx q[14], q[9]; +cx q[35], q[48]; +cx q[45], q[30]; +cx q[43], q[44]; +x q[31]; +x q[28]; +x q[23]; +x q[22]; +x q[1]; +x q[8]; +x q[16]; +x q[36]; +x q[21]; +x q[9]; +x q[52]; +x q[46]; +x q[41]; +x q[10]; +x q[37]; +x q[49]; +x q[15]; +x q[43]; +x q[32]; +x q[39]; +x q[29]; +x q[33]; +x q[6]; +x q[2]; +x q[5]; +cx q[42], q[34]; +cx q[35], q[48]; +cx q[20], q[17]; +cx q[14], q[0]; +cx q[18], q[12]; +cx q[24], q[3]; +cx q[19], q[13]; +cx q[4], q[7]; +cx q[45], q[30]; +cx q[11], q[50]; +x q[31]; +x q[28]; +x q[0]; +x q[44]; +x q[7]; +x q[1]; +x q[49]; +x q[4]; +x q[8]; +x q[20]; +x q[43]; +x q[21]; +x q[2]; +x q[27]; +x q[36]; +x q[3]; +x q[34]; +x q[19]; +x q[17]; +x q[16]; +x q[42]; +x q[18]; +x q[30]; +x q[11]; +x q[39]; +x q[22]; +x q[35]; +x q[13]; +x q[29]; +x q[50]; +x q[38]; +x q[45]; +x q[37]; +x q[25]; +cx q[41], q[52]; +cx q[15], q[46]; +cx q[10], q[48]; +cx q[9], q[24]; +cx q[40], q[23]; +cx q[51], q[47]; +x q[31]; +x q[35]; +x q[48]; +x q[14]; +x q[18]; +x q[49]; +x q[27]; +x q[0]; +x q[8]; +x q[39]; +x q[16]; +x q[22]; +x q[19]; +x q[37]; +x q[25]; +x q[41]; +x q[50]; +x q[26]; +x q[21]; +x q[38]; +x q[33]; +x q[6]; +x q[52]; +x q[9]; +x q[36]; +x q[4]; +x q[32]; +x q[12]; +x q[46]; +cx q[43], q[29]; +cx q[51], q[47]; +cx q[13], q[5]; +cx q[7], q[20]; +cx q[42], q[34]; +cx q[40], q[23]; +cx q[10], q[11]; +cx q[15], q[28]; +cx q[24], q[3]; +cx q[45], q[30]; +cx q[17], q[1]; +x q[31]; +x q[17]; +x q[23]; +x q[20]; +x q[32]; +x q[11]; +x q[8]; +x q[12]; +x q[26]; +x q[52]; +x q[38]; +x q[36]; +x q[13]; +x q[5]; +x q[15]; +x q[19]; +x q[22]; +x q[50]; +x q[28]; +x q[40]; +x q[45]; +x q[3]; +x q[29]; +x q[1]; +x q[43]; +x q[33]; +x q[0]; +x q[27]; +x q[37]; +x q[46]; +cx q[39], q[2]; +cx q[4], q[7]; +cx q[9], q[24]; +cx q[6], q[14]; +cx q[10], q[48]; +cx q[34], q[41]; +cx q[30], q[18]; +cx q[42], q[16]; +cx q[21], q[49]; +cx q[51], q[47]; +x q[33]; +x q[22]; +x q[11]; +x q[51]; +x q[42]; +x q[26]; +x q[1]; +x q[32]; +x q[48]; +x q[13]; +x q[47]; +x q[12]; +x q[29]; +x q[30]; +x q[4]; +x q[16]; +x q[18]; +x q[2]; +x q[6]; +x q[49]; +x q[25]; +x q[10]; +x q[41]; +x q[8]; +x q[34]; +x q[35]; +x q[9]; +x q[21]; +x q[44]; +cx q[23], q[31]; +cx q[27], q[39]; +cx q[20], q[17]; +cx q[36], q[43]; +cx q[24], q[3]; +cx q[5], q[37]; +cx q[50], q[19]; +cx q[14], q[0]; +cx q[15], q[28]; +x q[23]; +x q[1]; +x q[7]; +x q[41]; +x q[20]; +x q[49]; +x q[21]; +x q[50]; +x q[33]; +x q[12]; +x q[36]; +x q[34]; +x q[11]; +x q[45]; +x q[10]; +x q[27]; +x q[29]; +x q[26]; +x q[4]; +x q[44]; +x q[39]; +x q[18]; +x q[8]; +x q[37]; +x q[19]; +x q[2]; +x q[38]; +x q[46]; +x q[24]; +x q[40]; +x q[43]; +x q[9]; +x q[17]; +cx q[25], q[35]; +cx q[31], q[22]; +cx q[13], q[5]; +cx q[42], q[16]; +cx q[14], q[0]; +cx q[32], q[51]; +cx q[47], q[6]; +cx q[15], q[28]; +x q[46]; +x q[1]; +x q[2]; +x q[0]; +x q[24]; +x q[35]; +x q[38]; +x q[37]; +x q[30]; +x q[39]; +x q[9]; +x q[3]; +x q[16]; +x q[18]; +x q[36]; +x q[29]; +x q[4]; +x q[17]; +x q[31]; +x q[49]; +x q[27]; +x q[42]; +x q[22]; +x q[45]; +x q[47]; +cx q[40], q[23]; +cx q[33], q[25]; +cx q[34], q[41]; +cx q[15], q[28]; +cx q[32], q[8]; +cx q[10], q[48]; +cx q[11], q[50]; +cx q[6], q[14]; +cx q[43], q[44]; +cx q[7], q[20]; +x q[23]; +x q[16]; +x q[14]; +x q[24]; +x q[47]; +x q[30]; +x q[28]; +x q[9]; +x q[18]; +x q[40]; +x q[49]; +x q[45]; +x q[5]; +x q[36]; +x q[4]; +x q[6]; +x q[12]; +x q[0]; +x q[3]; +x q[38]; +x q[27]; +x q[26]; +x q[21]; +x q[8]; +cx q[43], q[44]; +cx q[11], q[50]; +cx q[17], q[1]; +cx q[41], q[52]; +cx q[31], q[22]; +cx q[15], q[46]; +cx q[7], q[20]; +cx q[25], q[35]; +cx q[10], q[48]; +cx q[32], q[51]; +cx q[29], q[33]; +cx q[39], q[2]; +cx q[42], q[34]; +x q[23]; +x q[22]; +x q[25]; +x q[1]; +x q[35]; +x q[6]; +x q[2]; +x q[3]; +x q[17]; +x q[49]; +x q[29]; +x q[10]; +x q[46]; +x q[8]; +x q[43]; +x q[40]; +x q[14]; +x q[33]; +x q[4]; +x q[37]; +x q[26]; +x q[51]; +x q[28]; +x q[39]; +x q[12]; +x q[13]; +x q[45]; +x q[32]; +x q[48]; +x q[11]; +x q[47]; +x q[31]; +cx q[50], q[19]; +cx q[41], q[52]; +cx q[9], q[24]; +cx q[30], q[18]; +cx q[38], q[36]; +cx q[21], q[0]; +cx q[7], q[20]; +cx q[42], q[34]; +x q[33]; +x q[16]; +x q[19]; +x q[12]; +x q[28]; +x q[0]; +x q[37]; +x q[52]; +x q[17]; +x q[25]; +x q[49]; +x q[39]; +x q[36]; +x q[38]; +x q[41]; +x q[18]; +x q[9]; +x q[26]; +x q[27]; +x q[13]; +x q[35]; +x q[15]; +x q[30]; +cx q[40], q[23]; +cx q[11], q[50]; +cx q[43], q[44]; +cx q[32], q[8]; +cx q[7], q[20]; +cx q[1], q[21]; +cx q[42], q[34]; +cx q[6], q[14]; +cx q[31], q[22]; +cx q[24], q[46]; +cx q[45], q[4]; +cx q[51], q[47]; +x q[23]; +x q[45]; +x q[21]; +x q[26]; +x q[43]; +x q[24]; +x q[49]; +x q[30]; +x q[51]; +x q[3]; +x q[46]; +x q[15]; +x q[47]; +x q[36]; +x q[34]; +x q[20]; +x q[9]; +cx q[31], q[22]; +cx q[42], q[16]; +cx q[4], q[7]; +cx q[28], q[40]; +cx q[17], q[1]; +cx q[27], q[39]; +cx q[32], q[8]; +cx q[37], q[2]; +cx q[10], q[11]; +cx q[18], q[12]; +cx q[33], q[25]; +cx q[35], q[48]; +cx q[41], q[52]; +cx q[13], q[5]; +cx q[50], q[19]; +cx q[14], q[0]; +x q[24]; +x q[49]; +x q[14]; +x q[3]; +x q[45]; +x q[51]; +x q[44]; +x q[13]; +x q[36]; +x q[47]; +x q[15]; +x q[4]; +x q[22]; +x q[2]; +x q[9]; +x q[12]; +x q[52]; +x q[38]; +x q[50]; +x q[5]; +x q[30]; +x q[40]; +x q[18]; +x q[37]; +x q[27]; +x q[1]; +x q[42]; +x q[46]; +x q[32]; +x q[28]; +x q[6]; +x q[16]; +cx q[23], q[31]; +cx q[10], q[11]; +cx q[35], q[48]; +cx q[21], q[0]; +cx q[7], q[8]; +cx q[33], q[25]; +cx q[43], q[29]; +cx q[39], q[26]; +cx q[34], q[41]; +cx q[20], q[17]; +x q[5]; +x q[45]; +x q[49]; +x q[11]; +x q[40]; +x q[17]; +x q[12]; +x q[8]; +x q[4]; +x q[22]; +x q[46]; +x q[3]; +x q[37]; +x q[0]; +x q[21]; +x q[35]; +x q[30]; +x q[44]; +x q[1]; +cx q[23], q[31]; +cx q[6], q[14]; +cx q[10], q[48]; +cx q[43], q[29]; +cx q[7], q[20]; +cx q[50], q[16]; +cx q[33], q[25]; +cx q[9], q[24]; +cx q[39], q[2]; +cx q[51], q[47]; +cx q[41], q[52]; +cx q[15], q[28]; +cx q[38], q[36]; +cx q[42], q[34]; +x q[31]; +x q[3]; +x q[6]; +x q[36]; +x q[45]; +x q[10]; +x q[44]; +x q[7]; +x q[26]; +x q[18]; +x q[25]; +x q[9]; +x q[38]; +x q[22]; +x q[32]; +x q[12]; +x q[14]; +x q[39]; +x q[23]; +x q[24]; +x q[47]; +x q[4]; +x q[20]; +x q[8]; +x q[43]; +cx q[21], q[0]; +cx q[41], q[52]; +cx q[37], q[2]; +cx q[29], q[33]; +cx q[11], q[50]; +cx q[42], q[16]; +cx q[15], q[46]; +cx q[35], q[48]; +cx q[13], q[5]; +cx q[28], q[40]; +x q[31]; +x q[51]; +x q[52]; +x q[27]; +x q[30]; +x q[40]; +x q[0]; +x q[15]; +x q[48]; +x q[23]; +x q[49]; +x q[28]; +x q[26]; +x q[36]; +x q[6]; +x q[46]; +x q[32]; +x q[35]; +x q[5]; +x q[45]; +x q[47]; +x q[39]; +x q[38]; +x q[14]; +x q[20]; +x q[17]; +x q[29]; +x q[8]; +cx q[9], q[24]; +cx q[19], q[13]; +cx q[18], q[12]; +cx q[1], q[21]; +cx q[34], q[41]; +cx q[42], q[16]; +cx q[10], q[11]; +cx q[33], q[25]; +cx q[4], q[7]; +cx q[37], q[2]; +x q[31]; +x q[6]; +x q[46]; +x q[41]; +x q[2]; +x q[37]; +x q[34]; +x q[38]; +x q[50]; +x q[12]; +x q[47]; +x q[42]; +x q[5]; +x q[11]; +x q[9]; +x q[27]; +x q[33]; +x q[15]; +x q[32]; +x q[17]; +x q[7]; +x q[29]; +x q[25]; +x q[19]; +x q[13]; +x q[30]; +x q[8]; +x q[44]; +x q[1]; +x q[18]; +x q[23]; +x q[40]; +x q[16]; +x q[52]; +x q[45]; +x q[28]; +cx q[36], q[43]; +cx q[24], q[3]; +cx q[39], q[26]; +cx q[35], q[48]; +cx q[49], q[10]; +cx q[14], q[0]; +x q[31]; +x q[27]; +x q[11]; +x q[50]; +x q[25]; +x q[20]; +x q[17]; +x q[32]; +x q[6]; +x q[43]; +x q[38]; +x q[37]; +x q[52]; +x q[36]; +x q[48]; +x q[35]; +x q[41]; +x q[45]; +x q[4]; +x q[49]; +x q[16]; +x q[44]; +x q[51]; +x q[23]; +x q[34]; +x q[12]; +x q[28]; +x q[42]; +x q[47]; +x q[40]; +x q[22]; +cx q[15], q[46]; +cx q[13], q[5]; +cx q[30], q[18]; +cx q[24], q[3]; +cx q[7], q[8]; +cx q[29], q[33]; +cx q[1], q[21]; +cx q[14], q[0]; +cx q[39], q[2]; +x q[4]; +x q[43]; +x q[42]; +x q[0]; +x q[23]; +x q[8]; +x q[2]; +x q[26]; +x q[10]; +x q[45]; +x q[11]; +x q[40]; +x q[1]; +x q[17]; +x q[32]; +x q[19]; +x q[18]; +x q[22]; +x q[33]; +x q[28]; +x q[7]; +x q[21]; +x q[25]; +x q[13]; +x q[50]; +x q[51]; +x q[49]; +x q[47]; +x q[15]; +x q[46]; +x q[30]; +x q[29]; +cx q[31], q[52]; +cx q[12], q[38]; +cx q[34], q[41]; +cx q[14], q[9]; +cx q[24], q[3]; +cx q[27], q[39]; +cx q[35], q[48]; +cx q[5], q[37]; +x q[31]; +x q[36]; +x q[4]; +x q[45]; +x q[40]; +x q[23]; +x q[18]; +x q[44]; +x q[20]; +x q[17]; +x q[22]; +x q[48]; +x q[34]; +x q[42]; +x q[7]; +x q[38]; +x q[41]; +x q[8]; +x q[0]; +x q[12]; +x q[9]; +x q[32]; +x q[49]; +x q[26]; +x q[16]; +x q[47]; +x q[10]; +x q[52]; +x q[35]; +x q[19]; +x q[30]; +cx q[29], q[33]; +cx q[13], q[5]; +cx q[1], q[21]; +cx q[27], q[39]; +cx q[37], q[2]; +cx q[15], q[28]; +cx q[11], q[50]; +cx q[6], q[14]; +cx q[24], q[46]; +x q[31]; +x q[52]; +x q[49]; +x q[45]; +x q[9]; +x q[7]; +x q[39]; +x q[21]; +x q[26]; +x q[2]; +x q[47]; +x q[48]; +x q[12]; +x q[20]; +x q[13]; +x q[25]; +x q[27]; +x q[44]; +x q[18]; +x q[6]; +x q[33]; +x q[0]; +x q[30]; +x q[3]; +x q[50]; +x q[23]; +x q[38]; +x q[14]; +x q[35]; +x q[5]; +x q[1]; +x q[17]; +x q[36]; +x q[19]; +x q[4]; +x q[24]; +x q[22]; +x q[46]; +x q[16]; +x q[37]; +x q[40]; +x q[51]; +cx q[15], q[28]; +cx q[10], q[11]; +cx q[42], q[34]; +cx q[43], q[29]; +x q[31]; +x q[49]; +x q[17]; +x q[26]; +x q[33]; +x q[52]; +x q[29]; +x q[50]; +x q[16]; +x q[51]; +x q[2]; +x q[4]; +x q[22]; +x q[42]; +x q[5]; +x q[39]; +x q[35]; +x q[47]; +x q[40]; +x q[48]; +x q[32]; +x q[23]; +x q[19]; +x q[20]; +x q[45]; +x q[6]; +x q[9]; +x q[28]; +x q[37]; +cx q[7], q[8]; +cx q[14], q[0]; +cx q[30], q[18]; +cx q[10], q[11]; +cx q[34], q[41]; +cx q[15], q[46]; +cx q[24], q[3]; +cx q[43], q[44]; +cx q[1], q[21]; +x q[31]; +x q[13]; +x q[24]; +x q[0]; +x q[14]; +x q[45]; +x q[3]; +x q[27]; +x q[47]; +x q[28]; +x q[35]; +x q[15]; +x q[21]; +x q[36]; +x q[2]; +x q[52]; +x q[22]; +x q[50]; +x q[1]; +x q[46]; +x q[19]; +x q[49]; +x q[25]; +x q[33]; +x q[6]; +x q[4]; +x q[23]; +x q[51]; +cx q[12], q[38]; +cx q[10], q[48]; +cx q[34], q[41]; +cx q[5], q[37]; +cx q[7], q[8]; +cx q[42], q[16]; +cx q[39], q[26]; +cx q[30], q[18]; +cx q[17], q[44]; +cx q[43], q[29]; +x q[31]; +x q[52]; +x q[16]; +x q[6]; +x q[33]; +x q[46]; +x q[27]; +x q[17]; +x q[39]; +x q[37]; +x q[22]; +x q[20]; +x q[8]; +x q[51]; +x q[48]; +x q[21]; +x q[15]; +x q[4]; +x q[29]; +x q[18]; +x q[42]; +x q[26]; +x q[2]; +x q[23]; +x q[9]; +x q[7]; +x q[25]; +x q[35]; +x q[1]; +x q[11]; +x q[47]; +cx q[50], q[19]; +cx q[34], q[41]; +cx q[24], q[3]; +cx q[12], q[38]; +cx q[49], q[10]; +cx q[43], q[44]; +cx q[13], q[5]; +cx q[28], q[40]; +x q[32]; +x q[47]; +x q[27]; +x q[4]; +x q[39]; +x q[23]; +x q[34]; +x q[52]; +x q[42]; +x q[30]; +x q[45]; +x q[8]; +x q[6]; +x q[13]; +x q[41]; +x q[44]; +x q[26]; +x q[2]; +x q[5]; +x q[33]; +x q[51]; +x q[0]; +x q[16]; +x q[21]; +x q[46]; +cx q[31], q[22]; +cx q[38], q[36]; +cx q[49], q[10]; +cx q[11], q[50]; +cx q[43], q[29]; +cx q[17], q[1]; +cx q[35], q[48]; +cx q[24], q[3]; +cx q[28], q[40]; +cx q[18], q[12]; +cx q[7], q[20]; +cx q[14], q[9]; +x q[27]; +x q[45]; +x q[23]; +x q[14]; +x q[11]; +x q[35]; +x q[13]; +x q[25]; +x q[47]; +x q[42]; +x q[48]; +x q[49]; +x q[7]; +x q[1]; +x q[33]; +x q[20]; +x q[26]; +x q[8]; +x q[6]; +x q[34]; +x q[19]; +x q[32]; +x q[16]; +cx q[31], q[22]; +cx q[43], q[29]; +cx q[17], q[44]; +cx q[28], q[40]; +cx q[30], q[18]; +cx q[15], q[46]; +cx q[9], q[24]; +cx q[38], q[36]; +cx q[21], q[0]; +cx q[5], q[37]; +cx q[39], q[2]; +cx q[41], q[52]; +x q[19]; +x q[51]; +x q[47]; +x q[26]; +x q[38]; +x q[44]; +x q[40]; +x q[39]; +x q[4]; +x q[41]; +x q[12]; +x q[7]; +x q[16]; +x q[5]; +x q[36]; +x q[45]; +x q[46]; +x q[34]; +x q[23]; +x q[27]; +x q[52]; +x q[50]; +x q[11]; +x q[10]; +x q[6]; +x q[33]; +cx q[31], q[22]; +cx q[3], q[42]; +cx q[43], q[29]; +cx q[30], q[18]; +cx q[37], q[2]; +cx q[21], q[49]; +cx q[15], q[28]; +cx q[32], q[8]; +cx q[25], q[35]; +cx q[9], q[24]; +cx q[17], q[1]; +cx q[14], q[0]; +x q[31]; +x q[3]; +x q[35]; +x q[29]; +x q[8]; +x q[42]; +x q[28]; +x q[45]; +x q[41]; +x q[5]; +x q[48]; +x q[18]; +x q[11]; +x q[16]; +x q[10]; +x q[13]; +x q[39]; +x q[30]; +x q[49]; +x q[0]; +x q[6]; +x q[52]; +x q[27]; +x q[22]; +x q[14]; +x q[47]; +x q[34]; +x q[43]; +x q[21]; +x q[44]; +x q[24]; +cx q[38], q[36]; +cx q[20], q[17]; +cx q[15], q[46]; +cx q[40], q[23]; +cx q[50], q[19]; +cx q[4], q[7]; +cx q[33], q[25]; +cx q[37], q[2]; +cx q[32], q[51]; +x q[31]; +x q[12]; +x q[36]; +x q[32]; +x q[17]; +x q[4]; +x q[40]; +x q[25]; +x q[49]; +x q[13]; +x q[2]; +x q[1]; +x q[22]; +x q[48]; +x q[26]; +x q[8]; +x q[46]; +x q[45]; +x q[0]; +x q[10]; +x q[43]; +x q[34]; +x q[19]; +x q[44]; +cx q[29], q[33]; +cx q[6], q[14]; +cx q[51], q[47]; +cx q[9], q[24]; +cx q[27], q[39]; +cx q[7], q[20]; +cx q[3], q[42]; +cx q[5], q[37]; +cx q[30], q[18]; +cx q[11], q[50]; +cx q[41], q[52]; +cx q[15], q[28]; +x q[11]; +x q[20]; +x q[47]; +x q[34]; +x q[3]; +x q[50]; +x q[27]; +x q[24]; +x q[52]; +x q[4]; +x q[15]; +x q[43]; +x q[37]; +x q[19]; +x q[22]; +x q[7]; +x q[26]; +x q[0]; +x q[5]; +x q[42]; +x q[13]; +x q[12]; +x q[51]; +x q[46]; +cx q[23], q[31]; +cx q[29], q[33]; +cx q[28], q[40]; +cx q[25], q[35]; +cx q[39], q[2]; +cx q[30], q[18]; +cx q[6], q[14]; +cx q[10], q[48]; +cx q[32], q[8]; +cx q[38], q[36]; +cx q[17], q[1]; +cx q[21], q[49]; +x q[5]; +x q[33]; +x q[30]; +x q[42]; +x q[41]; +x q[34]; +x q[3]; +x q[16]; +x q[25]; +x q[20]; +x q[29]; +x q[13]; +x q[32]; +x q[7]; +x q[22]; +x q[35]; +x q[8]; +x q[24]; +x q[52]; +x q[12]; +x q[51]; +x q[48]; +x q[37]; +x q[38]; +x q[9]; +x q[28]; +cx q[23], q[31]; +cx q[15], q[46]; +cx q[21], q[0]; +cx q[11], q[50]; +cx q[47], q[6]; +cx q[39], q[2]; +cx q[17], q[1]; +cx q[49], q[10]; +cx q[45], q[4]; +cx q[43], q[44]; +x q[26]; +x q[7]; +x q[6]; +x q[21]; +x q[38]; +x q[49]; +x q[41]; +x q[36]; +x q[1]; +x q[37]; +x q[32]; +x q[3]; +x q[14]; +x q[35]; +x q[4]; +x q[8]; +x q[11]; +x q[10]; +x q[48]; +x q[30]; +x q[45]; +x q[22]; +cx q[31], q[52]; +cx q[18], q[12]; +cx q[43], q[29]; +cx q[20], q[17]; +cx q[13], q[5]; +cx q[39], q[2]; +cx q[42], q[16]; +cx q[15], q[46]; +cx q[51], q[47]; +cx q[9], q[24]; +cx q[33], q[25]; +cx q[50], q[19]; +cx q[28], q[40]; +x q[52]; +x q[13]; +x q[42]; +x q[22]; +x q[25]; +x q[45]; +x q[40]; +x q[46]; +x q[1]; +x q[12]; +x q[7]; +x q[20]; +x q[2]; +x q[6]; +x q[16]; +x q[47]; +x q[23]; +x q[0]; +x q[9]; +x q[34]; +x q[36]; +x q[31]; +x q[4]; +x q[3]; +x q[21]; +x q[24]; +x q[14]; +x q[41]; +x q[28]; +x q[51]; +x q[38]; +x q[10]; +x q[43]; +x q[15]; +x q[19]; +cx q[32], q[8]; +cx q[39], q[26]; +cx q[5], q[37]; +cx q[11], q[50]; +cx q[35], q[48]; +cx q[29], q[33]; +cx q[30], q[18]; +cx q[17], q[44]; +x q[38]; +x q[3]; +x q[27]; +x q[5]; +x q[0]; +x q[24]; +x q[23]; +x q[2]; +x q[26]; +x q[41]; +x q[34]; +x q[9]; +x q[25]; +x q[4]; +x q[6]; +x q[15]; +x q[18]; +x q[47]; +x q[40]; +x q[19]; +x q[35]; +x q[22]; +x q[39]; +x q[8]; +x q[42]; +x q[13]; +x q[16]; +x q[12]; +x q[49]; +x q[28]; +cx q[31], q[52]; +cx q[10], q[48]; +cx q[11], q[50]; +cx q[29], q[33]; +cx q[7], q[20]; +cx q[32], q[51]; +cx q[1], q[21]; +cx q[17], q[44]; +cx q[36], q[43]; +cx q[45], q[30]; +x q[44]; +x q[30]; +x q[12]; +x q[0]; +x q[36]; +x q[17]; +x q[19]; +x q[20]; +x q[34]; +x q[51]; +x q[43]; +x q[47]; +x q[28]; +x q[45]; +x q[33]; +x q[9]; +x q[49]; +x q[39]; +x q[3]; +x q[29]; +x q[50]; +x q[48]; +x q[46]; +x q[11]; +x q[8]; +x q[32]; +cx q[31], q[52]; +cx q[40], q[23]; +cx q[42], q[16]; +cx q[41], q[27]; +cx q[1], q[21]; +cx q[13], q[5]; +cx q[4], q[7]; +cx q[6], q[14]; +cx q[37], q[2]; +x q[21]; +x q[14]; +x q[47]; +x q[51]; +x q[43]; +x q[44]; +x q[19]; +x q[12]; +x q[6]; +x q[29]; +x q[10]; +x q[1]; +x q[30]; +x q[11]; +x q[26]; +x q[32]; +x q[49]; +x q[0]; +x q[34]; +x q[18]; +x q[3]; +x q[23]; +x q[42]; +cx q[41], q[52]; +cx q[9], q[24]; +cx q[20], q[17]; +cx q[13], q[5]; +cx q[28], q[40]; +cx q[7], q[8]; +cx q[27], q[39]; +cx q[50], q[16]; +cx q[15], q[46]; +cx q[37], q[2]; +cx q[33], q[25]; +cx q[38], q[36]; +cx q[45], q[4]; +cx q[31], q[22]; +cx q[35], q[48]; +x q[52]; +x q[9]; +x q[25]; +x q[42]; +x q[45]; +x q[31]; +x q[19]; +x q[16]; +x q[40]; +x q[12]; +x q[35]; +x q[4]; +x q[0]; +x q[7]; +x q[44]; +x q[3]; +x q[14]; +x q[11]; +x q[34]; +x q[23]; +x q[50]; +x q[43]; +x q[1]; +x q[28]; +cx q[21], q[49]; +cx q[20], q[17]; +cx q[10], q[48]; +cx q[24], q[46]; +cx q[39], q[26]; +cx q[13], q[5]; +cx q[38], q[36]; +cx q[30], q[18]; +cx q[41], q[27]; +cx q[37], q[2]; +cx q[32], q[8]; +cx q[47], q[6]; +x q[52]; +x q[2]; +x q[33]; +x q[23]; +x q[27]; +x q[17]; +x q[3]; +x q[14]; +x q[42]; +x q[15]; +x q[44]; +x q[28]; +x q[43]; +x q[25]; +x q[6]; +x q[0]; +x q[29]; +x q[46]; +x q[35]; +x q[51]; +x q[26]; +x q[32]; +x q[39]; +x q[13]; +x q[20]; +x q[47]; +x q[19]; +cx q[10], q[11]; +cx q[50], q[16]; +cx q[30], q[18]; +cx q[9], q[24]; +cx q[5], q[37]; +cx q[38], q[36]; +cx q[1], q[21]; +cx q[45], q[4]; +cx q[7], q[8]; +cx q[34], q[41]; +cx q[31], q[22]; +x q[52]; +x q[0]; +x q[8]; +x q[14]; +x q[31]; +x q[17]; +x q[45]; +x q[4]; +x q[16]; +x q[32]; +x q[37]; +x q[10]; +x q[49]; +x q[6]; +x q[42]; +x q[3]; +x q[46]; +x q[2]; +x q[28]; +x q[25]; +x q[27]; +x q[15]; +x q[33]; +x q[51]; +x q[19]; +x q[5]; +x q[12]; +cx q[38], q[36]; +cx q[35], q[48]; +cx q[9], q[24]; +cx q[11], q[50]; +cx q[43], q[44]; +cx q[34], q[41]; +cx q[39], q[26]; +cx q[40], q[23]; +cx q[30], q[18]; +cx q[7], q[20]; +cx q[1], q[21]; +x q[52]; +x q[51]; +x q[26]; +x q[37]; +x q[45]; +x q[47]; +x q[25]; +x q[43]; +x q[11]; +x q[24]; +x q[46]; +x q[14]; +x q[49]; +x q[19]; +x q[44]; +x q[6]; +x q[12]; +x q[21]; +x q[3]; +x q[9]; +x q[22]; +x q[0]; +x q[35]; +x q[8]; +x q[33]; +x q[27]; +x q[32]; +x q[40]; +x q[41]; +cx q[13], q[5]; +cx q[20], q[17]; +cx q[15], q[28]; +cx q[39], q[2]; +cx q[42], q[34]; +cx q[38], q[36]; +cx q[50], q[16]; +cx q[23], q[31]; +cx q[10], q[48]; +cx q[4], q[7]; +cx q[30], q[18]; +x q[52]; +x q[49]; +x q[43]; +x q[40]; +x q[37]; +x q[23]; +x q[32]; +x q[46]; +x q[17]; +x q[29]; +x q[8]; +x q[42]; +x q[28]; +x q[38]; +x q[18]; +x q[4]; +x q[50]; +x q[0]; +x q[10]; +x q[31]; +x q[51]; +x q[15]; +x q[5]; +x q[36]; +x q[26]; +x q[33]; +x q[19]; +x q[44]; +x q[9]; +x q[16]; +x q[14]; +x q[25]; +x q[27]; +x q[6]; +cx q[45], q[30]; +cx q[24], q[3]; +cx q[39], q[2]; +cx q[7], q[20]; +cx q[34], q[41]; +cx q[35], q[48]; +cx q[1], q[21]; +x q[14]; +x q[10]; +x q[22]; +x q[17]; +x q[6]; +x q[27]; +x q[29]; +x q[35]; +x q[33]; +x q[38]; +x q[26]; +x q[15]; +x q[30]; +x q[1]; +x q[41]; +x q[32]; +x q[28]; +x q[20]; +x q[16]; +x q[40]; +x q[25]; +x q[34]; +x q[48]; +x q[23]; +x q[37]; +x q[46]; +cx q[31], q[52]; +cx q[11], q[50]; +cx q[43], q[44]; +cx q[3], q[42]; +cx q[18], q[12]; +cx q[51], q[47]; +cx q[39], q[2]; +cx q[9], q[24]; +cx q[45], q[4]; +cx q[13], q[5]; +x q[31]; +x q[34]; +x q[25]; +x q[22]; +x q[18]; +x q[35]; +x q[28]; +x q[36]; +x q[41]; +x q[21]; +x q[43]; +x q[38]; +x q[30]; +x q[19]; +x q[12]; +x q[2]; +x q[45]; +x q[44]; +x q[49]; +x q[24]; +x q[37]; +x q[4]; +x q[7]; +x q[40]; +x q[48]; +x q[27]; +cx q[10], q[11]; +cx q[29], q[33]; +cx q[14], q[0]; +cx q[50], q[16]; +cx q[39], q[26]; +cx q[3], q[42]; +cx q[15], q[46]; +cx q[13], q[5]; +cx q[20], q[17]; +cx q[51], q[47]; +cx q[32], q[8]; +x q[9]; +x q[29]; +x q[14]; +x q[6]; +x q[7]; +x q[12]; +x q[35]; +x q[40]; +x q[49]; +x q[20]; +x q[34]; +x q[16]; +x q[22]; +x q[26]; +x q[23]; +x q[17]; +x q[39]; +x q[0]; +x q[36]; +x q[28]; +x q[43]; +x q[41]; +cx q[31], q[52]; +cx q[50], q[19]; +cx q[33], q[25]; +cx q[51], q[47]; +cx q[32], q[8]; +cx q[15], q[46]; +cx q[1], q[21]; +cx q[37], q[2]; +cx q[13], q[5]; +cx q[24], q[3]; +cx q[10], q[48]; +cx q[45], q[30]; +x q[52]; +x q[42]; +x q[41]; +x q[17]; +x q[51]; +x q[47]; +x q[43]; +x q[44]; +x q[36]; +x q[12]; +x q[3]; +x q[18]; +x q[25]; +x q[20]; +x q[0]; +x q[26]; +x q[23]; +x q[11]; +x q[34]; +x q[38]; +x q[45]; +x q[30]; +x q[40]; +cx q[9], q[24]; +cx q[32], q[8]; +cx q[5], q[37]; +cx q[6], q[14]; +cx q[29], q[33]; +cx q[50], q[16]; +cx q[19], q[13]; +cx q[1], q[21]; +cx q[39], q[2]; +cx q[35], q[48]; +cx q[31], q[22]; +cx q[49], q[10]; +cx q[15], q[46]; +cx q[4], q[7]; +x q[52]; +x q[39]; +x q[26]; +x q[27]; +x q[36]; +x q[44]; +x q[15]; +x q[7]; +x q[0]; +x q[2]; +x q[8]; +x q[9]; +x q[22]; +x q[38]; +x q[43]; +x q[30]; +x q[41]; +x q[31]; +x q[6]; +x q[18]; +x q[17]; +x q[3]; +x q[49]; +x q[28]; +x q[11]; +x q[14]; +x q[20]; +x q[19]; +x q[24]; +cx q[25], q[35]; +cx q[29], q[33]; +cx q[1], q[21]; +cx q[40], q[23]; +cx q[45], q[4]; +cx q[10], q[48]; +cx q[5], q[37]; +cx q[51], q[47]; +cx q[42], q[34]; +cx q[50], q[16]; +x q[6]; +x q[23]; +x q[8]; +x q[3]; +x q[10]; +x q[2]; +x q[22]; +x q[44]; +x q[27]; +x q[43]; +x q[26]; +x q[28]; +x q[40]; +x q[47]; +x q[33]; +x q[13]; +x q[49]; +x q[37]; +x q[19]; +x q[32]; +x q[24]; +x q[39]; +x q[5]; +x q[48]; +cx q[41], q[52]; +cx q[21], q[0]; +cx q[14], q[9]; +cx q[15], q[46]; +cx q[17], q[1]; +cx q[25], q[35]; +cx q[42], q[16]; +cx q[38], q[36]; +cx q[18], q[12]; +cx q[7], q[20]; +cx q[11], q[50]; +cx q[45], q[30]; +x q[52]; +x q[23]; +x q[15]; +x q[18]; +x q[17]; +x q[12]; +x q[0]; +x q[3]; +x q[30]; +x q[16]; +x q[47]; +x q[1]; +x q[46]; +x q[34]; +x q[26]; +x q[36]; +x q[49]; +x q[50]; +x q[21]; +x q[27]; +x q[43]; +x q[9]; +x q[31]; +x q[14]; +x q[24]; +x q[44]; +x q[7]; +x q[6]; +x q[35]; +x q[37]; +x q[41]; +x q[51]; +x q[5]; +x q[42]; +x q[29]; +x q[22]; +cx q[32], q[8]; +cx q[45], q[4]; +cx q[10], q[48]; +cx q[33], q[25]; +cx q[39], q[2]; +cx q[19], q[13]; +x q[52]; +x q[24]; +x q[27]; +x q[51]; +x q[2]; +x q[15]; +x q[47]; +x q[1]; +x q[7]; +x q[33]; +x q[22]; +x q[6]; +x q[19]; +x q[25]; +x q[8]; +x q[4]; +x q[16]; +x q[5]; +x q[45]; +x q[26]; +x q[39]; +x q[13]; +x q[46]; +x q[50]; +x q[11]; +x q[37]; +x q[20]; +x q[29]; +x q[38]; +cx q[17], q[44]; +cx q[3], q[42]; +cx q[34], q[41]; +cx q[49], q[10]; +cx q[40], q[23]; +cx q[21], q[0]; +cx q[14], q[9]; +cx q[18], q[12]; +cx q[35], q[48]; +x q[43]; +x q[48]; +x q[21]; +x q[4]; +x q[33]; +x q[7]; +x q[51]; +x q[2]; +x q[12]; +x q[27]; +x q[9]; +x q[39]; +x q[38]; +x q[18]; +x q[34]; +x q[36]; +x q[47]; +x q[22]; +x q[26]; +x q[29]; +x q[42]; +x q[13]; +x q[20]; +x q[14]; +x q[6]; +x q[1]; +x q[31]; +x q[49]; +x q[40]; +x q[30]; +x q[44]; +cx q[41], q[52]; +cx q[10], q[11]; +cx q[32], q[8]; +cx q[25], q[35]; +cx q[24], q[3]; +cx q[15], q[46]; +cx q[5], q[37]; +cx q[50], q[16]; +x q[52]; +x q[34]; +x q[20]; +x q[29]; +x q[10]; +x q[22]; +x q[6]; +x q[27]; +x q[9]; +x q[47]; +x q[7]; +x q[50]; +x q[15]; +x q[30]; +x q[49]; +x q[18]; +x q[14]; +x q[41]; +x q[31]; +x q[19]; +x q[25]; +x q[28]; +x q[36]; +x q[11]; +cx q[12], q[38]; +cx q[45], q[4]; +cx q[17], q[1]; +cx q[37], q[2]; +cx q[24], q[3]; +cx q[39], q[26]; +cx q[40], q[23]; +cx q[43], q[44]; +cx q[21], q[0]; +cx q[32], q[51]; +cx q[13], q[5]; +cx q[35], q[48]; +x q[4]; +x q[12]; +x q[15]; +x q[2]; +x q[42]; +x q[0]; +x q[30]; +x q[9]; +x q[23]; +x q[11]; +x q[22]; +x q[18]; +x q[47]; +x q[34]; +x q[45]; +x q[3]; +x q[32]; +x q[36]; +x q[19]; +x q[26]; +x q[13]; +x q[39]; +x q[38]; +cx q[31], q[52]; +cx q[7], q[8]; +cx q[41], q[27]; +cx q[43], q[44]; +cx q[24], q[46]; +cx q[33], q[25]; +cx q[20], q[17]; +cx q[50], q[16]; +cx q[28], q[40]; +cx q[1], q[21]; +cx q[6], q[14]; +cx q[5], q[37]; +cx q[49], q[10]; +cx q[35], q[48]; +x q[52]; +x q[23]; +x q[21]; +x q[30]; +x q[38]; +x q[31]; +x q[11]; +x q[22]; +x q[9]; +x q[36]; +x q[50]; +x q[33]; +x q[34]; +x q[35]; +x q[18]; +x q[24]; +x q[12]; +x q[48]; +x q[29]; +cx q[41], q[27]; +cx q[45], q[4]; +cx q[32], q[8]; +cx q[39], q[26]; +cx q[37], q[2]; +cx q[15], q[46]; +cx q[47], q[6]; +cx q[13], q[5]; +cx q[43], q[44]; +cx q[3], q[42]; +cx q[28], q[40]; +cx q[17], q[1]; +cx q[49], q[10]; +cx q[14], q[0]; +x q[52]; +x q[34]; +x q[49]; +x q[2]; +x q[32]; +x q[21]; +x q[33]; +x q[23]; +x q[45]; +x q[40]; +x q[18]; +x q[41]; +x q[22]; +x q[29]; +x q[8]; +x q[9]; +x q[48]; +x q[38]; +x q[35]; +x q[51]; +x q[31]; +x q[37]; +x q[27]; +x q[0]; +x q[11]; +x q[44]; +x q[47]; +cx q[50], q[19]; +cx q[7], q[20]; +cx q[36], q[43]; +cx q[17], q[1]; +cx q[13], q[5]; +cx q[6], q[14]; +cx q[24], q[3]; +cx q[42], q[16]; +cx q[15], q[46]; +cx q[39], q[26]; +x q[52]; +x q[29]; +x q[12]; +x q[14]; +x q[16]; +x q[50]; +x q[33]; +x q[21]; +x q[5]; +x q[49]; +x q[28]; +x q[44]; +x q[40]; +x q[3]; +x q[45]; +x q[41]; +x q[25]; +x q[32]; +x q[24]; +x q[0]; +x q[26]; +x q[51]; +x q[23]; +x q[1]; +x q[19]; +x q[4]; +x q[13]; +x q[18]; +cx q[42], q[34]; +cx q[35], q[48]; +cx q[31], q[22]; +cx q[47], q[6]; +cx q[37], q[2]; +cx q[7], q[8]; +cx q[20], q[17]; +cx q[15], q[46]; +cx q[10], q[11]; +cx q[27], q[39]; +cx q[36], q[43]; +x q[5]; +x q[39]; +x q[29]; +x q[26]; +x q[21]; +x q[50]; +x q[38]; +x q[46]; +x q[19]; +x q[49]; +x q[20]; +x q[16]; +x q[42]; +x q[0]; +x q[33]; +x q[34]; +x q[25]; +x q[35]; +x q[27]; +x q[17]; +x q[43]; +x q[36]; +x q[13]; +x q[11]; +cx q[41], q[52]; +cx q[9], q[24]; +cx q[10], q[48]; +cx q[32], q[8]; +cx q[18], q[12]; +cx q[40], q[23]; +cx q[51], q[47]; +cx q[31], q[22]; +cx q[6], q[14]; +cx q[37], q[2]; +cx q[4], q[7]; +cx q[15], q[28]; +cx q[45], q[30]; +x q[41]; +x q[9]; +x q[22]; +x q[15]; +x q[52]; +x q[28]; +x q[26]; +x q[18]; +x q[12]; +x q[47]; +x q[39]; +x q[34]; +x q[27]; +x q[11]; +x q[33]; +x q[7]; +x q[45]; +x q[25]; +x q[1]; +x q[44]; +x q[16]; +x q[51]; +x q[46]; +x q[13]; +x q[21]; +x q[42]; +x q[0]; +cx q[40], q[23]; +cx q[24], q[3]; +cx q[32], q[8]; +cx q[6], q[14]; +cx q[20], q[17]; +cx q[35], q[48]; +cx q[38], q[36]; +cx q[49], q[10]; +cx q[50], q[19]; +cx q[43], q[29]; +cx q[37], q[2]; +x q[41]; +x q[28]; +x q[7]; +x q[21]; +x q[12]; +x q[4]; +x q[1]; +x q[46]; +x q[14]; +x q[16]; +x q[15]; +x q[34]; +x q[25]; +x q[47]; +x q[0]; +x q[6]; +x q[43]; +x q[33]; +x q[20]; +x q[38]; +x q[13]; +x q[22]; +x q[11]; +x q[49]; +x q[26]; +x q[23]; +x q[31]; +x q[10]; +x q[36]; +x q[45]; +x q[29]; +cx q[5], q[37]; +cx q[17], q[44]; +cx q[9], q[24]; +cx q[3], q[42]; +cx q[27], q[39]; +cx q[35], q[48]; +cx q[32], q[8]; +cx q[30], q[18]; +x q[11]; +x q[37]; +x q[19]; +x q[14]; +x q[12]; +x q[3]; +x q[38]; +x q[4]; +x q[48]; +x q[9]; +x q[7]; +x q[36]; +x q[49]; +x q[5]; +x q[10]; +x q[23]; +x q[1]; +x q[16]; +x q[24]; +x q[33]; +x q[18]; +x q[51]; +x q[35]; +x q[13]; +x q[42]; +x q[52]; +x q[2]; +x q[25]; +x q[26]; +cx q[34], q[41]; +cx q[20], q[17]; +cx q[47], q[6]; +cx q[21], q[0]; +cx q[32], q[8]; +cx q[27], q[39]; +cx q[43], q[44]; +cx q[45], q[30]; +cx q[15], q[46]; +cx q[28], q[40]; +cx q[31], q[22]; +x q[34]; +x q[5]; +x q[18]; +x q[2]; +x q[52]; +x q[35]; +x q[27]; +x q[9]; +x q[19]; +x q[17]; +x q[15]; +x q[39]; +x q[37]; +x q[29]; +x q[25]; +x q[3]; +x q[23]; +x q[0]; +x q[47]; +x q[4]; +x q[14]; +x q[41]; +x q[46]; +x q[20]; +x q[24]; +x q[26]; +x q[30]; +x q[45]; +x q[38]; +x q[6]; +cx q[31], q[22]; +cx q[43], q[44]; +cx q[7], q[8]; +cx q[42], q[16]; +cx q[49], q[10]; +cx q[32], q[51]; +cx q[11], q[50]; +cx q[28], q[40]; +cx q[1], q[21]; +x q[17]; +x q[52]; +x q[9]; +x q[19]; +x q[5]; +x q[27]; +x q[37]; +x q[1]; +x q[49]; +x q[45]; +x q[24]; +x q[16]; +x q[13]; +x q[20]; +x q[30]; +x q[26]; +x q[46]; +x q[22]; +x q[7]; +x q[47]; +x q[36]; +x q[31]; +x q[18]; +x q[29]; +x q[51]; +x q[42]; +cx q[34], q[41]; +cx q[40], q[23]; +cx q[12], q[38]; +cx q[6], q[14]; +cx q[15], q[28]; +cx q[11], q[50]; +cx q[10], q[48]; +cx q[43], q[44]; +cx q[33], q[25]; +cx q[32], q[8]; +cx q[39], q[2]; +x q[34]; +x q[40]; +x q[33]; +x q[10]; +x q[4]; +x q[26]; +x q[7]; +x q[41]; +x q[27]; +x q[25]; +x q[28]; +x q[49]; +x q[21]; +x q[8]; +x q[32]; +x q[20]; +x q[3]; +x q[19]; +x q[14]; +x q[23]; +x q[51]; +x q[1]; +x q[31]; +x q[6]; +x q[15]; +x q[18]; +x q[45]; +x q[36]; +x q[44]; +x q[52]; +x q[9]; +x q[39]; +x q[0]; +x q[30]; +x q[17]; +x q[22]; +cx q[37], q[2]; +cx q[13], q[5]; +cx q[12], q[38]; +cx q[35], q[48]; +cx q[24], q[46]; +cx q[42], q[16]; +cx q[11], q[50]; +cx q[43], q[29]; +x q[7]; +x q[39]; +x q[11]; +x q[48]; +x q[44]; +x q[45]; +x q[29]; +x q[15]; +x q[23]; +x q[33]; +x q[40]; +x q[28]; +x q[52]; +x q[4]; +x q[43]; +x q[0]; +x q[20]; +x q[27]; +x q[46]; +x q[26]; +x q[3]; +x q[22]; +x q[12]; +x q[51]; +cx q[34], q[41]; +cx q[21], q[49]; +cx q[30], q[18]; +cx q[50], q[19]; +cx q[32], q[8]; +cx q[47], q[6]; +cx q[37], q[2]; +cx q[13], q[5]; +cx q[25], q[35]; +cx q[9], q[24]; +cx q[42], q[16]; +cx q[17], q[1]; +cx q[38], q[36]; +x q[41]; +x q[49]; +x q[47]; +x q[38]; +x q[51]; +x q[40]; +x q[34]; +x q[45]; +x q[37]; +x q[5]; +x q[32]; +x q[13]; +x q[23]; +x q[11]; +x q[43]; +x q[16]; +x q[6]; +x q[30]; +x q[42]; +x q[36]; +x q[10]; +x q[14]; +x q[1]; +x q[46]; +x q[22]; +x q[25]; +x q[3]; +x q[2]; +x q[17]; +x q[44]; +cx q[35], q[48]; +cx q[9], q[24]; +cx q[7], q[20]; +cx q[50], q[19]; +cx q[21], q[0]; +cx q[15], q[28]; +cx q[18], q[12]; +cx q[29], q[33]; +cx q[39], q[26]; +x q[41]; +x q[19]; +x q[46]; +x q[29]; +x q[11]; +x q[4]; +x q[34]; +x q[7]; +x q[32]; +x q[20]; +x q[52]; +x q[47]; +x q[30]; +x q[45]; +x q[27]; +x q[39]; +x q[3]; +x q[2]; +x q[24]; +x q[35]; +x q[13]; +x q[51]; +x q[38]; +x q[23]; +x q[36]; +x q[26]; +x q[6]; +x q[0]; +x q[50]; +x q[22]; +x q[15]; +x q[31]; +x q[18]; +cx q[42], q[16]; +cx q[43], q[44]; +cx q[33], q[25]; +cx q[28], q[40]; +cx q[5], q[37]; +cx q[17], q[1]; +cx q[49], q[10]; +cx q[14], q[9]; +x q[41]; +x q[34]; +x q[19]; +x q[25]; +x q[28]; +x q[18]; +x q[4]; +x q[20]; +x q[0]; +x q[43]; +x q[31]; +x q[16]; +x q[5]; +x q[48]; +x q[1]; +x q[35]; +x q[45]; +x q[42]; +x q[13]; +x q[23]; +x q[29]; +x q[12]; +x q[33]; +x q[6]; +x q[27]; +x q[36]; +x q[32]; +x q[14]; +cx q[39], q[26]; +cx q[49], q[10]; +cx q[51], q[47]; +cx q[9], q[24]; +cx q[17], q[44]; +cx q[11], q[50]; +cx q[15], q[46]; +x q[41]; +x q[20]; +x q[45]; +x q[37]; +x q[47]; +x q[23]; +x q[29]; +x q[15]; +x q[33]; +x q[50]; +x q[30]; +x q[27]; +x q[25]; +x q[52]; +x q[38]; +x q[3]; +x q[34]; +x q[6]; +x q[24]; +x q[0]; +x q[11]; +x q[31]; +x q[22]; +x q[2]; +cx q[10], q[48]; +cx q[28], q[40]; +cx q[17], q[44]; +cx q[4], q[7]; +cx q[36], q[43]; +cx q[14], q[9]; +cx q[21], q[49]; +cx q[18], q[12]; +cx q[39], q[26]; +cx q[42], q[16]; +cx q[32], q[51]; +cx q[19], q[13]; +x q[41]; +x q[18]; +x q[30]; +x q[12]; +x q[44]; +x q[47]; +x q[43]; +x q[9]; +x q[45]; +x q[27]; +x q[52]; +x q[13]; +x q[1]; +x q[35]; +x q[23]; +x q[3]; +x q[32]; +x q[24]; +x q[37]; +x q[2]; +x q[40]; +x q[6]; +x q[25]; +x q[46]; +cx q[50], q[16]; +cx q[29], q[33]; +cx q[42], q[34]; +cx q[20], q[17]; +cx q[31], q[22]; +cx q[39], q[26]; +cx q[4], q[7]; +cx q[15], q[28]; +cx q[14], q[0]; +cx q[38], q[36]; +cx q[21], q[49]; +cx q[10], q[11]; +x q[27]; +x q[46]; +x q[48]; +x q[1]; +x q[37]; +x q[29]; +x q[12]; +x q[45]; +x q[40]; +x q[5]; +x q[47]; +x q[19]; +x q[13]; +x q[18]; +x q[38]; +x q[51]; +x q[7]; +x q[4]; +x q[49]; +x q[26]; +x q[23]; +x q[20]; +x q[17]; +x q[24]; +x q[36]; +cx q[41], q[52]; +cx q[50], q[16]; +cx q[43], q[44]; +cx q[15], q[28]; +cx q[14], q[9]; +cx q[33], q[25]; +cx q[39], q[2]; +cx q[21], q[0]; +cx q[32], q[8]; +cx q[31], q[22]; +cx q[10], q[11]; +cx q[42], q[34]; +x q[41]; +x q[4]; +x q[46]; +x q[45]; +x q[24]; +x q[40]; +x q[32]; +x q[6]; +x q[23]; +x q[28]; +x q[17]; +x q[34]; +x q[20]; +x q[30]; +x q[18]; +x q[3]; +x q[27]; +x q[31]; +x q[15]; +x q[11]; +x q[22]; +x q[29]; +x q[5]; +x q[1]; +x q[33]; +x q[12]; +x q[10]; +x q[35]; +x q[26]; +cx q[21], q[0]; +cx q[14], q[9]; +cx q[19], q[13]; +cx q[51], q[47]; +cx q[7], q[8]; +cx q[42], q[16]; +cx q[43], q[44]; +cx q[38], q[36]; +cx q[37], q[2]; +x q[44]; +x q[51]; +x q[27]; +x q[34]; +x q[18]; +x q[43]; +x q[47]; +x q[9]; +x q[36]; +x q[20]; +x q[26]; +x q[50]; +x q[32]; +x q[49]; +x q[38]; +x q[30]; +x q[35]; +x q[14]; +x q[25]; +x q[17]; +x q[48]; +x q[45]; +x q[29]; +x q[21]; +x q[24]; +x q[12]; +x q[6]; +x q[0]; +x q[8]; +x q[16]; +x q[40]; +x q[2]; +x q[3]; +x q[33]; +x q[46]; +x q[22]; +x q[1]; +cx q[41], q[52]; +cx q[15], q[28]; +cx q[4], q[7]; +cx q[5], q[37]; +cx q[23], q[31]; +cx q[19], q[13]; +cx q[10], q[11]; +x q[10]; +x q[47]; +x q[6]; +x q[39]; +x q[4]; +x q[13]; +x q[26]; +x q[9]; +x q[14]; +x q[2]; +x q[11]; +x q[27]; +x q[1]; +x q[21]; +x q[49]; +x q[36]; +x q[0]; +x q[28]; +cx q[34], q[41]; +cx q[45], q[30]; +cx q[7], q[8]; +cx q[40], q[23]; +cx q[50], q[19]; +cx q[15], q[46]; +cx q[35], q[48]; +cx q[24], q[3]; +cx q[5], q[37]; +cx q[18], q[12]; +cx q[43], q[29]; +cx q[17], q[44]; +cx q[32], q[51]; +cx q[42], q[16]; +cx q[31], q[22]; +x q[8]; +x q[4]; +x q[3]; +x q[23]; +x q[27]; +x q[35]; +x q[13]; +x q[50]; +x q[15]; +x q[44]; +x q[45]; +x q[19]; +x q[7]; +x q[49]; +x q[26]; +x q[25]; +x q[20]; +x q[39]; +x q[17]; +x q[32]; +x q[12]; +x q[5]; +x q[1]; +x q[51]; +x q[43]; +x q[42]; +cx q[34], q[41]; +cx q[31], q[52]; +cx q[10], q[11]; +cx q[14], q[9]; +cx q[37], q[2]; +cx q[24], q[46]; +cx q[38], q[36]; +cx q[21], q[0]; +cx q[29], q[33]; +cx q[47], q[6]; +cx q[30], q[18]; +cx q[28], q[40]; +x q[41]; +x q[25]; +x q[44]; +x q[49]; +x q[3]; +x q[40]; +x q[16]; +x q[18]; +x q[21]; +x q[43]; +x q[32]; +x q[14]; +x q[47]; +x q[12]; +x q[50]; +x q[35]; +x q[34]; +x q[42]; +x q[48]; +x q[6]; +x q[51]; +x q[30]; +x q[0]; +x q[26]; +x q[28]; +x q[36]; +cx q[7], q[8]; +cx q[29], q[33]; +cx q[17], q[1]; +cx q[27], q[39]; +cx q[24], q[46]; +cx q[31], q[52]; +cx q[19], q[13]; +cx q[37], q[2]; +cx q[10], q[11]; +x q[41]; +x q[37]; +x q[45]; +x q[10]; +x q[18]; +x q[12]; +x q[50]; +x q[11]; +x q[52]; +x q[26]; +x q[22]; +x q[30]; +x q[35]; +x q[4]; +x q[49]; +x q[2]; +x q[25]; +x q[19]; +x q[16]; +cx q[14], q[9]; +cx q[43], q[44]; +cx q[38], q[36]; +cx q[42], q[34]; +cx q[21], q[0]; +cx q[23], q[31]; +cx q[27], q[39]; +cx q[28], q[40]; +cx q[13], q[5]; +cx q[47], q[6]; +cx q[29], q[33]; +cx q[17], q[1]; +cx q[32], q[51]; +cx q[7], q[8]; +cx q[24], q[3]; +cx q[15], q[46]; +x q[41]; +x q[3]; +x q[18]; +x q[25]; +x q[47]; +x q[27]; +x q[34]; +x q[0]; +x q[2]; +x q[38]; +x q[14]; +x q[19]; +x q[42]; +x q[13]; +x q[35]; +x q[52]; +x q[6]; +x q[9]; +x q[28]; +x q[44]; +x q[11]; +x q[20]; +x q[48]; +x q[5]; +x q[30]; +x q[12]; +cx q[45], q[4]; +cx q[40], q[23]; +cx q[39], q[26]; +cx q[32], q[51]; +cx q[36], q[43]; +cx q[50], q[16]; +cx q[29], q[33]; +cx q[49], q[10]; +cx q[7], q[8]; +cx q[1], q[21]; +cx q[31], q[22]; +cx q[24], q[46]; +x q[31]; +x q[9]; +x q[46]; +x q[5]; +x q[7]; +x q[44]; +x q[34]; +x q[33]; +x q[29]; +x q[28]; +x q[45]; +x q[22]; +x q[42]; +x q[0]; +x q[30]; +x q[49]; +x q[11]; +x q[8]; +x q[18]; +x q[21]; +x q[23]; +x q[2]; +x q[51]; +x q[15]; +x q[37]; +x q[40]; +x q[26]; +x q[14]; +x q[25]; +x q[10]; +cx q[41], q[52]; +cx q[27], q[39]; +cx q[19], q[13]; +cx q[47], q[6]; +cx q[20], q[17]; +cx q[36], q[43]; +cx q[50], q[16]; +cx q[24], q[3]; +cx q[35], q[48]; +x q[19]; +x q[37]; +x q[14]; +x q[34]; +x q[1]; +x q[29]; +x q[35]; +x q[48]; +x q[3]; +x q[24]; +x q[27]; +x q[12]; +x q[22]; +x q[50]; +x q[6]; +x q[7]; +x q[20]; +x q[38]; +x q[26]; +x q[0]; +x q[46]; +cx q[41], q[52]; +cx q[10], q[11]; +cx q[51], q[47]; +cx q[23], q[31]; +cx q[28], q[40]; +cx q[42], q[16]; +cx q[13], q[5]; +cx q[36], q[43]; +cx q[33], q[25]; +cx q[17], q[44]; +cx q[39], q[2]; +cx q[30], q[18]; +cx q[21], q[49]; +cx q[45], q[4]; +x q[43]; +x q[8]; +x q[3]; +x q[26]; +x q[47]; +x q[18]; +x q[25]; +x q[20]; +x q[46]; +x q[36]; +x q[34]; +x q[42]; +x q[11]; +x q[13]; +x q[27]; +x q[24]; +x q[45]; +x q[30]; +x q[12]; +x q[22]; +x q[1]; +x q[38]; +x q[9]; +x q[4]; +x q[16]; +x q[19]; +cx q[41], q[52]; +cx q[17], q[44]; +cx q[28], q[40]; +cx q[49], q[10]; +cx q[5], q[37]; +cx q[23], q[31]; +cx q[32], q[51]; +cx q[29], q[33]; +cx q[39], q[2]; +cx q[35], q[48]; +cx q[6], q[14]; +x q[52]; +x q[19]; +x q[13]; +x q[25]; +x q[28]; +x q[33]; +x q[40]; +x q[49]; +x q[22]; +x q[5]; +x q[18]; +x q[6]; +x q[34]; +x q[10]; +x q[30]; +x q[45]; +x q[16]; +x q[23]; +x q[21]; +x q[31]; +x q[29]; +x q[15]; +cx q[20], q[17]; +cx q[35], q[48]; +cx q[24], q[46]; +cx q[36], q[43]; +cx q[39], q[26]; +cx q[32], q[8]; +cx q[37], q[2]; +cx q[11], q[50]; +cx q[4], q[7]; +cx q[14], q[0]; +cx q[51], q[47]; +cx q[12], q[38]; diff --git a/test/benchmarks/qasm/54QBT_25CYC_QSE_3.qasm b/test/benchmarks/qasm/54QBT_25CYC_QSE_3.qasm new file mode 100644 index 000000000000..4910c35dfec6 --- /dev/null +++ b/test/benchmarks/qasm/54QBT_25CYC_QSE_3.qasm @@ -0,0 +1,966 @@ +// Originally source from the QUEKO benchmark suite +// https://github.com/UCLA-VAST/QUEKO-benchmark +// A benchmark that is near-term feasible for Google Sycamore with a optimal +// soluation depth of 25 +OPENQASM 2.0; +include "qelib1.inc"; +qreg q[54]; +x q[36]; +x q[24]; +x q[13]; +x q[22]; +x q[47]; +x q[1]; +x q[23]; +x q[11]; +x q[25]; +x q[46]; +x q[15]; +x q[44]; +x q[27]; +x q[8]; +x q[39]; +x q[3]; +x q[12]; +x q[52]; +x q[18]; +x q[0]; +x q[21]; +x q[26]; +x q[16]; +x q[51]; +x q[33]; +x q[9]; +cx q[43], q[50]; +cx q[7], q[45]; +cx q[28], q[5]; +cx q[35], q[32]; +cx q[42], q[34]; +cx q[29], q[48]; +cx q[49], q[41]; +cx q[6], q[14]; +cx q[17], q[53]; +cx q[30], q[4]; +cx q[40], q[19]; +cx q[31], q[20]; +x q[36]; +x q[8]; +x q[31]; +x q[50]; +x q[43]; +x q[16]; +x q[25]; +x q[52]; +x q[26]; +x q[5]; +x q[27]; +x q[35]; +x q[12]; +x q[14]; +x q[34]; +x q[51]; +x q[38]; +x q[47]; +x q[2]; +x q[28]; +x q[6]; +x q[20]; +x q[29]; +x q[44]; +x q[1]; +x q[53]; +x q[9]; +cx q[37], q[21]; +cx q[46], q[23]; +cx q[48], q[11]; +cx q[39], q[30]; +cx q[49], q[4]; +cx q[17], q[22]; +cx q[19], q[13]; +cx q[10], q[41]; +cx q[7], q[45]; +x q[37]; +x q[19]; +x q[10]; +x q[39]; +x q[30]; +x q[7]; +x q[13]; +x q[50]; +x q[22]; +x q[21]; +x q[51]; +x q[38]; +x q[29]; +x q[44]; +x q[20]; +x q[45]; +x q[16]; +x q[9]; +x q[1]; +x q[28]; +x q[3]; +x q[32]; +x q[18]; +x q[24]; +x q[2]; +x q[43]; +x q[40]; +cx q[36], q[17]; +cx q[49], q[4]; +cx q[34], q[26]; +cx q[8], q[47]; +cx q[53], q[25]; +cx q[15], q[35]; +cx q[11], q[6]; +cx q[27], q[42]; +cx q[46], q[23]; +cx q[41], q[52]; +cx q[33], q[31]; +x q[17]; +x q[25]; +x q[27]; +x q[21]; +x q[48]; +x q[47]; +x q[41]; +x q[14]; +x q[1]; +x q[39]; +x q[18]; +x q[24]; +x q[37]; +x q[36]; +x q[10]; +x q[49]; +x q[5]; +x q[2]; +x q[42]; +x q[13]; +x q[15]; +x q[50]; +x q[45]; +x q[28]; +x q[35]; +x q[22]; +cx q[31], q[20]; +cx q[11], q[6]; +cx q[7], q[43]; +cx q[12], q[38]; +cx q[3], q[29]; +cx q[46], q[23]; +cx q[16], q[26]; +cx q[40], q[33]; +cx q[19], q[8]; +cx q[4], q[9]; +x q[33]; +x q[21]; +x q[0]; +x q[51]; +x q[1]; +x q[36]; +x q[46]; +x q[18]; +x q[27]; +x q[23]; +x q[52]; +x q[44]; +x q[48]; +x q[3]; +x q[34]; +x q[28]; +x q[24]; +x q[29]; +x q[12]; +x q[15]; +x q[25]; +x q[2]; +x q[31]; +x q[49]; +cx q[17], q[53]; +cx q[22], q[39]; +cx q[43], q[50]; +cx q[38], q[45]; +cx q[19], q[8]; +cx q[35], q[32]; +cx q[42], q[16]; +cx q[26], q[14]; +cx q[5], q[40]; +cx q[4], q[9]; +cx q[7], q[37]; +cx q[10], q[41]; +cx q[11], q[6]; +x q[9]; +x q[24]; +x q[22]; +x q[21]; +x q[6]; +x q[29]; +x q[4]; +x q[37]; +x q[14]; +x q[36]; +x q[23]; +x q[3]; +x q[30]; +x q[32]; +x q[35]; +x q[46]; +x q[50]; +x q[39]; +x q[15]; +x q[43]; +x q[12]; +x q[34]; +x q[20]; +x q[26]; +x q[10]; +x q[52]; +cx q[17], q[53]; +cx q[13], q[47]; +cx q[31], q[44]; +cx q[40], q[19]; +cx q[25], q[51]; +cx q[7], q[45]; +cx q[5], q[18]; +cx q[42], q[16]; +cx q[28], q[1]; +cx q[2], q[27]; +cx q[38], q[0]; +cx q[48], q[11]; +cx q[49], q[41]; +cx q[33], q[8]; +x q[17]; +x q[16]; +x q[51]; +x q[37]; +x q[47]; +x q[19]; +x q[35]; +x q[3]; +x q[53]; +x q[26]; +x q[7]; +x q[13]; +x q[20]; +x q[5]; +x q[33]; +x q[31]; +x q[0]; +x q[32]; +x q[28]; +x q[10]; +x q[24]; +x q[6]; +x q[29]; +x q[21]; +x q[12]; +x q[9]; +cx q[25], q[30]; +cx q[8], q[44]; +cx q[38], q[48]; +cx q[22], q[39]; +cx q[45], q[11]; +cx q[46], q[23]; +cx q[1], q[40]; +cx q[2], q[27]; +cx q[43], q[50]; +cx q[4], q[52]; +cx q[49], q[41]; +cx q[36], q[34]; +x q[17]; +x q[37]; +x q[44]; +x q[42]; +x q[32]; +x q[26]; +x q[21]; +x q[18]; +x q[50]; +x q[13]; +x q[1]; +x q[19]; +x q[29]; +x q[51]; +x q[22]; +x q[9]; +x q[14]; +x q[43]; +x q[12]; +x q[39]; +x q[15]; +x q[46]; +x q[35]; +x q[49]; +cx q[45], q[11]; +cx q[6], q[24]; +cx q[38], q[0]; +cx q[27], q[3]; +cx q[30], q[4]; +cx q[40], q[33]; +cx q[53], q[25]; +cx q[36], q[34]; +cx q[28], q[5]; +cx q[41], q[20]; +cx q[10], q[31]; +x q[17]; +x q[10]; +x q[29]; +x q[24]; +x q[8]; +x q[13]; +x q[20]; +x q[2]; +x q[33]; +x q[9]; +x q[48]; +x q[15]; +x q[47]; +x q[51]; +x q[31]; +x q[43]; +x q[12]; +x q[27]; +x q[44]; +x q[36]; +x q[22]; +x q[39]; +x q[4]; +x q[23]; +x q[5]; +x q[18]; +x q[45]; +x q[3]; +x q[19]; +x q[21]; +x q[40]; +x q[52]; +cx q[34], q[26]; +cx q[35], q[32]; +cx q[7], q[37]; +cx q[28], q[1]; +cx q[30], q[46]; +cx q[53], q[25]; +cx q[14], q[49]; +cx q[16], q[6]; +cx q[38], q[0]; +x q[17]; +x q[40]; +x q[52]; +x q[51]; +x q[39]; +x q[21]; +x q[11]; +x q[18]; +x q[9]; +x q[15]; +x q[44]; +x q[47]; +x q[43]; +x q[37]; +x q[38]; +x q[34]; +x q[23]; +x q[0]; +x q[14]; +x q[12]; +x q[29]; +x q[32]; +x q[20]; +x q[48]; +x q[4]; +x q[46]; +x q[30]; +x q[26]; +x q[28]; +x q[36]; +x q[42]; +x q[10]; +cx q[53], q[25]; +cx q[50], q[5]; +cx q[35], q[2]; +cx q[19], q[8]; +cx q[33], q[31]; +cx q[6], q[24]; +cx q[7], q[45]; +cx q[27], q[3]; +x q[17]; +x q[43]; +x q[29]; +x q[47]; +x q[33]; +x q[13]; +x q[30]; +x q[12]; +x q[22]; +x q[24]; +x q[52]; +x q[40]; +x q[32]; +x q[18]; +x q[48]; +x q[20]; +x q[5]; +x q[31]; +x q[9]; +x q[4]; +x q[41]; +cx q[25], q[51]; +cx q[11], q[1]; +cx q[39], q[49]; +cx q[45], q[28]; +cx q[16], q[6]; +cx q[35], q[2]; +cx q[46], q[23]; +cx q[27], q[3]; +cx q[42], q[34]; +cx q[19], q[8]; +cx q[7], q[37]; +cx q[26], q[14]; +x q[4]; +x q[30]; +x q[34]; +x q[51]; +x q[13]; +x q[5]; +x q[0]; +x q[43]; +x q[27]; +x q[1]; +x q[46]; +x q[12]; +x q[21]; +x q[40]; +x q[26]; +x q[2]; +x q[50]; +x q[23]; +x q[20]; +x q[36]; +x q[15]; +x q[22]; +x q[10]; +x q[9]; +x q[28]; +x q[44]; +x q[25]; +x q[3]; +cx q[17], q[53]; +cx q[38], q[45]; +cx q[41], q[52]; +cx q[6], q[14]; +cx q[7], q[37]; +cx q[24], q[33]; +cx q[29], q[48]; +cx q[35], q[32]; +cx q[18], q[19]; +cx q[42], q[16]; +cx q[39], q[49]; +x q[47]; +x q[3]; +x q[36]; +x q[48]; +x q[13]; +x q[2]; +x q[28]; +x q[37]; +x q[11]; +x q[33]; +x q[27]; +x q[0]; +x q[30]; +x q[43]; +x q[10]; +x q[22]; +x q[21]; +x q[24]; +x q[31]; +x q[7]; +x q[44]; +x q[1]; +x q[50]; +x q[20]; +cx q[32], q[17]; +cx q[46], q[23]; +cx q[42], q[16]; +cx q[4], q[9]; +cx q[39], q[49]; +cx q[25], q[51]; +cx q[5], q[40]; +cx q[38], q[45]; +cx q[18], q[19]; +cx q[41], q[52]; +cx q[6], q[14]; +cx q[15], q[35]; +cx q[29], q[12]; +cx q[34], q[26]; +x q[32]; +x q[18]; +x q[39]; +x q[2]; +x q[51]; +x q[33]; +x q[35]; +x q[47]; +x q[6]; +x q[38]; +x q[1]; +x q[45]; +x q[27]; +x q[49]; +x q[43]; +x q[42]; +x q[50]; +x q[52]; +x q[12]; +x q[37]; +x q[11]; +x q[53]; +x q[13]; +x q[21]; +x q[17]; +x q[8]; +x q[46]; +cx q[26], q[14]; +cx q[31], q[44]; +cx q[3], q[29]; +cx q[48], q[16]; +cx q[36], q[34]; +cx q[40], q[19]; +cx q[4], q[9]; +cx q[10], q[41]; +cx q[28], q[5]; +cx q[22], q[25]; +cx q[0], q[7]; +x q[1]; +x q[46]; +x q[42]; +x q[41]; +x q[19]; +x q[36]; +x q[45]; +x q[52]; +x q[44]; +x q[25]; +x q[34]; +x q[20]; +x q[7]; +x q[0]; +x q[51]; +x q[49]; +x q[40]; +x q[26]; +x q[22]; +x q[39]; +x q[11]; +x q[9]; +x q[15]; +x q[8]; +x q[10]; +x q[16]; +x q[14]; +x q[50]; +x q[13]; +x q[5]; +cx q[35], q[32]; +cx q[6], q[24]; +cx q[37], q[21]; +cx q[29], q[48]; +cx q[12], q[38]; +cx q[27], q[3]; +cx q[17], q[53]; +cx q[43], q[28]; +cx q[33], q[31]; +x q[32]; +x q[38]; +x q[22]; +x q[53]; +x q[34]; +x q[39]; +x q[50]; +x q[51]; +x q[36]; +x q[11]; +x q[48]; +x q[30]; +x q[46]; +x q[6]; +x q[45]; +x q[49]; +x q[5]; +x q[17]; +x q[9]; +x q[4]; +x q[25]; +x q[41]; +x q[52]; +x q[23]; +x q[13]; +x q[2]; +x q[0]; +cx q[7], q[37]; +cx q[31], q[20]; +cx q[29], q[12]; +cx q[18], q[19]; +cx q[15], q[35]; +cx q[26], q[14]; +cx q[40], q[33]; +cx q[8], q[44]; +cx q[21], q[43]; +cx q[42], q[16]; +cx q[27], q[3]; +cx q[1], q[24]; +x q[32]; +x q[15]; +x q[39]; +x q[44]; +x q[13]; +x q[46]; +x q[7]; +x q[17]; +x q[51]; +x q[47]; +x q[41]; +x q[8]; +x q[14]; +x q[53]; +x q[5]; +x q[10]; +x q[22]; +x q[50]; +x q[20]; +x q[2]; +x q[12]; +x q[42]; +x q[38]; +x q[23]; +x q[3]; +x q[48]; +x q[34]; +x q[49]; +x q[35]; +x q[0]; +x q[43]; +cx q[18], q[19]; +cx q[27], q[36]; +cx q[33], q[31]; +cx q[16], q[26]; +cx q[1], q[24]; +cx q[4], q[9]; +cx q[37], q[21]; +cx q[11], q[6]; +cx q[25], q[30]; +cx q[45], q[28]; +x q[32]; +x q[9]; +x q[19]; +x q[35]; +x q[11]; +x q[51]; +x q[36]; +x q[41]; +x q[38]; +x q[48]; +x q[47]; +x q[29]; +x q[0]; +x q[53]; +x q[10]; +x q[7]; +x q[18]; +x q[8]; +x q[45]; +x q[13]; +x q[12]; +x q[43]; +x q[52]; +x q[4]; +x q[34]; +x q[3]; +x q[23]; +x q[28]; +x q[25]; +x q[15]; +x q[40]; +cx q[2], q[27]; +cx q[37], q[21]; +cx q[26], q[39]; +cx q[17], q[22]; +cx q[50], q[5]; +cx q[42], q[16]; +cx q[31], q[44]; +cx q[24], q[33]; +cx q[30], q[46]; +x q[19]; +x q[50]; +x q[12]; +x q[53]; +x q[40]; +x q[34]; +x q[24]; +x q[1]; +x q[0]; +x q[8]; +x q[2]; +x q[17]; +x q[25]; +x q[43]; +x q[29]; +x q[3]; +x q[51]; +x q[37]; +x q[15]; +x q[52]; +x q[22]; +x q[28]; +x q[36]; +x q[20]; +x q[31]; +x q[21]; +x q[11]; +x q[5]; +x q[23]; +cx q[35], q[32]; +cx q[26], q[39]; +cx q[27], q[42]; +cx q[49], q[41]; +cx q[7], q[45]; +cx q[38], q[48]; +cx q[30], q[4]; +cx q[16], q[6]; +cx q[46], q[9]; +cx q[14], q[10]; +x q[30]; +x q[52]; +x q[48]; +x q[37]; +x q[12]; +x q[11]; +x q[6]; +x q[41]; +x q[19]; +x q[42]; +x q[16]; +x q[8]; +x q[18]; +x q[23]; +x q[35]; +x q[15]; +x q[34]; +x q[1]; +x q[0]; +x q[13]; +x q[3]; +x q[36]; +x q[22]; +x q[14]; +x q[20]; +x q[24]; +x q[44]; +cx q[32], q[17]; +cx q[7], q[45]; +cx q[53], q[25]; +cx q[43], q[28]; +cx q[4], q[9]; +cx q[51], q[46]; +cx q[2], q[27]; +cx q[40], q[33]; +cx q[26], q[39]; +cx q[50], q[5]; +x q[17]; +x q[10]; +x q[13]; +x q[47]; +x q[31]; +x q[36]; +x q[50]; +x q[44]; +x q[2]; +x q[30]; +x q[27]; +x q[46]; +x q[41]; +x q[34]; +x q[22]; +x q[53]; +x q[23]; +x q[37]; +x q[51]; +x q[15]; +x q[20]; +x q[48]; +x q[12]; +x q[9]; +x q[18]; +x q[42]; +x q[19]; +x q[16]; +x q[52]; +x q[4]; +cx q[1], q[24]; +cx q[14], q[49]; +cx q[33], q[8]; +cx q[26], q[39]; +cx q[38], q[0]; +cx q[3], q[29]; +cx q[5], q[40]; +cx q[11], q[6]; +cx q[35], q[32]; +cx q[43], q[28]; +cx q[7], q[45]; +x q[24]; +x q[16]; +x q[25]; +x q[30]; +x q[31]; +x q[29]; +x q[21]; +x q[9]; +x q[52]; +x q[33]; +x q[4]; +x q[53]; +x q[44]; +x q[15]; +x q[51]; +x q[0]; +x q[10]; +x q[27]; +x q[8]; +x q[22]; +x q[35]; +cx q[36], q[17]; +cx q[38], q[48]; +cx q[11], q[1]; +cx q[40], q[19]; +cx q[39], q[49]; +cx q[46], q[23]; +cx q[41], q[20]; +cx q[7], q[43]; +cx q[5], q[18]; +cx q[6], q[14]; +cx q[13], q[47]; +cx q[45], q[28]; +cx q[42], q[34]; +x q[37]; +x q[42]; +x q[53]; +x q[0]; +x q[33]; +x q[24]; +x q[35]; +x q[49]; +x q[28]; +x q[20]; +x q[44]; +x q[51]; +x q[14]; +x q[22]; +x q[3]; +x q[18]; +x q[40]; +x q[26]; +x q[45]; +x q[31]; +x q[8]; +x q[1]; +x q[7]; +x q[23]; +x q[21]; +x q[10]; +x q[25]; +x q[19]; +x q[41]; +x q[15]; +cx q[32], q[17]; +cx q[48], q[11]; +cx q[4], q[52]; +cx q[43], q[50]; +cx q[36], q[34]; +cx q[13], q[47]; +cx q[16], q[6]; +cx q[29], q[12]; +cx q[39], q[30]; +cx q[46], q[9]; +x q[17]; +x q[32]; +x q[48]; +x q[43]; +x q[35]; +x q[5]; +x q[38]; +x q[20]; +x q[0]; +x q[1]; +x q[13]; +x q[50]; +x q[41]; +x q[2]; +x q[21]; +x q[22]; +x q[11]; +x q[44]; +x q[15]; +x q[6]; +x q[31]; +x q[23]; +x q[25]; +x q[28]; +x q[53]; +x q[3]; +x q[26]; +x q[27]; +x q[45]; +cx q[29], q[12]; +cx q[40], q[33]; +cx q[42], q[16]; +cx q[14], q[49]; +cx q[39], q[30]; +cx q[51], q[46]; +cx q[24], q[10]; +cx q[18], q[19]; +cx q[36], q[34]; +cx q[4], q[52]; +x q[17]; +x q[34]; +x q[23]; +x q[22]; +x q[12]; +x q[37]; +x q[21]; +x q[35]; +x q[52]; +x q[15]; +x q[28]; +x q[43]; +x q[31]; +x q[41]; +x q[20]; +x q[46]; +x q[1]; +x q[36]; +x q[9]; +x q[10]; +x q[24]; +x q[51]; +x q[30]; +x q[49]; +x q[47]; +x q[3]; +x q[0]; +x q[26]; +x q[39]; +x q[44]; +x q[38]; +x q[18]; +x q[50]; +x q[4]; +cx q[2], q[27]; +cx q[19], q[13]; +cx q[53], q[25]; +cx q[33], q[8]; +cx q[48], q[16]; +cx q[7], q[45]; +cx q[5], q[40]; +cx q[11], q[6]; +cx q[29], q[42]; diff --git a/test/benchmarks/qasm/__init__.py b/test/benchmarks/qasm/__init__.py new file mode 100644 index 000000000000..c7325a848299 --- /dev/null +++ b/test/benchmarks/qasm/__init__.py @@ -0,0 +1,11 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. diff --git a/test/benchmarks/qasm/depth_4gt10-v1_81.qasm b/test/benchmarks/qasm/depth_4gt10-v1_81.qasm new file mode 100644 index 000000000000..8db19386f9f6 --- /dev/null +++ b/test/benchmarks/qasm/depth_4gt10-v1_81.qasm @@ -0,0 +1,152 @@ +OPENQASM 2.0; +include "qelib1.inc"; +qreg q[16]; +creg c[16]; +x q[0]; +h q[1]; +t q[2]; +t q[3]; +t q[1]; +cx q[3],q[2]; +cx q[1],q[3]; +cx q[2],q[1]; +tdg q[3]; +cx q[2],q[3]; +tdg q[2]; +tdg q[3]; +t q[1]; +cx q[1],q[3]; +cx q[2],q[1]; +cx q[3],q[2]; +h q[1]; +h q[3]; +t q[0]; +t q[4]; +t q[3]; +cx q[4],q[0]; +cx q[3],q[4]; +cx q[0],q[3]; +tdg q[4]; +cx q[0],q[4]; +tdg q[0]; +tdg q[4]; +t q[3]; +cx q[3],q[4]; +cx q[0],q[3]; +cx q[4],q[0]; +h q[3]; +h q[1]; +t q[2]; +t q[3]; +t q[1]; +cx q[3],q[2]; +cx q[1],q[3]; +cx q[2],q[1]; +tdg q[3]; +cx q[2],q[3]; +tdg q[2]; +tdg q[3]; +t q[1]; +cx q[1],q[3]; +cx q[2],q[1]; +cx q[3],q[2]; +h q[1]; +h q[3]; +t q[0]; +t q[4]; +t q[3]; +cx q[4],q[0]; +cx q[3],q[4]; +cx q[0],q[3]; +tdg q[4]; +cx q[0],q[4]; +tdg q[0]; +tdg q[4]; +t q[3]; +cx q[3],q[4]; +cx q[0],q[3]; +cx q[4],q[0]; +h q[3]; +cx q[2],q[0]; +h q[2]; +t q[3]; +t q[0]; +t q[2]; +cx q[0],q[3]; +cx q[2],q[0]; +cx q[3],q[2]; +tdg q[0]; +cx q[3],q[0]; +tdg q[3]; +tdg q[0]; +t q[2]; +cx q[2],q[0]; +cx q[3],q[2]; +cx q[0],q[3]; +h q[2]; +h q[0]; +t q[1]; +t q[4]; +t q[0]; +cx q[4],q[1]; +cx q[0],q[4]; +cx q[1],q[0]; +tdg q[4]; +cx q[1],q[4]; +tdg q[1]; +tdg q[4]; +t q[0]; +cx q[0],q[4]; +cx q[1],q[0]; +cx q[4],q[1]; +h q[0]; +h q[2]; +t q[3]; +t q[0]; +t q[2]; +cx q[0],q[3]; +cx q[2],q[0]; +cx q[3],q[2]; +tdg q[0]; +cx q[3],q[0]; +tdg q[3]; +tdg q[0]; +t q[2]; +cx q[2],q[0]; +cx q[3],q[2]; +cx q[0],q[3]; +h q[2]; +h q[0]; +t q[1]; +t q[4]; +t q[0]; +cx q[4],q[1]; +cx q[0],q[4]; +cx q[1],q[0]; +tdg q[4]; +cx q[1],q[4]; +tdg q[1]; +tdg q[4]; +t q[0]; +cx q[0],q[4]; +cx q[1],q[0]; +cx q[4],q[1]; +h q[0]; +cx q[1],q[4]; +cx q[4],q[2]; +h q[4]; +t q[2]; +t q[0]; +t q[4]; +cx q[0],q[2]; +cx q[4],q[0]; +cx q[2],q[4]; +tdg q[0]; +cx q[2],q[0]; +tdg q[2]; +tdg q[0]; +t q[4]; +cx q[4],q[0]; +cx q[2],q[4]; +cx q[0],q[2]; +h q[4]; diff --git a/test/benchmarks/qasm/depth_4mod5-v0_19.qasm b/test/benchmarks/qasm/depth_4mod5-v0_19.qasm new file mode 100644 index 000000000000..c402a60948e5 --- /dev/null +++ b/test/benchmarks/qasm/depth_4mod5-v0_19.qasm @@ -0,0 +1,39 @@ +OPENQASM 2.0; +include "qelib1.inc"; +qreg q[16]; +creg c[16]; +x q[3]; +cx q[1],q[3]; +cx q[3],q[4]; +h q[4]; +t q[3]; +t q[2]; +t q[4]; +cx q[2],q[3]; +cx q[4],q[2]; +cx q[3],q[4]; +tdg q[2]; +cx q[3],q[2]; +tdg q[3]; +tdg q[2]; +t q[4]; +cx q[4],q[2]; +cx q[3],q[4]; +cx q[2],q[3]; +h q[4]; +h q[4]; +t q[3]; +t q[0]; +t q[4]; +cx q[0],q[3]; +cx q[4],q[0]; +cx q[3],q[4]; +tdg q[0]; +cx q[3],q[0]; +tdg q[3]; +tdg q[0]; +t q[4]; +cx q[4],q[0]; +cx q[3],q[4]; +cx q[0],q[3]; +h q[4]; diff --git a/test/benchmarks/qasm/depth_mod8-10_178.qasm b/test/benchmarks/qasm/depth_mod8-10_178.qasm new file mode 100644 index 000000000000..090258d1a91c --- /dev/null +++ b/test/benchmarks/qasm/depth_mod8-10_178.qasm @@ -0,0 +1,346 @@ +OPENQASM 2.0; +include "qelib1.inc"; +qreg q[16]; +creg c[16]; +h q[2]; +t q[4]; +t q[3]; +t q[2]; +cx q[3],q[4]; +cx q[2],q[3]; +cx q[4],q[2]; +tdg q[3]; +cx q[4],q[3]; +tdg q[4]; +tdg q[3]; +t q[2]; +cx q[2],q[3]; +cx q[4],q[2]; +cx q[3],q[4]; +h q[2]; +cx q[4],q[2]; +cx q[1],q[3]; +h q[5]; +t q[4]; +t q[3]; +t q[5]; +cx q[3],q[4]; +cx q[5],q[3]; +cx q[4],q[5]; +tdg q[3]; +cx q[4],q[3]; +tdg q[4]; +tdg q[3]; +t q[5]; +cx q[5],q[3]; +cx q[4],q[5]; +cx q[3],q[4]; +h q[5]; +h q[1]; +t q[5]; +t q[4]; +t q[1]; +cx q[4],q[5]; +cx q[1],q[4]; +cx q[5],q[1]; +tdg q[4]; +cx q[5],q[4]; +tdg q[5]; +tdg q[4]; +t q[1]; +cx q[1],q[4]; +cx q[5],q[1]; +cx q[4],q[5]; +h q[1]; +h q[4]; +t q[2]; +t q[0]; +t q[4]; +cx q[0],q[2]; +cx q[4],q[0]; +cx q[2],q[4]; +tdg q[0]; +cx q[2],q[0]; +tdg q[2]; +tdg q[0]; +t q[4]; +cx q[4],q[0]; +cx q[2],q[4]; +cx q[0],q[2]; +h q[4]; +h q[1]; +t q[5]; +t q[4]; +t q[1]; +cx q[4],q[5]; +cx q[1],q[4]; +cx q[5],q[1]; +tdg q[4]; +cx q[5],q[4]; +tdg q[5]; +tdg q[4]; +t q[1]; +cx q[1],q[4]; +cx q[5],q[1]; +cx q[4],q[5]; +h q[1]; +h q[4]; +t q[2]; +t q[0]; +t q[4]; +cx q[0],q[2]; +cx q[4],q[0]; +cx q[2],q[4]; +tdg q[0]; +cx q[2],q[0]; +tdg q[2]; +tdg q[0]; +t q[4]; +cx q[4],q[0]; +cx q[2],q[4]; +cx q[0],q[2]; +h q[4]; +h q[5]; +t q[4]; +t q[3]; +t q[5]; +cx q[3],q[4]; +cx q[5],q[3]; +cx q[4],q[5]; +tdg q[3]; +cx q[4],q[3]; +tdg q[4]; +tdg q[3]; +t q[5]; +cx q[5],q[3]; +cx q[4],q[5]; +cx q[3],q[4]; +h q[5]; +h q[1]; +t q[5]; +t q[4]; +t q[1]; +cx q[4],q[5]; +cx q[1],q[4]; +cx q[5],q[1]; +tdg q[4]; +cx q[5],q[4]; +tdg q[5]; +tdg q[4]; +t q[1]; +cx q[1],q[4]; +cx q[5],q[1]; +cx q[4],q[5]; +h q[1]; +h q[4]; +t q[2]; +t q[0]; +t q[4]; +cx q[0],q[2]; +cx q[4],q[0]; +cx q[2],q[4]; +tdg q[0]; +cx q[2],q[0]; +tdg q[2]; +tdg q[0]; +t q[4]; +cx q[4],q[0]; +cx q[2],q[4]; +cx q[0],q[2]; +h q[4]; +h q[1]; +t q[5]; +t q[4]; +t q[1]; +cx q[4],q[5]; +cx q[1],q[4]; +cx q[5],q[1]; +tdg q[4]; +cx q[5],q[4]; +tdg q[5]; +tdg q[4]; +t q[1]; +cx q[1],q[4]; +cx q[5],q[1]; +cx q[4],q[5]; +h q[1]; +h q[4]; +t q[2]; +t q[0]; +t q[4]; +cx q[0],q[2]; +cx q[4],q[0]; +cx q[2],q[4]; +tdg q[0]; +cx q[2],q[0]; +tdg q[2]; +tdg q[0]; +t q[4]; +cx q[4],q[0]; +cx q[2],q[4]; +cx q[0],q[2]; +h q[4]; +cx q[1],q[3]; +h q[5]; +t q[4]; +t q[2]; +t q[5]; +cx q[2],q[4]; +cx q[5],q[2]; +cx q[4],q[5]; +tdg q[2]; +cx q[4],q[2]; +tdg q[4]; +tdg q[2]; +t q[5]; +cx q[5],q[2]; +cx q[4],q[5]; +cx q[2],q[4]; +h q[5]; +h q[3]; +t q[5]; +t q[4]; +t q[3]; +cx q[4],q[5]; +cx q[3],q[4]; +cx q[5],q[3]; +tdg q[4]; +cx q[5],q[4]; +tdg q[5]; +tdg q[4]; +t q[3]; +cx q[3],q[4]; +cx q[5],q[3]; +cx q[4],q[5]; +h q[3]; +h q[4]; +t q[1]; +t q[0]; +t q[4]; +cx q[0],q[1]; +cx q[4],q[0]; +cx q[1],q[4]; +tdg q[0]; +cx q[1],q[0]; +tdg q[1]; +tdg q[0]; +t q[4]; +cx q[4],q[0]; +cx q[1],q[4]; +cx q[0],q[1]; +h q[4]; +h q[3]; +t q[5]; +t q[4]; +t q[3]; +cx q[4],q[5]; +cx q[3],q[4]; +cx q[5],q[3]; +tdg q[4]; +cx q[5],q[4]; +tdg q[5]; +tdg q[4]; +t q[3]; +cx q[3],q[4]; +cx q[5],q[3]; +cx q[4],q[5]; +h q[3]; +h q[4]; +t q[1]; +t q[0]; +t q[4]; +cx q[0],q[1]; +cx q[4],q[0]; +cx q[1],q[4]; +tdg q[0]; +cx q[1],q[0]; +tdg q[1]; +tdg q[0]; +t q[4]; +cx q[4],q[0]; +cx q[1],q[4]; +cx q[0],q[1]; +h q[4]; +h q[5]; +t q[4]; +t q[2]; +t q[5]; +cx q[2],q[4]; +cx q[5],q[2]; +cx q[4],q[5]; +tdg q[2]; +cx q[4],q[2]; +tdg q[4]; +tdg q[2]; +t q[5]; +cx q[5],q[2]; +cx q[4],q[5]; +cx q[2],q[4]; +h q[5]; +h q[3]; +t q[5]; +t q[4]; +t q[3]; +cx q[4],q[5]; +cx q[3],q[4]; +cx q[5],q[3]; +tdg q[4]; +cx q[5],q[4]; +tdg q[5]; +tdg q[4]; +t q[3]; +cx q[3],q[4]; +cx q[5],q[3]; +cx q[4],q[5]; +h q[3]; +h q[4]; +t q[1]; +t q[0]; +t q[4]; +cx q[0],q[1]; +cx q[4],q[0]; +cx q[1],q[4]; +tdg q[0]; +cx q[1],q[0]; +tdg q[1]; +tdg q[0]; +t q[4]; +cx q[4],q[0]; +cx q[1],q[4]; +cx q[0],q[1]; +h q[4]; +h q[3]; +t q[5]; +t q[4]; +t q[3]; +cx q[4],q[5]; +cx q[3],q[4]; +cx q[5],q[3]; +tdg q[4]; +cx q[5],q[4]; +tdg q[5]; +tdg q[4]; +t q[3]; +cx q[3],q[4]; +cx q[5],q[3]; +cx q[4],q[5]; +h q[3]; +h q[4]; +t q[1]; +t q[0]; +t q[4]; +cx q[0],q[1]; +cx q[4],q[0]; +cx q[1],q[4]; +tdg q[0]; +cx q[1],q[0]; +tdg q[1]; +tdg q[0]; +t q[4]; +cx q[4],q[0]; +cx q[1],q[4]; +cx q[0],q[1]; +h q[4]; +cx q[4],q[3]; +cx q[4],q[2]; +x q[4]; diff --git a/test/benchmarks/qasm/pea_3_pi_8.qasm b/test/benchmarks/qasm/pea_3_pi_8.qasm new file mode 100644 index 000000000000..c9953bf91d98 --- /dev/null +++ b/test/benchmarks/qasm/pea_3_pi_8.qasm @@ -0,0 +1,51 @@ +// Name of Experiment: pea_3*pi/8 v3 + +OPENQASM 2.0; +include "qelib1.inc"; + + +qreg q[5]; +creg c[4]; +gate cu1fixed (a) c,t { +u1 (-a) t; +cx c,t; +u1 (a) t; +cx c,t; +} +gate cu c,t { +cu1fixed (3*pi/8) c,t; +} + +h q[0]; +h q[1]; +h q[2]; +h q[3]; +cu q[3],q[4]; +cu q[2],q[4]; +cu q[2],q[4]; +cu q[1],q[4]; +cu q[1],q[4]; +cu q[1],q[4]; +cu q[1],q[4]; +cu q[0],q[4]; +cu q[0],q[4]; +cu q[0],q[4]; +cu q[0],q[4]; +cu q[0],q[4]; +cu q[0],q[4]; +cu q[0],q[4]; +cu q[0],q[4]; +h q[0]; +cu1(-pi/2) q[0],q[1]; +h q[1]; +cu1(-pi/4) q[0],q[2]; +cu1(-pi/2) q[1],q[2]; +h q[2]; +cu1(-pi/8) q[0],q[3]; +cu1(-pi/4) q[1],q[3]; +cu1(-pi/2) q[2],q[3]; +h q[3]; +measure q[0] -> c[0]; +measure q[1] -> c[1]; +measure q[2] -> c[2]; +measure q[3] -> c[3]; diff --git a/test/benchmarks/qasm/test_eoh_qasm.qasm b/test/benchmarks/qasm/test_eoh_qasm.qasm new file mode 100644 index 000000000000..d0bd6728bc60 --- /dev/null +++ b/test/benchmarks/qasm/test_eoh_qasm.qasm @@ -0,0 +1,3509 @@ +OPENQASM 2.0; +include "qelib1.inc"; +qreg q[2]; +u3(1.81601579278081,0,0) q[1]; +cx q[1],q[0]; +u3(0.282876323465342,0,0) q[0]; +cx q[1],q[0]; +u3(1.79619280826017,0,0) q[0]; + +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.000724567026336298) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +cx q[0],q[1]; +u1(0.00679198609867374) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u1(-0.00550515131412464) q[1]; +u3(pi/2,-pi/2,pi/2) q[0]; +u3(pi/2,-pi/2,pi/2) q[1]; +cx q[0],q[1]; +u1(0.00446908620956922) q[1]; +cx q[0],q[1]; +u3(-pi/2,-pi/2,pi/2) q[0]; +u3(-pi/2,-pi/2,pi/2) q[1]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(-0.00767779564284270) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +cx q[0],q[1]; +u1(0.0234616911265225) q[1]; +cx q[0],q[1]; +u2(0.0,pi) q[0]; +u2(0.0,pi) q[1]; +u2(0.0,pi) q[1]; +u1(0.0114893260817785) q[1]; +u2(0.0,pi) q[1]; +u1(0.00893526017156342) q[0]; +u2(0.0,pi) q[0]; +u1(0.0168841346050307) q[0]; +u2(0.0,pi) q[0]; \ No newline at end of file diff --git a/test/benchmarks/qasm/time_cnt3-5_179.qasm b/test/benchmarks/qasm/time_cnt3-5_179.qasm new file mode 100644 index 000000000000..8ab1eb252015 --- /dev/null +++ b/test/benchmarks/qasm/time_cnt3-5_179.qasm @@ -0,0 +1,179 @@ +OPENQASM 2.0; +include "qelib1.inc"; +qreg q[16]; +creg c[16]; +cx q[12],q[15]; +h q[12]; +t q[14]; +t q[13]; +t q[12]; +cx q[13],q[14]; +cx q[12],q[13]; +cx q[14],q[12]; +tdg q[13]; +cx q[14],q[13]; +tdg q[14]; +tdg q[13]; +t q[12]; +cx q[12],q[13]; +cx q[14],q[12]; +cx q[13],q[14]; +h q[12]; +cx q[12],q[15]; +h q[14]; +t q[15]; +t q[13]; +t q[14]; +cx q[13],q[15]; +cx q[14],q[13]; +cx q[15],q[14]; +tdg q[13]; +cx q[15],q[13]; +tdg q[15]; +tdg q[13]; +t q[14]; +cx q[14],q[13]; +cx q[15],q[14]; +cx q[13],q[15]; +h q[14]; +cx q[13],q[15]; +cx q[9],q[11]; +h q[9]; +t q[10]; +t q[12]; +t q[9]; +cx q[12],q[10]; +cx q[9],q[12]; +cx q[10],q[9]; +tdg q[12]; +cx q[10],q[12]; +tdg q[10]; +tdg q[12]; +t q[9]; +cx q[9],q[12]; +cx q[10],q[9]; +cx q[12],q[10]; +h q[9]; +cx q[9],q[11]; +h q[10]; +t q[11]; +t q[12]; +t q[10]; +cx q[12],q[11]; +cx q[10],q[12]; +cx q[11],q[10]; +tdg q[12]; +cx q[11],q[12]; +tdg q[11]; +tdg q[12]; +t q[10]; +cx q[10],q[12]; +cx q[11],q[10]; +cx q[12],q[11]; +h q[10]; +cx q[12],q[11]; +cx q[6],q[8]; +h q[6]; +t q[7]; +t q[9]; +t q[6]; +cx q[9],q[7]; +cx q[6],q[9]; +cx q[7],q[6]; +tdg q[9]; +cx q[7],q[9]; +tdg q[7]; +tdg q[9]; +t q[6]; +cx q[6],q[9]; +cx q[7],q[6]; +cx q[9],q[7]; +h q[6]; +cx q[6],q[8]; +h q[7]; +t q[8]; +t q[9]; +t q[7]; +cx q[9],q[8]; +cx q[7],q[9]; +cx q[8],q[7]; +tdg q[9]; +cx q[8],q[9]; +tdg q[8]; +tdg q[9]; +t q[7]; +cx q[7],q[9]; +cx q[8],q[7]; +cx q[9],q[8]; +h q[7]; +cx q[9],q[8]; +cx q[3],q[5]; +h q[3]; +t q[4]; +t q[6]; +t q[3]; +cx q[6],q[4]; +cx q[3],q[6]; +cx q[4],q[3]; +tdg q[6]; +cx q[4],q[6]; +tdg q[4]; +tdg q[6]; +t q[3]; +cx q[3],q[6]; +cx q[4],q[3]; +cx q[6],q[4]; +h q[3]; +cx q[3],q[5]; +h q[4]; +t q[5]; +t q[6]; +t q[4]; +cx q[6],q[5]; +cx q[4],q[6]; +cx q[5],q[4]; +tdg q[6]; +cx q[5],q[6]; +tdg q[5]; +tdg q[6]; +t q[4]; +cx q[4],q[6]; +cx q[5],q[4]; +cx q[6],q[5]; +h q[4]; +cx q[6],q[5]; +cx q[0],q[2]; +h q[0]; +t q[1]; +t q[3]; +t q[0]; +cx q[3],q[1]; +cx q[0],q[3]; +cx q[1],q[0]; +tdg q[3]; +cx q[1],q[3]; +tdg q[1]; +tdg q[3]; +t q[0]; +cx q[0],q[3]; +cx q[1],q[0]; +cx q[3],q[1]; +h q[0]; +cx q[0],q[2]; +h q[1]; +t q[2]; +t q[3]; +t q[1]; +cx q[3],q[2]; +cx q[1],q[3]; +cx q[2],q[1]; +tdg q[3]; +cx q[2],q[3]; +tdg q[2]; +tdg q[3]; +t q[1]; +cx q[1],q[3]; +cx q[2],q[1]; +cx q[3],q[2]; +h q[1]; +cx q[3],q[2]; diff --git a/test/benchmarks/qasm/time_cnt3-5_180.qasm b/test/benchmarks/qasm/time_cnt3-5_180.qasm new file mode 100644 index 000000000000..7fdc0f0c90f4 --- /dev/null +++ b/test/benchmarks/qasm/time_cnt3-5_180.qasm @@ -0,0 +1,489 @@ +OPENQASM 2.0; +include "qelib1.inc"; +qreg q[16]; +creg c[16]; +h q[15]; +t q[13]; +t q[14]; +t q[15]; +cx q[14],q[13]; +cx q[15],q[14]; +cx q[13],q[15]; +tdg q[14]; +cx q[13],q[14]; +tdg q[13]; +tdg q[14]; +t q[15]; +cx q[15],q[14]; +cx q[13],q[15]; +cx q[14],q[13]; +h q[15]; +h q[12]; +t q[13]; +t q[11]; +t q[12]; +cx q[11],q[13]; +cx q[12],q[11]; +cx q[13],q[12]; +tdg q[11]; +cx q[13],q[11]; +tdg q[13]; +tdg q[11]; +t q[12]; +cx q[12],q[11]; +cx q[13],q[12]; +cx q[11],q[13]; +h q[12]; +h q[11]; +t q[15]; +t q[14]; +t q[11]; +cx q[14],q[15]; +cx q[11],q[14]; +cx q[15],q[11]; +tdg q[14]; +cx q[15],q[14]; +tdg q[15]; +tdg q[14]; +t q[11]; +cx q[11],q[14]; +cx q[15],q[11]; +cx q[14],q[15]; +h q[11]; +h q[12]; +t q[13]; +t q[11]; +t q[12]; +cx q[11],q[13]; +cx q[12],q[11]; +cx q[13],q[12]; +tdg q[11]; +cx q[13],q[11]; +tdg q[13]; +tdg q[11]; +t q[12]; +cx q[12],q[11]; +cx q[13],q[12]; +cx q[11],q[13]; +h q[12]; +h q[11]; +t q[15]; +t q[14]; +t q[11]; +cx q[14],q[15]; +cx q[11],q[14]; +cx q[15],q[11]; +tdg q[14]; +cx q[15],q[14]; +tdg q[15]; +tdg q[14]; +t q[11]; +cx q[11],q[14]; +cx q[15],q[11]; +cx q[14],q[15]; +h q[11]; +h q[14]; +t q[15]; +t q[13]; +t q[14]; +cx q[13],q[15]; +cx q[14],q[13]; +cx q[15],q[14]; +tdg q[13]; +cx q[15],q[13]; +tdg q[15]; +tdg q[13]; +t q[14]; +cx q[14],q[13]; +cx q[15],q[14]; +cx q[13],q[15]; +h q[14]; +cx q[13],q[15]; +h q[11]; +t q[12]; +t q[10]; +t q[11]; +cx q[10],q[12]; +cx q[11],q[10]; +cx q[12],q[11]; +tdg q[10]; +cx q[12],q[10]; +tdg q[12]; +tdg q[10]; +t q[11]; +cx q[11],q[10]; +cx q[12],q[11]; +cx q[10],q[12]; +h q[11]; +h q[9]; +t q[12]; +t q[15]; +t q[9]; +cx q[15],q[12]; +cx q[9],q[15]; +cx q[12],q[9]; +tdg q[15]; +cx q[12],q[15]; +tdg q[12]; +tdg q[15]; +t q[9]; +cx q[9],q[15]; +cx q[12],q[9]; +cx q[15],q[12]; +h q[9]; +h q[15]; +t q[11]; +t q[10]; +t q[15]; +cx q[10],q[11]; +cx q[15],q[10]; +cx q[11],q[15]; +tdg q[10]; +cx q[11],q[10]; +tdg q[11]; +tdg q[10]; +t q[15]; +cx q[15],q[10]; +cx q[11],q[15]; +cx q[10],q[11]; +h q[15]; +h q[9]; +t q[12]; +t q[15]; +t q[9]; +cx q[15],q[12]; +cx q[9],q[15]; +cx q[12],q[9]; +tdg q[15]; +cx q[12],q[15]; +tdg q[12]; +tdg q[15]; +t q[9]; +cx q[9],q[15]; +cx q[12],q[9]; +cx q[15],q[12]; +h q[9]; +h q[15]; +t q[11]; +t q[10]; +t q[15]; +cx q[10],q[11]; +cx q[15],q[10]; +cx q[11],q[15]; +tdg q[10]; +cx q[11],q[10]; +tdg q[11]; +tdg q[10]; +t q[15]; +cx q[15],q[10]; +cx q[11],q[15]; +cx q[10],q[11]; +h q[15]; +h q[10]; +t q[11]; +t q[12]; +t q[10]; +cx q[12],q[11]; +cx q[10],q[12]; +cx q[11],q[10]; +tdg q[12]; +cx q[11],q[12]; +tdg q[11]; +tdg q[12]; +t q[10]; +cx q[10],q[12]; +cx q[11],q[10]; +cx q[12],q[11]; +h q[10]; +cx q[12],q[11]; +h q[8]; +t q[9]; +t q[7]; +t q[8]; +cx q[7],q[9]; +cx q[8],q[7]; +cx q[9],q[8]; +tdg q[7]; +cx q[9],q[7]; +tdg q[9]; +tdg q[7]; +t q[8]; +cx q[8],q[7]; +cx q[9],q[8]; +cx q[7],q[9]; +h q[8]; +h q[6]; +t q[9]; +t q[15]; +t q[6]; +cx q[15],q[9]; +cx q[6],q[15]; +cx q[9],q[6]; +tdg q[15]; +cx q[9],q[15]; +tdg q[9]; +tdg q[15]; +t q[6]; +cx q[6],q[15]; +cx q[9],q[6]; +cx q[15],q[9]; +h q[6]; +h q[15]; +t q[8]; +t q[7]; +t q[15]; +cx q[7],q[8]; +cx q[15],q[7]; +cx q[8],q[15]; +tdg q[7]; +cx q[8],q[7]; +tdg q[8]; +tdg q[7]; +t q[15]; +cx q[15],q[7]; +cx q[8],q[15]; +cx q[7],q[8]; +h q[15]; +h q[6]; +t q[9]; +t q[15]; +t q[6]; +cx q[15],q[9]; +cx q[6],q[15]; +cx q[9],q[6]; +tdg q[15]; +cx q[9],q[15]; +tdg q[9]; +tdg q[15]; +t q[6]; +cx q[6],q[15]; +cx q[9],q[6]; +cx q[15],q[9]; +h q[6]; +h q[15]; +t q[8]; +t q[7]; +t q[15]; +cx q[7],q[8]; +cx q[15],q[7]; +cx q[8],q[15]; +tdg q[7]; +cx q[8],q[7]; +tdg q[8]; +tdg q[7]; +t q[15]; +cx q[15],q[7]; +cx q[8],q[15]; +cx q[7],q[8]; +h q[15]; +h q[7]; +t q[8]; +t q[9]; +t q[7]; +cx q[9],q[8]; +cx q[7],q[9]; +cx q[8],q[7]; +tdg q[9]; +cx q[8],q[9]; +tdg q[8]; +tdg q[9]; +t q[7]; +cx q[7],q[9]; +cx q[8],q[7]; +cx q[9],q[8]; +h q[7]; +cx q[9],q[8]; +h q[5]; +t q[6]; +t q[4]; +t q[5]; +cx q[4],q[6]; +cx q[5],q[4]; +cx q[6],q[5]; +tdg q[4]; +cx q[6],q[4]; +tdg q[6]; +tdg q[4]; +t q[5]; +cx q[5],q[4]; +cx q[6],q[5]; +cx q[4],q[6]; +h q[5]; +h q[3]; +t q[6]; +t q[15]; +t q[3]; +cx q[15],q[6]; +cx q[3],q[15]; +cx q[6],q[3]; +tdg q[15]; +cx q[6],q[15]; +tdg q[6]; +tdg q[15]; +t q[3]; +cx q[3],q[15]; +cx q[6],q[3]; +cx q[15],q[6]; +h q[3]; +h q[15]; +t q[5]; +t q[4]; +t q[15]; +cx q[4],q[5]; +cx q[15],q[4]; +cx q[5],q[15]; +tdg q[4]; +cx q[5],q[4]; +tdg q[5]; +tdg q[4]; +t q[15]; +cx q[15],q[4]; +cx q[5],q[15]; +cx q[4],q[5]; +h q[15]; +h q[3]; +t q[6]; +t q[15]; +t q[3]; +cx q[15],q[6]; +cx q[3],q[15]; +cx q[6],q[3]; +tdg q[15]; +cx q[6],q[15]; +tdg q[6]; +tdg q[15]; +t q[3]; +cx q[3],q[15]; +cx q[6],q[3]; +cx q[15],q[6]; +h q[3]; +h q[15]; +t q[5]; +t q[4]; +t q[15]; +cx q[4],q[5]; +cx q[15],q[4]; +cx q[5],q[15]; +tdg q[4]; +cx q[5],q[4]; +tdg q[5]; +tdg q[4]; +t q[15]; +cx q[15],q[4]; +cx q[5],q[15]; +cx q[4],q[5]; +h q[15]; +h q[4]; +t q[5]; +t q[6]; +t q[4]; +cx q[6],q[5]; +cx q[4],q[6]; +cx q[5],q[4]; +tdg q[6]; +cx q[5],q[6]; +tdg q[5]; +tdg q[6]; +t q[4]; +cx q[4],q[6]; +cx q[5],q[4]; +cx q[6],q[5]; +h q[4]; +cx q[6],q[5]; +h q[2]; +t q[3]; +t q[1]; +t q[2]; +cx q[1],q[3]; +cx q[2],q[1]; +cx q[3],q[2]; +tdg q[1]; +cx q[3],q[1]; +tdg q[3]; +tdg q[1]; +t q[2]; +cx q[2],q[1]; +cx q[3],q[2]; +cx q[1],q[3]; +h q[2]; +h q[0]; +t q[3]; +t q[15]; +t q[0]; +cx q[15],q[3]; +cx q[0],q[15]; +cx q[3],q[0]; +tdg q[15]; +cx q[3],q[15]; +tdg q[3]; +tdg q[15]; +t q[0]; +cx q[0],q[15]; +cx q[3],q[0]; +cx q[15],q[3]; +h q[0]; +h q[15]; +t q[2]; +t q[1]; +t q[15]; +cx q[1],q[2]; +cx q[15],q[1]; +cx q[2],q[15]; +tdg q[1]; +cx q[2],q[1]; +tdg q[2]; +tdg q[1]; +t q[15]; +cx q[15],q[1]; +cx q[2],q[15]; +cx q[1],q[2]; +h q[15]; +h q[0]; +t q[3]; +t q[15]; +t q[0]; +cx q[15],q[3]; +cx q[0],q[15]; +cx q[3],q[0]; +tdg q[15]; +cx q[3],q[15]; +tdg q[3]; +tdg q[15]; +t q[0]; +cx q[0],q[15]; +cx q[3],q[0]; +cx q[15],q[3]; +h q[0]; +h q[15]; +t q[2]; +t q[1]; +t q[15]; +cx q[1],q[2]; +cx q[15],q[1]; +cx q[2],q[15]; +tdg q[1]; +cx q[2],q[1]; +tdg q[2]; +tdg q[1]; +t q[15]; +cx q[15],q[1]; +cx q[2],q[15]; +cx q[1],q[2]; +h q[15]; +h q[1]; +t q[2]; +t q[3]; +t q[1]; +cx q[3],q[2]; +cx q[1],q[3]; +cx q[2],q[1]; +tdg q[3]; +cx q[2],q[3]; +tdg q[2]; +tdg q[3]; +t q[1]; +cx q[1],q[3]; +cx q[2],q[1]; +cx q[3],q[2]; +h q[1]; +cx q[3],q[2]; diff --git a/test/benchmarks/qasm/time_qft_16.qasm b/test/benchmarks/qasm/time_qft_16.qasm new file mode 100644 index 000000000000..0984ed46f6ca --- /dev/null +++ b/test/benchmarks/qasm/time_qft_16.qasm @@ -0,0 +1,516 @@ +OPENQASM 2.0; +include "qelib1.inc"; +qreg q[16]; +creg c[16]; +h q[0]; +rz(-0.7854) q[0]; +cx q[0],q[1]; +rz(0.7854) q[0]; +cx q[0],q[1]; +rz(-0.3927) q[0]; +cx q[0],q[2]; +rz(0.3927) q[0]; +cx q[0],q[2]; +rz(-0.19635) q[0]; +cx q[0],q[3]; +rz(0.19635) q[0]; +cx q[0],q[3]; +rz(-0.09815) q[0]; +cx q[0],q[4]; +rz(0.09815) q[0]; +cx q[0],q[4]; +rz(-0.0491) q[0]; +cx q[0],q[5]; +rz(0.0491) q[0]; +cx q[0],q[5]; +rz(-0.02455) q[0]; +cx q[0],q[6]; +rz(0.02455) q[0]; +cx q[0],q[6]; +rz(-0.01225) q[0]; +cx q[0],q[7]; +rz(0.01225) q[0]; +cx q[0],q[7]; +rz(-0.00615) q[0]; +cx q[0],q[8]; +rz(0.00615) q[0]; +cx q[0],q[8]; +rz(-0.00305) q[0]; +cx q[0],q[9]; +rz(0.00305) q[0]; +cx q[0],q[9]; +rz(-0.00155) q[0]; +cx q[0],q[10]; +rz(0.00155) q[0]; +cx q[0],q[10]; +rz(-0.00075) q[0]; +cx q[0],q[11]; +rz(0.00075) q[0]; +cx q[0],q[11]; +rz(-0.0004) q[0]; +cx q[0],q[12]; +rz(0.0004) q[0]; +cx q[0],q[12]; +rz(-0.0002) q[0]; +cx q[0],q[13]; +rz(0.0002) q[0]; +cx q[0],q[13]; +rz(-0.0001) q[0]; +cx q[0],q[14]; +rz(0.0001) q[0]; +cx q[0],q[14]; +rz(-0.00005) q[0]; +cx q[0],q[15]; +rz(0.00005) q[0]; +cx q[0],q[15]; +h q[1]; +rz(-0.7854) q[1]; +cx q[1],q[2]; +rz(0.7854) q[1]; +cx q[1],q[2]; +rz(-0.3927) q[1]; +cx q[1],q[3]; +rz(0.3927) q[1]; +cx q[1],q[3]; +rz(-0.19635) q[1]; +cx q[1],q[4]; +rz(0.19635) q[1]; +cx q[1],q[4]; +rz(-0.09815) q[1]; +cx q[1],q[5]; +rz(0.09815) q[1]; +cx q[1],q[5]; +rz(-0.0491) q[1]; +cx q[1],q[6]; +rz(0.0491) q[1]; +cx q[1],q[6]; +rz(-0.02455) q[1]; +cx q[1],q[7]; +rz(0.02455) q[1]; +cx q[1],q[7]; +rz(-0.01225) q[1]; +cx q[1],q[8]; +rz(0.01225) q[1]; +cx q[1],q[8]; +rz(-0.00615) q[1]; +cx q[1],q[9]; +rz(0.00615) q[1]; +cx q[1],q[9]; +rz(-0.00305) q[1]; +cx q[1],q[10]; +rz(0.00305) q[1]; +cx q[1],q[10]; +rz(-0.00155) q[1]; +cx q[1],q[11]; +rz(0.00155) q[1]; +cx q[1],q[11]; +rz(-0.00075) q[1]; +cx q[1],q[12]; +rz(0.00075) q[1]; +cx q[1],q[12]; +rz(-0.0004) q[1]; +cx q[1],q[13]; +rz(0.0004) q[1]; +cx q[1],q[13]; +rz(-0.0002) q[1]; +cx q[1],q[14]; +rz(0.0002) q[1]; +cx q[1],q[14]; +rz(-0.0001) q[1]; +cx q[1],q[15]; +rz(0.0001) q[1]; +cx q[1],q[15]; +h q[2]; +rz(-0.7854) q[2]; +cx q[2],q[3]; +rz(0.7854) q[2]; +cx q[2],q[3]; +rz(-0.3927) q[2]; +cx q[2],q[4]; +rz(0.3927) q[2]; +cx q[2],q[4]; +rz(-0.19635) q[2]; +cx q[2],q[5]; +rz(0.19635) q[2]; +cx q[2],q[5]; +rz(-0.09815) q[2]; +cx q[2],q[6]; +rz(0.09815) q[2]; +cx q[2],q[6]; +rz(-0.0491) q[2]; +cx q[2],q[7]; +rz(0.0491) q[2]; +cx q[2],q[7]; +rz(-0.02455) q[2]; +cx q[2],q[8]; +rz(0.02455) q[2]; +cx q[2],q[8]; +rz(-0.01225) q[2]; +cx q[2],q[9]; +rz(0.01225) q[2]; +cx q[2],q[9]; +rz(-0.00615) q[2]; +cx q[2],q[10]; +rz(0.00615) q[2]; +cx q[2],q[10]; +rz(-0.00305) q[2]; +cx q[2],q[11]; +rz(0.00305) q[2]; +cx q[2],q[11]; +rz(-0.00155) q[2]; +cx q[2],q[12]; +rz(0.00155) q[2]; +cx q[2],q[12]; +rz(-0.00075) q[2]; +cx q[2],q[13]; +rz(0.00075) q[2]; +cx q[2],q[13]; +rz(-0.0004) q[2]; +cx q[2],q[14]; +rz(0.0004) q[2]; +cx q[2],q[14]; +rz(-0.0002) q[2]; +cx q[2],q[15]; +rz(0.0002) q[2]; +cx q[2],q[15]; +h q[3]; +rz(-0.7854) q[3]; +cx q[3],q[4]; +rz(0.7854) q[3]; +cx q[3],q[4]; +rz(-0.3927) q[3]; +cx q[3],q[5]; +rz(0.3927) q[3]; +cx q[3],q[5]; +rz(-0.19635) q[3]; +cx q[3],q[6]; +rz(0.19635) q[3]; +cx q[3],q[6]; +rz(-0.09815) q[3]; +cx q[3],q[7]; +rz(0.09815) q[3]; +cx q[3],q[7]; +rz(-0.0491) q[3]; +cx q[3],q[8]; +rz(0.0491) q[3]; +cx q[3],q[8]; +rz(-0.02455) q[3]; +cx q[3],q[9]; +rz(0.02455) q[3]; +cx q[3],q[9]; +rz(-0.01225) q[3]; +cx q[3],q[10]; +rz(0.01225) q[3]; +cx q[3],q[10]; +rz(-0.00615) q[3]; +cx q[3],q[11]; +rz(0.00615) q[3]; +cx q[3],q[11]; +rz(-0.00305) q[3]; +cx q[3],q[12]; +rz(0.00305) q[3]; +cx q[3],q[12]; +rz(-0.00155) q[3]; +cx q[3],q[13]; +rz(0.00155) q[3]; +cx q[3],q[13]; +rz(-0.00075) q[3]; +cx q[3],q[14]; +rz(0.00075) q[3]; +cx q[3],q[14]; +rz(-0.0004) q[3]; +cx q[3],q[15]; +rz(0.0004) q[3]; +cx q[3],q[15]; +h q[4]; +rz(-0.7854) q[4]; +cx q[4],q[5]; +rz(0.7854) q[4]; +cx q[4],q[5]; +rz(-0.3927) q[4]; +cx q[4],q[6]; +rz(0.3927) q[4]; +cx q[4],q[6]; +rz(-0.19635) q[4]; +cx q[4],q[7]; +rz(0.19635) q[4]; +cx q[4],q[7]; +rz(-0.09815) q[4]; +cx q[4],q[8]; +rz(0.09815) q[4]; +cx q[4],q[8]; +rz(-0.0491) q[4]; +cx q[4],q[9]; +rz(0.0491) q[4]; +cx q[4],q[9]; +rz(-0.02455) q[4]; +cx q[4],q[10]; +rz(0.02455) q[4]; +cx q[4],q[10]; +rz(-0.01225) q[4]; +cx q[4],q[11]; +rz(0.01225) q[4]; +cx q[4],q[11]; +rz(-0.00615) q[4]; +cx q[4],q[12]; +rz(0.00615) q[4]; +cx q[4],q[12]; +rz(-0.00305) q[4]; +cx q[4],q[13]; +rz(0.00305) q[4]; +cx q[4],q[13]; +rz(-0.00155) q[4]; +cx q[4],q[14]; +rz(0.00155) q[4]; +cx q[4],q[14]; +rz(-0.00075) q[4]; +cx q[4],q[15]; +rz(0.00075) q[4]; +cx q[4],q[15]; +h q[5]; +rz(-0.7854) q[5]; +cx q[5],q[6]; +rz(0.7854) q[5]; +cx q[5],q[6]; +rz(-0.3927) q[5]; +cx q[5],q[7]; +rz(0.3927) q[5]; +cx q[5],q[7]; +rz(-0.19635) q[5]; +cx q[5],q[8]; +rz(0.19635) q[5]; +cx q[5],q[8]; +rz(-0.09815) q[5]; +cx q[5],q[9]; +rz(0.09815) q[5]; +cx q[5],q[9]; +rz(-0.0491) q[5]; +cx q[5],q[10]; +rz(0.0491) q[5]; +cx q[5],q[10]; +rz(-0.02455) q[5]; +cx q[5],q[11]; +rz(0.02455) q[5]; +cx q[5],q[11]; +rz(-0.01225) q[5]; +cx q[5],q[12]; +rz(0.01225) q[5]; +cx q[5],q[12]; +rz(-0.00615) q[5]; +cx q[5],q[13]; +rz(0.00615) q[5]; +cx q[5],q[13]; +rz(-0.00305) q[5]; +cx q[5],q[14]; +rz(0.00305) q[5]; +cx q[5],q[14]; +rz(-0.00155) q[5]; +cx q[5],q[15]; +rz(0.00155) q[5]; +cx q[5],q[15]; +h q[6]; +rz(-0.7854) q[6]; +cx q[6],q[7]; +rz(0.7854) q[6]; +cx q[6],q[7]; +rz(-0.3927) q[6]; +cx q[6],q[8]; +rz(0.3927) q[6]; +cx q[6],q[8]; +rz(-0.19635) q[6]; +cx q[6],q[9]; +rz(0.19635) q[6]; +cx q[6],q[9]; +rz(-0.09815) q[6]; +cx q[6],q[10]; +rz(0.09815) q[6]; +cx q[6],q[10]; +rz(-0.0491) q[6]; +cx q[6],q[11]; +rz(0.0491) q[6]; +cx q[6],q[11]; +rz(-0.02455) q[6]; +cx q[6],q[12]; +rz(0.02455) q[6]; +cx q[6],q[12]; +rz(-0.01225) q[6]; +cx q[6],q[13]; +rz(0.01225) q[6]; +cx q[6],q[13]; +rz(-0.00615) q[6]; +cx q[6],q[14]; +rz(0.00615) q[6]; +cx q[6],q[14]; +rz(-0.00305) q[6]; +cx q[6],q[15]; +rz(0.00305) q[6]; +cx q[6],q[15]; +h q[7]; +rz(-0.7854) q[7]; +cx q[7],q[8]; +rz(0.7854) q[7]; +cx q[7],q[8]; +rz(-0.3927) q[7]; +cx q[7],q[9]; +rz(0.3927) q[7]; +cx q[7],q[9]; +rz(-0.19635) q[7]; +cx q[7],q[10]; +rz(0.19635) q[7]; +cx q[7],q[10]; +rz(-0.09815) q[7]; +cx q[7],q[11]; +rz(0.09815) q[7]; +cx q[7],q[11]; +rz(-0.0491) q[7]; +cx q[7],q[12]; +rz(0.0491) q[7]; +cx q[7],q[12]; +rz(-0.02455) q[7]; +cx q[7],q[13]; +rz(0.02455) q[7]; +cx q[7],q[13]; +rz(-0.01225) q[7]; +cx q[7],q[14]; +rz(0.01225) q[7]; +cx q[7],q[14]; +rz(-0.00615) q[7]; +cx q[7],q[15]; +rz(0.00615) q[7]; +cx q[7],q[15]; +h q[8]; +rz(-0.7854) q[8]; +cx q[8],q[9]; +rz(0.7854) q[8]; +cx q[8],q[9]; +rz(-0.3927) q[8]; +cx q[8],q[10]; +rz(0.3927) q[8]; +cx q[8],q[10]; +rz(-0.19635) q[8]; +cx q[8],q[11]; +rz(0.19635) q[8]; +cx q[8],q[11]; +rz(-0.09815) q[8]; +cx q[8],q[12]; +rz(0.09815) q[8]; +cx q[8],q[12]; +rz(-0.0491) q[8]; +cx q[8],q[13]; +rz(0.0491) q[8]; +cx q[8],q[13]; +rz(-0.02455) q[8]; +cx q[8],q[14]; +rz(0.02455) q[8]; +cx q[8],q[14]; +rz(-0.01225) q[8]; +cx q[8],q[15]; +rz(0.01225) q[8]; +cx q[8],q[15]; +h q[9]; +rz(-0.7854) q[9]; +cx q[9],q[10]; +rz(0.7854) q[9]; +cx q[9],q[10]; +rz(-0.3927) q[9]; +cx q[9],q[11]; +rz(0.3927) q[9]; +cx q[9],q[11]; +rz(-0.19635) q[9]; +cx q[9],q[12]; +rz(0.19635) q[9]; +cx q[9],q[12]; +rz(-0.09815) q[9]; +cx q[9],q[13]; +rz(0.09815) q[9]; +cx q[9],q[13]; +rz(-0.0491) q[9]; +cx q[9],q[14]; +rz(0.0491) q[9]; +cx q[9],q[14]; +rz(-0.02455) q[9]; +cx q[9],q[15]; +rz(0.02455) q[9]; +cx q[9],q[15]; +h q[10]; +rz(-0.7854) q[10]; +cx q[10],q[11]; +rz(0.7854) q[10]; +cx q[10],q[11]; +rz(-0.3927) q[10]; +cx q[10],q[12]; +rz(0.3927) q[10]; +cx q[10],q[12]; +rz(-0.19635) q[10]; +cx q[10],q[13]; +rz(0.19635) q[10]; +cx q[10],q[13]; +rz(-0.09815) q[10]; +cx q[10],q[14]; +rz(0.09815) q[10]; +cx q[10],q[14]; +rz(-0.0491) q[10]; +cx q[10],q[15]; +rz(0.0491) q[10]; +cx q[10],q[15]; +h q[11]; +rz(-0.7854) q[11]; +cx q[11],q[12]; +rz(0.7854) q[11]; +cx q[11],q[12]; +rz(-0.3927) q[11]; +cx q[11],q[13]; +rz(0.3927) q[11]; +cx q[11],q[13]; +rz(-0.19635) q[11]; +cx q[11],q[14]; +rz(0.19635) q[11]; +cx q[11],q[14]; +rz(-0.09815) q[11]; +cx q[11],q[15]; +rz(0.09815) q[11]; +cx q[11],q[15]; +h q[12]; +rz(-0.7854) q[12]; +cx q[12],q[13]; +rz(0.7854) q[12]; +cx q[12],q[13]; +rz(-0.3927) q[12]; +cx q[12],q[14]; +rz(0.3927) q[12]; +cx q[12],q[14]; +rz(-0.19635) q[12]; +cx q[12],q[15]; +rz(0.19635) q[12]; +cx q[12],q[15]; +h q[13]; +rz(-0.7854) q[13]; +cx q[13],q[14]; +rz(0.7854) q[13]; +cx q[13],q[14]; +rz(-0.3927) q[13]; +cx q[13],q[15]; +rz(0.3927) q[13]; +cx q[13],q[15]; +h q[14]; +rz(-0.7854) q[14]; +cx q[14],q[15]; +rz(0.7854) q[14]; +cx q[14],q[15]; +h q[15]; +h q[0]; +h q[1]; +h q[2]; +h q[3]; +h q[4]; +h q[5]; +h q[6]; +h q[7]; +h q[8]; +h q[9]; +h q[10]; +h q[11]; +h q[12]; +h q[13]; +h q[14]; +h q[15]; diff --git a/test/benchmarks/qft.py b/test/benchmarks/qft.py new file mode 100644 index 000000000000..4533ba413cbc --- /dev/null +++ b/test/benchmarks/qft.py @@ -0,0 +1,132 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=missing-docstring,invalid-name,no-member +# pylint: disable=attribute-defined-outside-init + +import itertools +import math + +from qiskit import QuantumRegister, QuantumCircuit +from qiskit.converters import circuit_to_dag +from qiskit.transpiler import CouplingMap +from qiskit.transpiler.passes import SabreSwap + +try: + from qiskit.compiler import transpile +except ImportError: + from qiskit.transpiler import transpile + + +def build_model_circuit(qreg, circuit=None): + """Create quantum fourier transform circuit on quantum register qreg.""" + if circuit is None: + circuit = QuantumCircuit(qreg, name="qft") + + n = len(qreg) + + for i in range(n): + for j in range(i): + # Using negative exponents so we safely underflow to 0 rather than + # raise `OverflowError`. + circuit.cp(math.pi * (2.0 ** (j - i)), qreg[i], qreg[j]) + circuit.h(qreg[i]) + + return circuit + + +class QftTranspileBench: + params = [1, 2, 3, 5, 8, 13, 14] + + def setup(self, n): + qr = QuantumRegister(n) + self.circuit = build_model_circuit(qr) + + def time_ibmq_backend_transpile(self, _): + # Run with ibmq_16_melbourne configuration + coupling_map = [ + [1, 0], + [1, 2], + [2, 3], + [4, 3], + [4, 10], + [5, 4], + [5, 6], + [5, 9], + [6, 8], + [7, 8], + [9, 8], + [9, 10], + [11, 3], + [11, 10], + [11, 12], + [12, 2], + [13, 1], + [13, 12], + ] + transpile( + self.circuit, + basis_gates=["u1", "u2", "u3", "cx", "id"], + coupling_map=coupling_map, + seed_transpiler=20220125, + ) + + +class LargeQFTMappingTimeBench: + timeout = 600.0 # seconds + + heavy_hex_size = {115: 7, 409: 13, 1081: 21} + params = ([115, 409, 1081], ["lookahead", "decay"]) + param_names = ["n_qubits", "heuristic"] + + def setup(self, n_qubits, _heuristic): + qr = QuantumRegister(n_qubits, name="q") + self.dag = circuit_to_dag(build_model_circuit(qr)) + self.coupling = CouplingMap.from_heavy_hex(self.heavy_hex_size[n_qubits]) + + def time_sabre_swap(self, _n_qubits, heuristic): + pass_ = SabreSwap(self.coupling, heuristic, seed=2022_10_27, trials=1) + pass_.run(self.dag) + + +class LargeQFTMappingTrackBench: + timeout = 600.0 # seconds, needs to account for the _entire_ setup. + + heavy_hex_size = {115: 7, 409: 13, 1081: 21} + params = ([115, 409, 1081], ["lookahead", "decay"]) + param_names = ["n_qubits", "heuristic"] + + # The benchmarks take a significant amount of time to run, and we don't + # want to unnecessarily run things twice to get the two pieces of tracking + # information we're interested in. We cheat by using the setup cache to do + # all the calculation work only once, and then each tracker just quickly + # pulls the result from the cache to return, saving the duplication. + + def setup_cache(self): + def setup(n_qubits, heuristic): + qr = QuantumRegister(n_qubits, name="q") + dag = circuit_to_dag(build_model_circuit(qr)) + coupling = CouplingMap.from_heavy_hex(self.heavy_hex_size[n_qubits]) + pass_ = SabreSwap(coupling, heuristic, seed=2022_10_27, trials=1) + return pass_.run(dag) + + state = {} + for params in itertools.product(*self.params): + dag = setup(*params) + state[params] = {"depth": dag.depth(), "size": dag.size()} + return state + + def track_depth_sabre_swap(self, state, *params): + return state[params]["depth"] + + def track_size_sabre_swap(self, state, *params): + return state[params]["size"] diff --git a/test/benchmarks/quantum_info.py b/test/benchmarks/quantum_info.py new file mode 100644 index 000000000000..b4fb8fb67dc0 --- /dev/null +++ b/test/benchmarks/quantum_info.py @@ -0,0 +1,209 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=missing-docstring,invalid-name,no-member +# pylint: disable=attribute-defined-outside-init + +import random + +import numpy as np + +from qiskit.quantum_info import ( + random_clifford, + Clifford, + decompose_clifford, + random_pauli, + SparsePauliOp, +) +from qiskit.quantum_info.operators.symplectic.random import random_pauli_list +from qiskit.quantum_info import random_cnotdihedral, CNOTDihedral + + +class RandomCliffordBench: + params = ["1,3000", "2,2500", "3,2000", "4,1500", "5,1000", "6,700"] + param_names = ["nqubits,length"] + + def time_random_clifford(self, nqubits_length): + (nqubits, length) = map(int, nqubits_length.split(",")) + for _ in range(length): + random_clifford(nqubits) + + +class CliffordComposeBench: + params = ["1,7000", "2,5000", "3,5000", "4,2500", "5,2000"] + param_names = ["nqubits,length"] + + def setup(self, nqubits_length): + (nqubits, length) = map(int, nqubits_length.split(",")) + self.random_clifford = [random_clifford(nqubits) for _ in range(length)] + + def time_compose(self, nqubits_length): + (nqubits, length) = map(int, nqubits_length.split(",")) + clifford = Clifford(np.eye(2 * nqubits)) + for i in range(length): + clifford.compose(self.random_clifford[i]) + + +class CliffordDecomposeBench: + params = ["1,1000", "2,500", "3,100", "4,50", "5,10"] + param_names = ["nqubits,length"] + + def setup(self, nqubits_length): + (nqubits, length) = map(int, nqubits_length.split(",")) + self.random_clifford = [random_clifford(nqubits) for _ in range(length)] + + def time_decompose(self, nqubits_length): + length = int(nqubits_length.split(",")[1]) + for i in range(length): + decompose_clifford(self.random_clifford[i]) + + +class RandomCnotDihedralBench: + params = ["1,2000", "2,1500", "3,1200", "4,1000", "5,800", "6,700"] + param_names = ["nqubits,length"] + + def time_random_cnotdihedral(self, nqubits_length): + (nqubits, length) = map(int, nqubits_length.split(",")) + for _ in range(length): + random_cnotdihedral(nqubits) + + +class CnotDihedralComposeBench: + params = ["1,1500", "2,400", "3,100", "4,40", "5,10"] + param_names = ["nqubits,length"] + + def setup(self, nqubits_length): + (nqubits, length) = map(int, nqubits_length.split(",")) + self.random_cnotdihedral = [random_cnotdihedral(nqubits) for _ in range(length)] + + def time_compose(self, nqubits_length): + (nqubits, length) = map(int, nqubits_length.split(",")) + cxdihedral = CNOTDihedral(num_qubits=nqubits) + for i in range(length): + cxdihedral.compose(self.random_cnotdihedral[i]) + + +class PauliBench: + params = [100, 200, 300, 400, 500] + param_names = ["num_qubits"] + + def setup(self, num_qubits): + self.p1 = random_pauli(num_qubits, True) + self.p2 = random_pauli(num_qubits, True) + + def time_compose(self, _): + self.p1.compose(self.p2) + + def time_evolve(self, _): + self.p1.evolve(self.p2) # by another Pauli, so by composition + + def time_commutes(self, _): + self.p1.commutes(self.p2) + + def time_to_instruction(self, _): + self.p1.to_instruction() + + def time_to_label(self, _): + self.p1.to_label() + + def time_evolve_by_clifford(self, num_qubits): + c1 = random_clifford(num_qubits) + + self.p1.evolve(c1) + + time_evolve_by_clifford.params = [10] + + +class PauliListBench: + params = [[100, 200, 300, 400, 500], [500]] + param_names = ["num_qubits", "length"] + + def setup(self, num_qubits, length): + self.pl1 = random_pauli_list(num_qubits=num_qubits, size=length, phase=True) + self.pl2 = random_pauli_list(num_qubits=num_qubits, size=length, phase=True) + + def time_commutes(self, _, __): + self.pl1.commutes(self.pl2) + + def time_commutes_with_all(self, _, __): + self.pl1.commutes_with_all(self.pl2) + + def time_argsort(self, _, __): + self.pl1.argsort() + + def time_compose(self, _, __): + self.pl1.compose(self.pl2) + + def time_group_qubit_wise_commuting(self, _, __): + self.pl1.group_qubit_wise_commuting() # exercise retworkx-based code + + def time_evolve_by_clifford(self, num_qubits, __): + c1 = random_clifford(num_qubits) + self.pl1.evolve(c1) + + time_evolve_by_clifford.params = [[20], [100]] + + +class PauliListQargsBench: + params = [[100, 200, 300, 400, 500], [500]] + param_names = ["num_qubits", "length"] + + def setup(self, num_qubits, length): + half_qubits = int(num_qubits / 2) + + self.pl1 = random_pauli_list(num_qubits=num_qubits, size=length, phase=True) + self.pl2 = random_pauli_list(num_qubits=half_qubits, size=length, phase=True) + self.qargs = [random.randint(0, num_qubits - 1) for _ in range(half_qubits)] + + def time_commutes_with_qargs(self, _, __): + self.pl1.commutes(self.pl2, self.qargs) + + def time_compose_with_qargs(self, _, __): + self.pl1.compose(self.pl2, self.qargs) + + +class SparsePauliOpBench: + params = [[50, 100, 150, 200], [100]] + param_names = ["num_qubits", "length"] + + def setup(self, num_qubits, length): + self.p1 = SparsePauliOp(random_pauli_list(num_qubits=num_qubits, size=length, phase=True)) + self.p2 = SparsePauliOp(random_pauli_list(num_qubits=num_qubits, size=length, phase=True)) + + def time_compose(self, _, __): + self.p1.compose(self.p2) + + def time_simplify(self, _, __): + self.p1.simplify() + + def time_tensor(self, _, __): + self.p1.tensor(self.p2) + + def time_add(self, _, __): + _ = self.p1 + self.p2 + + time_add.params = [[50, 100, 150, 200], [10000]] + + def time_to_list(self, _, __): + self.p1.to_list() + + time_to_list.params = [[2, 4, 6, 8, 10], [50]] + + def time_to_operator(self, _, __): + self.p1.to_operator() + + time_to_operator.params = [[2, 4, 6, 8, 10], [50]] + + def time_to_matrix(self, _, __): + self.p1.to_matrix() + + time_to_matrix.params = [[2, 4, 6, 8, 10], [50]] diff --git a/test/benchmarks/quantum_volume.py b/test/benchmarks/quantum_volume.py new file mode 100644 index 000000000000..6f45db4edc35 --- /dev/null +++ b/test/benchmarks/quantum_volume.py @@ -0,0 +1,174 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=missing-class-docstring,missing-function-docstring +# pylint: disable=attribute-defined-outside-init + +"""Module for estimating quantum volume. +See arXiv:1811.12926 [quant-ph]""" + +import itertools + +import numpy as np + +from qiskit.compiler import transpile +from qiskit.converters import circuit_to_dag +from qiskit.transpiler import CouplingMap +from qiskit.transpiler.passes import SabreSwap + +from .utils import build_qv_model_circuit + + +class QuantumVolumeBenchmark: + params = ([1, 2, 3, 5, 8, 14, 20, 27], ["translator", "synthesis"]) + param_names = ["Number of Qubits", "Basis Translation Method"] + version = 3 + + def setup(self, width, _): + random_seed = np.random.seed(10) + self.circuit = build_qv_model_circuit(width, width, random_seed) + self.coupling_map = [ + [0, 1], + [1, 0], + [1, 2], + [1, 4], + [2, 1], + [2, 3], + [3, 2], + [3, 5], + [4, 1], + [4, 7], + [5, 3], + [5, 8], + [6, 7], + [7, 4], + [7, 6], + [7, 10], + [8, 5], + [8, 9], + [8, 11], + [9, 8], + [10, 7], + [10, 12], + [11, 8], + [11, 14], + [12, 10], + [12, 13], + [12, 15], + [13, 12], + [13, 14], + [14, 11], + [14, 13], + [14, 16], + [15, 12], + [15, 18], + [16, 14], + [16, 19], + [17, 18], + [18, 15], + [18, 17], + [18, 21], + [19, 16], + [19, 20], + [19, 22], + [20, 19], + [21, 18], + [21, 23], + [22, 19], + [22, 25], + [23, 21], + [23, 24], + [24, 23], + [24, 25], + [25, 22], + [25, 24], + [25, 26], + [26, 25], + ] + self.basis = ["id", "rz", "sx", "x", "cx", "reset"] + + def time_ibmq_backend_transpile(self, _, translation): + transpile( + self.circuit, + basis_gates=self.basis, + coupling_map=self.coupling_map, + translation_method=translation, + seed_transpiler=20220125, + ) + + +class LargeQuantumVolumeMappingTimeBench: + timeout = 600.0 # seconds + heavy_hex_distance = {115: 7, 409: 13, 1081: 21} + allowed_sizes = {(115, 100), (115, 10), (409, 10), (1081, 10)} + n_qubits = sorted({n_qubits for n_qubits, _ in allowed_sizes}) + depths = sorted({depth for _, depth in allowed_sizes}) + + params = (n_qubits, depths, ["lookahead", "decay"]) + param_names = ["n_qubits", "depth", "heuristic"] + + def setup(self, n_qubits, depth, _): + if (n_qubits, depth) not in self.allowed_sizes: + raise NotImplementedError + seed = 2022_10_27 + self.dag = circuit_to_dag(build_qv_model_circuit(n_qubits, depth, seed)) + self.coupling = CouplingMap.from_heavy_hex(self.heavy_hex_distance[n_qubits]) + + def time_sabre_swap(self, _n_qubits, _depth, heuristic): + pass_ = SabreSwap(self.coupling, heuristic, seed=2022_10_27, trials=1) + pass_.run(self.dag) + + +class LargeQuantumVolumeMappingTrackBench: + timeout = 600.0 # seconds + + allowed_sizes = {(115, 100), (115, 10), (409, 10), (1081, 10)} + heuristics = ["lookahead", "decay"] + n_qubits = sorted({n_qubits for n_qubits, _ in allowed_sizes}) + depths = sorted({depth for _, depth in allowed_sizes}) + + params = (n_qubits, depths, heuristics) + param_names = ["n_qubits", "depth", "heuristic"] + + # The benchmarks take a significant amount of time to run, and we don't + # want to unnecessarily run things twice to get the two pieces of tracking + # information we're interested in. We cheat by using the setup cache to do + # all the calculation work only once, and then each tracker just quickly + # pulls the result from the cache to return, saving the duplication. + + def setup_cache(self): + heavy_hex_distance = {115: 7, 409: 13, 1081: 21} + seed = 2022_10_27 + + def setup(n_qubits, depth, heuristic): + dag = circuit_to_dag(build_qv_model_circuit(n_qubits, depth, seed)) + coupling = CouplingMap.from_heavy_hex(heavy_hex_distance[n_qubits]) + return SabreSwap(coupling, heuristic, seed=seed, trials=1).run(dag) + + state = {} + for params in itertools.product(*self.params): + n_qubits, depth, _ = params + if (n_qubits, depth) not in self.allowed_sizes: + continue + dag = setup(*params) + state[params] = {"depth": dag.depth(), "size": dag.size()} + return state + + def setup(self, _state, n_qubits, depth, _heuristic): + if (n_qubits, depth) not in self.allowed_sizes: + raise NotImplementedError + + def track_depth_sabre_swap(self, state, *params): + return state[params]["depth"] + + def track_size_sabre_swap(self, state, *params): + return state[params]["size"] diff --git a/test/benchmarks/queko.py b/test/benchmarks/queko.py new file mode 100644 index 000000000000..7bc58bea9059 --- /dev/null +++ b/test/benchmarks/queko.py @@ -0,0 +1,360 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=no-member,invalid-name,missing-docstring,no-name-in-module +# pylint: disable=attribute-defined-outside-init,unsubscriptable-object + +import os + +from qiskit import QuantumCircuit +from qiskit.compiler import transpile + + +class QUEKOTranspilerBench: + params = ([0, 1, 2, 3], [None, "sabre"]) + param_names = ["optimization level", "routing/layout method"] + timeout = 600 + + # pylint: disable=unused-argument + def setup(self, optimization_level, routing_method): + self.rochester_coupling_map = [ + [0, 5], + [0, 1], + [1, 2], + [1, 0], + [2, 3], + [2, 1], + [3, 4], + [3, 2], + [4, 6], + [4, 3], + [5, 9], + [5, 0], + [6, 13], + [6, 4], + [7, 16], + [7, 8], + [8, 9], + [8, 7], + [9, 10], + [9, 8], + [9, 5], + [10, 11], + [10, 9], + [11, 17], + [11, 12], + [11, 10], + [12, 13], + [12, 11], + [13, 14], + [13, 12], + [13, 6], + [14, 15], + [14, 13], + [15, 18], + [15, 14], + [16, 19], + [16, 7], + [17, 23], + [17, 11], + [18, 27], + [18, 15], + [19, 20], + [19, 16], + [20, 21], + [20, 19], + [21, 28], + [21, 22], + [21, 20], + [22, 23], + [22, 21], + [23, 24], + [23, 22], + [23, 17], + [24, 25], + [24, 23], + [25, 29], + [25, 26], + [25, 24], + [26, 27], + [26, 25], + [27, 26], + [27, 18], + [28, 32], + [28, 21], + [29, 36], + [29, 25], + [30, 39], + [30, 31], + [31, 32], + [31, 30], + [32, 33], + [32, 31], + [32, 28], + [33, 34], + [33, 32], + [34, 40], + [34, 35], + [34, 33], + [35, 36], + [35, 34], + [36, 37], + [36, 35], + [36, 29], + [37, 38], + [37, 36], + [38, 41], + [38, 37], + [39, 42], + [39, 30], + [40, 46], + [40, 34], + [41, 50], + [41, 38], + [42, 43], + [42, 39], + [43, 44], + [43, 42], + [44, 51], + [44, 45], + [44, 43], + [45, 46], + [45, 44], + [46, 47], + [46, 45], + [46, 40], + [47, 48], + [47, 46], + [48, 52], + [48, 49], + [48, 47], + [49, 50], + [49, 48], + [50, 49], + [50, 41], + [51, 44], + [52, 48], + ] + + self.tokyo_coupling_map = [ + [0, 1], + [1, 2], + [2, 3], + [3, 4], + [0, 5], + [1, 6], + [1, 7], + [2, 6], + [2, 7], + [3, 8], + [3, 9], + [4, 8], + [4, 9], + [5, 6], + [6, 7], + [7, 8], + [8, 9], + [5, 10], + [5, 11], + [6, 10], + [6, 11], + [7, 12], + [7, 13], + [8, 12], + [8, 13], + [9, 14], + [10, 11], + [11, 12], + [12, 13], + [13, 14], + [10, 15], + [11, 16], + [11, 17], + [12, 16], + [12, 17], + [13, 18], + [13, 19], + [14, 18], + [14, 19], + [15, 16], + [16, 17], + [17, 18], + [18, 19], + ] + self.sycamore_coupling_map = [ + [0, 6], + [1, 6], + [1, 7], + [2, 7], + [2, 8], + [3, 8], + [3, 9], + [4, 9], + [4, 10], + [5, 10], + [5, 11], + [6, 12], + [6, 13], + [7, 13], + [7, 14], + [8, 14], + [8, 15], + [9, 15], + [9, 16], + [10, 16], + [10, 17], + [11, 17], + [12, 18], + [13, 18], + [13, 19], + [14, 19], + [14, 20], + [15, 20], + [15, 21], + [16, 21], + [16, 22], + [17, 22], + [17, 23], + [18, 24], + [18, 25], + [19, 25], + [19, 26], + [20, 26], + [20, 27], + [21, 27], + [21, 28], + [22, 28], + [22, 29], + [23, 29], + [24, 30], + [25, 30], + [25, 31], + [26, 31], + [26, 32], + [27, 32], + [27, 33], + [28, 33], + [28, 34], + [29, 34], + [29, 35], + [30, 36], + [30, 37], + [31, 37], + [31, 38], + [32, 38], + [32, 39], + [33, 39], + [33, 40], + [34, 40], + [34, 41], + [35, 41], + [36, 42], + [37, 42], + [37, 43], + [38, 43], + [38, 44], + [39, 44], + [39, 45], + [40, 45], + [40, 46], + [41, 46], + [41, 47], + [42, 48], + [42, 49], + [43, 49], + [43, 50], + [44, 50], + [44, 51], + [45, 51], + [45, 52], + [46, 52], + [46, 53], + [47, 53], + ] + self.basis_gates = ["id", "rz", "sx", "x", "cx"] + self.qasm_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "qasm")) + + self.bigd = QuantumCircuit.from_qasm_file( + os.path.join(self.qasm_path, "20QBT_45CYC_.0D1_.1D2_3.qasm") + ) + self.bss = QuantumCircuit.from_qasm_file( + os.path.join(self.qasm_path, "53QBT_100CYC_QSE_3.qasm") + ) + self.bntf = QuantumCircuit.from_qasm_file( + os.path.join(self.qasm_path, "54QBT_25CYC_QSE_3.qasm") + ) + + def track_depth_bntf_optimal_depth_25(self, optimization_level, routing_method): + return transpile( + self.bntf, + coupling_map=self.sycamore_coupling_map, + basis_gates=self.basis_gates, + routing_method=routing_method, + layout_method=routing_method, + optimization_level=optimization_level, + seed_transpiler=0, + ).depth() + + def track_depth_bss_optimal_depth_100(self, optimization_level, routing_method): + return transpile( + self.bss, + coupling_map=self.rochester_coupling_map, + basis_gates=self.basis_gates, + routing_method=routing_method, + layout_method=routing_method, + optimization_level=optimization_level, + seed_transpiler=0, + ).depth() + + def track_depth_bigd_optimal_depth_45(self, optimization_level, routing_method): + return transpile( + self.bigd, + coupling_map=self.tokyo_coupling_map, + basis_gates=self.basis_gates, + routing_method=routing_method, + layout_method=routing_method, + optimization_level=optimization_level, + seed_transpiler=0, + ).depth() + + def time_transpile_bntf(self, optimization_level, routing_method): + transpile( + self.bntf, + coupling_map=self.sycamore_coupling_map, + basis_gates=self.basis_gates, + routing_method=routing_method, + layout_method=routing_method, + optimization_level=optimization_level, + seed_transpiler=0, + ).depth() + + def time_transpile_bss(self, optimization_level, routing_method): + transpile( + self.bss, + coupling_map=self.rochester_coupling_map, + basis_gates=self.basis_gates, + routing_method=routing_method, + layout_method=routing_method, + optimization_level=optimization_level, + seed_transpiler=0, + ).depth() + + def time_transpile_bigd(self, optimization_level, routing_method): + transpile( + self.bigd, + coupling_map=self.tokyo_coupling_map, + basis_gates=self.basis_gates, + routing_method=routing_method, + layout_method=routing_method, + optimization_level=optimization_level, + seed_transpiler=0, + ).depth() diff --git a/test/benchmarks/random_circuit_hex.py b/test/benchmarks/random_circuit_hex.py new file mode 100644 index 000000000000..bb6c0882ae06 --- /dev/null +++ b/test/benchmarks/random_circuit_hex.py @@ -0,0 +1,139 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=missing-docstring,invalid-name,no-member +# pylint: disable=attribute-defined-outside-init + +import copy + +from qiskit.quantum_info.synthesis import OneQubitEulerDecomposer +from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister + +try: + from qiskit.compiler import transpile + + TRANSPILER_SEED_KEYWORD = "seed_transpiler" +except ImportError: + from qiskit.transpiler import transpile + + TRANSPILER_SEED_KEYWORD = "seed_mapper" +try: + from qiskit.quantum_info.random import random_unitary + + HAS_RANDOM_UNITARY = True +except ImportError: + from qiskit.tools.qi.qi import random_unitary_matrix + + HAS_RANDOM_UNITARY = False + + +# Make a random circuit on a ring +def make_circuit_ring(nq, depth, seed): + assert int(nq / 2) == nq / 2 # for now size of ring must be even + # Create a Quantum Register + q = QuantumRegister(nq) + # Create a Classical Register + c = ClassicalRegister(nq) + # Create a Quantum Circuit + qc = QuantumCircuit(q, c) + offset = 1 + decomposer = OneQubitEulerDecomposer() + # initial round of random single-qubit unitaries + for i in range(nq): + qc.h(q[i]) + for j in range(depth): + for i in range(int(nq / 2)): # round of CNOTS + k = i * 2 + offset + j % 2 # j%2 makes alternating rounds overlap + qc.cx(q[k % nq], q[(k + 1) % nq]) + for i in range(nq): # round of single-qubit unitaries + if HAS_RANDOM_UNITARY: + u = random_unitary(2, seed).data + else: + u = random_unitary_matrix(2) # pylint: disable=used-before-assignment # noqa + + angles = decomposer.angles(u) + qc.u3(angles[0], angles[1], angles[2], q[i]) + + # insert the final measurements + qcm = copy.deepcopy(qc) + for i in range(nq): + qcm.measure(q[i], c[i]) + return [qc, qcm, nq] + + +class BenchRandomCircuitHex: + params = [2 * i for i in range(2, 8)] + param_names = ["n_qubits"] + version = 3 + + def setup(self, n): + depth = 2 * n + self.seed = 0 + self.circuit = make_circuit_ring(n, depth, self.seed)[0] + + def time_ibmq_backend_transpile(self, _): + # Run with ibmq_16_melbourne configuration + coupling_map = [ + [1, 0], + [1, 2], + [2, 3], + [4, 3], + [4, 10], + [5, 4], + [5, 6], + [5, 9], + [6, 8], + [7, 8], + [9, 8], + [9, 10], + [11, 3], + [11, 10], + [11, 12], + [12, 2], + [13, 1], + [13, 12], + ] + transpile( + self.circuit, + basis_gates=["u1", "u2", "u3", "cx", "id"], + coupling_map=coupling_map, + **{TRANSPILER_SEED_KEYWORD: self.seed}, + ) + + def track_depth_ibmq_backend_transpile(self, _): + # Run with ibmq_16_melbourne configuration + coupling_map = [ + [1, 0], + [1, 2], + [2, 3], + [4, 3], + [4, 10], + [5, 4], + [5, 6], + [5, 9], + [6, 8], + [7, 8], + [9, 8], + [9, 10], + [11, 3], + [11, 10], + [11, 12], + [12, 2], + [13, 1], + [13, 12], + ] + return transpile( + self.circuit, + basis_gates=["u1", "u2", "u3", "cx", "id"], + coupling_map=coupling_map, + **{TRANSPILER_SEED_KEYWORD: self.seed}, + ).depth() diff --git a/test/benchmarks/randomized_benchmarking.py b/test/benchmarks/randomized_benchmarking.py new file mode 100644 index 000000000000..4772a7ccb4cc --- /dev/null +++ b/test/benchmarks/randomized_benchmarking.py @@ -0,0 +1,139 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=no-member,invalid-name,missing-docstring,no-name-in-module +# pylint: disable=attribute-defined-outside-init,unsubscriptable-object +# pylint: disable=import-error + +import os +import numpy as np +from qiskit_experiments.library import StandardRB + +try: + from qiskit.compiler import transpile + + TRANSPILER_SEED_KEYWORD = "seed_transpiler" +except ImportError: + from qiskit.transpiler import transpile + + TRANSPILER_SEED_KEYWORD = "seed_mapper" + + +def build_rb_circuit(qubits, length_vector, num_samples=1, seed=None): + """ + Randomized Benchmarking sequences. + """ + if not seed: + np.random.seed(10) + else: + np.random.seed(seed) + + # Generate the sequences + try: + rb_exp = StandardRB( + qubits, + lengths=length_vector, + num_samples=num_samples, + seed=seed, + ) + except OSError: + skip_msg = "Skipping tests because tables are missing" + raise NotImplementedError(skip_msg) # pylint: disable=raise-missing-from + return rb_exp.circuits() + + +class RandomizedBenchmarkingBenchmark: + # parameters for RB (1&2 qubits): + params = ( + [ + [0], # Single qubit RB + [0, 1], # Two qubit RB + ], + ) + param_names = ["qubits"] + version = "0.3.0" + timeout = 600 + + def setup(self, qubits): + length_vector = np.arange(1, 200, 4) + num_samples = 1 + self.seed = 10 + self.circuits = build_rb_circuit( + qubits=qubits, length_vector=length_vector, num_samples=num_samples, seed=self.seed + ) + + def teardown(self, _): + os.environ["QISKIT_IN_PARALLEL"] = "FALSE" + + def time_ibmq_backend_transpile(self, __): + # Run with ibmq_16_melbourne configuration + coupling_map = [ + [1, 0], + [1, 2], + [2, 3], + [4, 3], + [4, 10], + [5, 4], + [5, 6], + [5, 9], + [6, 8], + [7, 8], + [9, 8], + [9, 10], + [11, 3], + [11, 10], + [11, 12], + [12, 2], + [13, 1], + [13, 12], + ] + + transpile( + self.circuits, + basis_gates=["u1", "u2", "u3", "cx", "id"], + coupling_map=coupling_map, + optimization_level=0, + **{TRANSPILER_SEED_KEYWORD: self.seed}, + ) + + def time_ibmq_backend_transpile_single_thread(self, __): + os.environ["QISKIT_IN_PARALLEL"] = "TRUE" + + # Run with ibmq_16_melbourne configuration + coupling_map = [ + [1, 0], + [1, 2], + [2, 3], + [4, 3], + [4, 10], + [5, 4], + [5, 6], + [5, 9], + [6, 8], + [7, 8], + [9, 8], + [9, 10], + [11, 3], + [11, 10], + [11, 12], + [12, 2], + [13, 1], + [13, 12], + ] + + transpile( + self.circuits, + basis_gates=["u1", "u2", "u3", "cx", "id"], + coupling_map=coupling_map, + optimization_level=0, + **{TRANSPILER_SEED_KEYWORD: self.seed}, + ) diff --git a/test/benchmarks/ripple_adder.py b/test/benchmarks/ripple_adder.py new file mode 100644 index 000000000000..344a562f85d2 --- /dev/null +++ b/test/benchmarks/ripple_adder.py @@ -0,0 +1,59 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=no-member,invalid-name,missing-docstring,no-name-in-module +# pylint: disable=attribute-defined-outside-init,unsubscriptable-object + +from qiskit import transpile +from qiskit.transpiler import CouplingMap + +from .utils import build_ripple_adder_circuit + + +class RippleAdderConstruction: + params = ([10, 50, 100, 200, 500],) + param_names = ["size"] + version = 1 + timeout = 600 + + def time_build_ripple_adder(self, size): + build_ripple_adder_circuit(size) + + +class RippleAdderTranspile: + params = ([10, 20], [0, 1, 2, 3]) + param_names = ["size", "level"] + version = 1 + timeout = 600 + + def setup(self, size, _): + edge_len = int((2 * size + 2) ** 0.5) + 1 + self.coupling_map = CouplingMap.from_grid(edge_len, edge_len) + self.circuit = build_ripple_adder_circuit(size) + + def time_transpile_square_grid_ripple_adder(self, _, level): + transpile( + self.circuit, + coupling_map=self.coupling_map, + basis_gates=["u1", "u2", "u3", "cx", "id"], + optimization_level=level, + seed_transpiler=20220125, + ) + + def track_depth_transpile_square_grid_ripple_adder(self, _, level): + return transpile( + self.circuit, + coupling_map=self.coupling_map, + basis_gates=["u1", "u2", "u3", "cx", "id"], + optimization_level=level, + seed_transpiler=20220125, + ).depth() diff --git a/test/benchmarks/scheduling_passes.py b/test/benchmarks/scheduling_passes.py new file mode 100644 index 000000000000..3d97ecdf67d3 --- /dev/null +++ b/test/benchmarks/scheduling_passes.py @@ -0,0 +1,130 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=invalid-name,missing-docstring +# pylint: disable=attribute-defined-outside-init + +from qiskit import transpile +from qiskit.circuit.library.standard_gates import XGate +from qiskit.transpiler import CouplingMap +from qiskit.transpiler import InstructionDurations +from qiskit.transpiler.passes import ( + TimeUnitConversion, + ASAPSchedule, + ALAPSchedule, + DynamicalDecoupling, +) +from qiskit.converters import circuit_to_dag + +from .utils import random_circuit + + +class SchedulingPassBenchmarks: + + params = ([5, 10, 20], [500, 1000]) + param_names = ["n_qubits", "depth"] + timeout = 300 + + def setup(self, n_qubits, depth): + seed = 42 + self.circuit = random_circuit( + n_qubits, depth, measure=True, conditional=True, reset=True, seed=seed, max_operands=2 + ) + self.basis_gates = ["rz", "sx", "x", "cx", "id", "reset"] + self.cmap = [ + [0, 1], + [1, 0], + [1, 2], + [1, 6], + [2, 1], + [2, 3], + [3, 2], + [3, 4], + [3, 8], + [4, 3], + [5, 6], + [5, 10], + [6, 1], + [6, 5], + [6, 7], + [7, 6], + [7, 8], + [7, 12], + [8, 3], + [8, 7], + [8, 9], + [9, 8], + [9, 14], + [10, 5], + [10, 11], + [11, 10], + [11, 12], + [11, 16], + [12, 7], + [12, 11], + [12, 13], + [13, 12], + [13, 14], + [13, 18], + [14, 9], + [14, 13], + [15, 16], + [16, 11], + [16, 15], + [16, 17], + [17, 16], + [17, 18], + [18, 13], + [18, 17], + [18, 19], + [19, 18], + ] + self.coupling_map = CouplingMap(self.cmap) + self.transpiled_circuit = transpile( + self.circuit, + basis_gates=self.basis_gates, + coupling_map=self.coupling_map, + optimization_level=1, + ) + self.dag = circuit_to_dag(self.transpiled_circuit) + self.durations = InstructionDurations( + [ + ("rz", None, 0), + ("id", None, 160), + ("sx", None, 160), + ("x", None, 160), + ("cx", None, 800), + ("measure", None, 3200), + ("reset", None, 3600), + ], + dt=1e-9, + ) + self.timed_dag = TimeUnitConversion(self.durations).run(self.dag) + _pass = ALAPSchedule(self.durations) + _pass.property_set["time_unit"] = "dt" + self.scheduled_dag = _pass.run(self.timed_dag) + + def time_time_unit_conversion_pass(self, _, __): + TimeUnitConversion(self.durations).run(self.dag) + + def time_alap_schedule_pass(self, _, __): + _pass = ALAPSchedule(self.durations) + _pass.property_set["time_unit"] = "dt" + _pass.run(self.timed_dag) + + def time_asap_schedule_pass(self, _, __): + _pass = ASAPSchedule(self.durations) + _pass.property_set["time_unit"] = "dt" + _pass.run(self.timed_dag) + + def time_dynamical_decoupling_pass(self, _, __): + DynamicalDecoupling(self.durations, dd_sequence=[XGate(), XGate()]).run(self.scheduled_dag) diff --git a/test/benchmarks/state_tomography.py b/test/benchmarks/state_tomography.py new file mode 100644 index 000000000000..03496c9bf35f --- /dev/null +++ b/test/benchmarks/state_tomography.py @@ -0,0 +1,52 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=missing-docstring,invalid-name,no-member,broad-except +# pylint: disable=no-else-return, attribute-defined-outside-init +# pylint: disable=import-error + +from qiskit_experiments.library import StateTomography + +import qiskit + + +class StateTomographyBench: + params = [2, 3, 4, 5] + param_names = ["n_qubits"] + version = "0.3.0" + timeout = 120.0 + + def setup(self, _): + self.qasm_backend = qiskit.BasicAer.get_backend("qasm_simulator") + + def time_state_tomography_bell(self, n_qubits): + meas_qubits = [n_qubits - 2, n_qubits - 1] + qr_full = qiskit.QuantumRegister(n_qubits) + bell = qiskit.QuantumCircuit(qr_full) + bell.h(qr_full[meas_qubits[0]]) + bell.cx(qr_full[meas_qubits[0]], qr_full[meas_qubits[1]]) + + qst_exp = StateTomography(bell, measurement_qubits=meas_qubits) + expdata = qst_exp.run(self.qasm_backend, shots=5000).block_for_results() + expdata.analysis_results("state") + expdata.analysis_results("state_fidelity") + + def time_state_tomography_cat(self, n_qubits): + qr = qiskit.QuantumRegister(n_qubits, "qr") + circ = qiskit.QuantumCircuit(qr, name="cat") + circ.h(qr[0]) + for i in range(1, n_qubits): + circ.cx(qr[0], qr[i]) + qst_exp = StateTomography(circ) + expdata = qst_exp.run(self.qasm_backend, shots=5000).block_for_results() + expdata.analysis_results("state") + expdata.analysis_results("state_fidelity") diff --git a/test/benchmarks/transpiler_benchmarks.py b/test/benchmarks/transpiler_benchmarks.py new file mode 100644 index 000000000000..a2ba39ab306d --- /dev/null +++ b/test/benchmarks/transpiler_benchmarks.py @@ -0,0 +1,130 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=missing-docstring,invalid-name,no-member +# pylint: disable=attribute-defined-outside-init + +import os + +import qiskit + + +class TranspilerBenchSuite: + def _build_cx_circuit(self): + cx_register = qiskit.QuantumRegister(2) + cx_circuit = qiskit.QuantumCircuit(cx_register) + cx_circuit.h(cx_register[0]) + cx_circuit.h(cx_register[0]) + cx_circuit.cx(cx_register[0], cx_register[1]) + cx_circuit.cx(cx_register[0], cx_register[1]) + cx_circuit.cx(cx_register[0], cx_register[1]) + cx_circuit.cx(cx_register[0], cx_register[1]) + return cx_circuit + + def _build_single_gate_circuit(self): + single_register = qiskit.QuantumRegister(1) + single_gate_circuit = qiskit.QuantumCircuit(single_register) + single_gate_circuit.h(single_register[0]) + return single_gate_circuit + + def setup(self): + self.single_gate_circuit = self._build_single_gate_circuit() + self.cx_circuit = self._build_cx_circuit() + self.qasm_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "qasm")) + large_qasm_path = os.path.join(self.qasm_path, "test_eoh_qasm.qasm") + self.large_qasm = qiskit.QuantumCircuit.from_qasm_file(large_qasm_path) + self.coupling_map = [ + [0, 1], + [1, 0], + [1, 2], + [1, 4], + [2, 1], + [2, 3], + [3, 2], + [3, 5], + [4, 1], + [4, 7], + [5, 3], + [5, 8], + [6, 7], + [7, 4], + [7, 6], + [7, 10], + [8, 5], + [8, 9], + [8, 11], + [9, 8], + [10, 7], + [10, 12], + [11, 8], + [11, 14], + [12, 10], + [12, 13], + [12, 15], + [13, 12], + [13, 14], + [14, 11], + [14, 13], + [14, 16], + [15, 12], + [15, 18], + [16, 14], + [16, 19], + [17, 18], + [18, 15], + [18, 17], + [18, 21], + [19, 16], + [19, 20], + [19, 22], + [20, 19], + [21, 18], + [21, 23], + [22, 19], + [22, 25], + [23, 21], + [23, 24], + [24, 23], + [24, 25], + [25, 22], + [25, 24], + [25, 26], + [26, 25], + ] + self.basis = ["id", "rz", "sx", "x", "cx", "reset"] + + def time_single_gate_compile(self): + circ = qiskit.compiler.transpile( + self.single_gate_circuit, + coupling_map=self.coupling_map, + basis_gates=self.basis, + seed_transpiler=20220125, + ) + qiskit.compiler.assemble(circ) + + def time_cx_compile(self): + circ = qiskit.compiler.transpile( + self.cx_circuit, + coupling_map=self.coupling_map, + basis_gates=self.basis, + seed_transpiler=20220125, + ) + qiskit.compiler.assemble(circ) + + def time_compile_from_large_qasm(self): + circ = qiskit.compiler.transpile( + self.large_qasm, + coupling_map=self.coupling_map, + basis_gates=self.basis, + seed_transpiler=20220125, + ) + qiskit.compiler.assemble(circ) diff --git a/test/benchmarks/transpiler_levels.py b/test/benchmarks/transpiler_levels.py new file mode 100644 index 000000000000..a8467ed5dc95 --- /dev/null +++ b/test/benchmarks/transpiler_levels.py @@ -0,0 +1,236 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=no-member,invalid-name,missing-docstring,no-name-in-module +# pylint: disable=attribute-defined-outside-init,unsubscriptable-object + +import os + +from qiskit.compiler import transpile +from qiskit import QuantumCircuit +from qiskit.transpiler import InstructionDurations +from qiskit.providers.fake_provider import FakeMelbourne + +from .utils import build_qv_model_circuit + + +class TranspilerLevelBenchmarks: + params = [0, 1, 2, 3] + param_names = ["transpiler optimization level"] + timeout = 600 + + def setup(self, _): + self.rochester_coupling_map = [ + [0, 5], + [0, 1], + [1, 2], + [1, 0], + [2, 3], + [2, 1], + [3, 4], + [3, 2], + [4, 6], + [4, 3], + [5, 9], + [5, 0], + [6, 13], + [6, 4], + [7, 16], + [7, 8], + [8, 9], + [8, 7], + [9, 10], + [9, 8], + [9, 5], + [10, 11], + [10, 9], + [11, 17], + [11, 12], + [11, 10], + [12, 13], + [12, 11], + [13, 14], + [13, 12], + [13, 6], + [14, 15], + [14, 13], + [15, 18], + [15, 14], + [16, 19], + [16, 7], + [17, 23], + [17, 11], + [18, 27], + [18, 15], + [19, 20], + [19, 16], + [20, 21], + [20, 19], + [21, 28], + [21, 22], + [21, 20], + [22, 23], + [22, 21], + [23, 24], + [23, 22], + [23, 17], + [24, 25], + [24, 23], + [25, 29], + [25, 26], + [25, 24], + [26, 27], + [26, 25], + [27, 26], + [27, 18], + [28, 32], + [28, 21], + [29, 36], + [29, 25], + [30, 39], + [30, 31], + [31, 32], + [31, 30], + [32, 33], + [32, 31], + [32, 28], + [33, 34], + [33, 32], + [34, 40], + [34, 35], + [34, 33], + [35, 36], + [35, 34], + [36, 37], + [36, 35], + [36, 29], + [37, 38], + [37, 36], + [38, 41], + [38, 37], + [39, 42], + [39, 30], + [40, 46], + [40, 34], + [41, 50], + [41, 38], + [42, 43], + [42, 39], + [43, 44], + [43, 42], + [44, 51], + [44, 45], + [44, 43], + [45, 46], + [45, 44], + [46, 47], + [46, 45], + [46, 40], + [47, 48], + [47, 46], + [48, 52], + [48, 49], + [48, 47], + [49, 50], + [49, 48], + [50, 49], + [50, 41], + [51, 44], + [52, 48], + ] + self.basis_gates = ["u1", "u2", "u3", "cx", "id"] + self.qv_50_x_20 = build_qv_model_circuit(50, 20, 0) + self.qv_14_x_14 = build_qv_model_circuit(14, 14, 0) + self.qasm_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "qasm")) + large_qasm_path = os.path.join(self.qasm_path, "test_eoh_qasm.qasm") + self.large_qasm = QuantumCircuit.from_qasm_file(large_qasm_path) + self.melbourne = FakeMelbourne() + self.durations = InstructionDurations( + [ + ("u1", None, 0), + ("id", None, 160), + ("u2", None, 160), + ("u3", None, 320), + ("cx", None, 800), + ("measure", None, 3200), + ], + dt=1e-9, + ) + + def time_quantum_volume_transpile_50_x_20(self, transpiler_level): + transpile( + self.qv_50_x_20, + basis_gates=self.basis_gates, + coupling_map=self.rochester_coupling_map, + seed_transpiler=0, + optimization_level=transpiler_level, + ) + + def track_depth_quantum_volume_transpile_50_x_20(self, transpiler_level): + return transpile( + self.qv_50_x_20, + basis_gates=self.basis_gates, + coupling_map=self.rochester_coupling_map, + seed_transpiler=0, + optimization_level=transpiler_level, + ).depth() + + def time_transpile_from_large_qasm(self, transpiler_level): + transpile( + self.large_qasm, + basis_gates=self.basis_gates, + coupling_map=self.rochester_coupling_map, + seed_transpiler=0, + optimization_level=transpiler_level, + ) + + def track_depth_transpile_from_large_qasm(self, transpiler_level): + return transpile( + self.large_qasm, + basis_gates=self.basis_gates, + coupling_map=self.rochester_coupling_map, + seed_transpiler=0, + optimization_level=transpiler_level, + ).depth() + + def time_transpile_from_large_qasm_backend_with_prop(self, transpiler_level): + transpile( + self.large_qasm, self.melbourne, seed_transpiler=0, optimization_level=transpiler_level + ) + + def track_depth_transpile_from_large_qasm_backend_with_prop(self, transpiler_level): + return transpile( + self.large_qasm, self.melbourne, seed_transpiler=0, optimization_level=transpiler_level + ).depth() + + def time_transpile_qv_14_x_14(self, transpiler_level): + transpile( + self.qv_14_x_14, self.melbourne, seed_transpiler=0, optimization_level=transpiler_level + ) + + def track_depth_transpile_qv_14_x_14(self, transpiler_level): + return transpile( + self.qv_14_x_14, self.melbourne, seed_transpiler=0, optimization_level=transpiler_level + ).depth() + + def time_schedule_qv_14_x_14(self, transpiler_level): + transpile( + self.qv_14_x_14, + self.melbourne, + seed_transpiler=0, + optimization_level=transpiler_level, + scheduling_method="alap", + instruction_durations=self.durations, + ) + + # limit optimization levels to reduce time + time_schedule_qv_14_x_14.params = [0, 1] diff --git a/test/benchmarks/transpiler_qualitative.py b/test/benchmarks/transpiler_qualitative.py new file mode 100644 index 000000000000..6b64affe57c7 --- /dev/null +++ b/test/benchmarks/transpiler_qualitative.py @@ -0,0 +1,111 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=no-member,invalid-name,missing-docstring,no-name-in-module +# pylint: disable=attribute-defined-outside-init,unsubscriptable-object + +import os + +from qiskit import QuantumCircuit +from qiskit.compiler import transpile +from qiskit.test.mock import FakeToronto + + +class TranspilerQualitativeBench: + params = ([0, 1, 2, 3], ["stochastic", "sabre"], ["dense", "noise_adaptive", "sabre"]) + param_names = ["optimization level", "routing method", "layout method"] + timeout = 600 + + # pylint: disable=unused-argument + def setup(self, optimization_level, routing_method, layout_method): + self.backend = FakeToronto() + self.qasm_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "qasm")) + + self.depth_4gt10_v1_81 = QuantumCircuit.from_qasm_file( + os.path.join(self.qasm_path, "depth_4gt10-v1_81.qasm") + ) + self.depth_4mod5_v0_19 = QuantumCircuit.from_qasm_file( + os.path.join(self.qasm_path, "depth_4mod5-v0_19.qasm") + ) + self.depth_mod8_10_178 = QuantumCircuit.from_qasm_file( + os.path.join(self.qasm_path, "depth_mod8-10_178.qasm") + ) + + self.time_cnt3_5_179 = QuantumCircuit.from_qasm_file( + os.path.join(self.qasm_path, "time_cnt3-5_179.qasm") + ) + self.time_cnt3_5_180 = QuantumCircuit.from_qasm_file( + os.path.join(self.qasm_path, "time_cnt3-5_180.qasm") + ) + self.time_qft_16 = QuantumCircuit.from_qasm_file( + os.path.join(self.qasm_path, "time_qft_16.qasm") + ) + + def track_depth_transpile_4gt10_v1_81(self, optimization_level, routing_method, layout_method): + return transpile( + self.depth_4gt10_v1_81, + self.backend, + routing_method=routing_method, + layout_method=layout_method, + optimization_level=optimization_level, + seed_transpiler=0, + ).depth() + + def track_depth_transpile_4mod5_v0_19(self, optimization_level, routing_method, layout_method): + return transpile( + self.depth_4mod5_v0_19, + self.backend, + routing_method=routing_method, + layout_method=layout_method, + optimization_level=optimization_level, + seed_transpiler=0, + ).depth() + + def track_depth_transpile_mod8_10_178(self, optimization_level, routing_method, layout_method): + return transpile( + self.depth_mod8_10_178, + self.backend, + routing_method=routing_method, + layout_method=layout_method, + optimization_level=optimization_level, + seed_transpiler=0, + ).depth() + + def time_transpile_time_cnt3_5_179(self, optimization_level, routing_method, layout_method): + transpile( + self.time_cnt3_5_179, + self.backend, + routing_method=routing_method, + layout_method=layout_method, + optimization_level=optimization_level, + seed_transpiler=0, + ) + + def time_transpile_time_cnt3_5_180(self, optimization_level, routing_method, layout_method): + transpile( + self.time_cnt3_5_180, + self.backend, + routing_method=routing_method, + layout_method=layout_method, + optimization_level=optimization_level, + seed_transpiler=0, + ) + + def time_transpile_time_qft_16(self, optimization_level, routing_method, layout_method): + transpile( + self.time_qft_16, + self.backend, + routing_method=routing_method, + layout_method=layout_method, + optimization_level=optimization_level, + seed_transpiler=0, + ) diff --git a/test/benchmarks/utils.py b/test/benchmarks/utils.py new file mode 100644 index 000000000000..19b6f990879b --- /dev/null +++ b/test/benchmarks/utils.py @@ -0,0 +1,222 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2023 +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +# pylint: disable=invalid-name,no-member + +"""Benchmark utility functions.""" + +import numpy as np + +from qiskit.quantum_info.random import random_unitary +from qiskit.circuit import QuantumRegister, ClassicalRegister, QuantumCircuit +from qiskit.circuit import Reset +from qiskit.circuit.library import ( + IGate, + U1Gate, + U2Gate, + U3Gate, + XGate, + YGate, + ZGate, + HGate, + SGate, + SdgGate, + TGate, + TdgGate, + RXGate, + RYGate, + RZGate, + CXGate, + CYGate, + CZGate, + CHGate, + CRZGate, + CU1Gate, + CU3Gate, + SwapGate, + RZZGate, + CCXGate, + CSwapGate, +) + + +def random_circuit( + n_qubits, depth, max_operands=3, measure=False, conditional=False, reset=False, seed=None +): + """Generate random circuit of arbitrary size and form. + + Args: + n_qubits (int): number of quantum wires + depth (int): layers of operations (i.e. critical path length) + max_operands (int): maximum operands of each gate (between 1 and 3) + measure (bool): if True, measure all qubits at the end + conditional (bool): if True, insert middle measurements and + conditionals + reset (bool): if True, insert middle resets + seed (int): sets random seed (optional) + + Returns: + QuantumCircuit: constructed circuit + + Raises: + Exception: when invalid options given + """ + if max_operands < 1 or max_operands > 3: + raise Exception("max_operands must be between 1 and 3") + + one_q_ops = [ + IGate, + U1Gate, + U2Gate, + U3Gate, + XGate, + YGate, + ZGate, + HGate, + SGate, + SdgGate, + TGate, + TdgGate, + RXGate, + RYGate, + RZGate, + ] + one_param = [U1Gate, RXGate, RYGate, RZGate, RZZGate, CU1Gate, CRZGate] + two_param = [U2Gate] + three_param = [U3Gate, CU3Gate] + two_q_ops = [CXGate, CYGate, CZGate, CHGate, CRZGate, CYGate, CU3Gate, SwapGate, RZZGate] + three_q_ops = [CCXGate, CSwapGate] + + qr = QuantumRegister(n_qubits, "q") + qc = QuantumCircuit(n_qubits) + + if measure or conditional: + cr = ClassicalRegister(n_qubits, "c") + qc.add_register(cr) + + if reset: + one_q_ops += [Reset] + + if seed is None: + seed = np.random.randint(0, np.iinfo(np.int32).max) + rng = np.random.RandomState(seed) + + # apply arbitrary random operations at every depth + for _ in range(depth): + # choose either 1, 2, or 3 qubits for the operation + remaining_qubits = list(range(n_qubits)) + while remaining_qubits: + max_possible_operands = min(len(remaining_qubits), max_operands) + num_operands = rng.choice(range(max_possible_operands)) + 1 + rng.shuffle(remaining_qubits) + operands = remaining_qubits[:num_operands] + remaining_qubits = [q for q in remaining_qubits if q not in operands] + if num_operands == 1: + operation = rng.choice(one_q_ops) + elif num_operands == 2: + operation = rng.choice(two_q_ops) + elif num_operands == 3: + operation = rng.choice(three_q_ops) + if operation in one_param: + num_angles = 1 + elif operation in two_param: + num_angles = 2 + elif operation in three_param: + num_angles = 3 + else: + num_angles = 0 + angles = [rng.uniform(0, 2 * np.pi) for x in range(num_angles)] + register_operands = [qr[i] for i in operands] + op = operation(*angles) + + # with some low probability, condition on classical bit values + if conditional and rng.choice(range(10)) == 0: + value = rng.randint(0, np.power(2, n_qubits)) + op.condition = (cr, value) + + qc.append(op, register_operands) + + if measure: + qc.measure(qr, cr) + + return qc + + +def build_qv_model_circuit(width, depth, seed=None): + """ + The model circuits consist of layers of Haar random + elements of SU(4) applied between corresponding pairs + of qubits in a random bipartition. + """ + np.random.seed(seed) + circuit = QuantumCircuit(width) + # For each layer + for _ in range(depth): + # Generate uniformly random permutation Pj of [0...n-1] + perm = np.random.permutation(width) + # For each pair p in Pj, generate Haar random SU(4) + for k in range(int(np.floor(width / 2))): + U = random_unitary(4) + pair = int(perm[2 * k]), int(perm[2 * k + 1]) + circuit.append(U, [pair[0], pair[1]]) + return circuit + + +def build_ripple_adder_circuit(size): + """ + Builds a ripple adder of a given size. + """ + n = size + a = QuantumRegister(n, "a") + b = QuantumRegister(n, "b") + cin = QuantumRegister(1, "cin") + cout = QuantumRegister(1, "cout") + ans = ClassicalRegister(n + 1, "ans") + qc = QuantumCircuit(a, b, cin, cout, ans, name="rippleadd") + + def majority(p, a, b, c): + """Majority gate.""" + p.cx(c, b) + p.cx(c, a) + p.ccx(a, b, c) + + def unmajority(p, a, b, c): + """Unmajoritygate.""" + p.ccx(a, b, c) + p.cx(c, a) + p.cx(a, b) + + # Build a temporary subcircuitthat adds a to b, + # storing the result in b + adder_subcircuit = QuantumCircuit(cin, a, b, cout) + majority(adder_subcircuit, cin[0], b[0], a[0]) + for j in range(n - 1): + majority(adder_subcircuit, a[j], b[j + 1], a[j + 1]) + + adder_subcircuit.cx(a[n - 1], cout[0]) + + for j in reversed(range(n - 1)): + unmajority(adder_subcircuit, a[j], b[j + 1], a[j + 1]) + unmajority(adder_subcircuit, cin[0], b[0], a[0]) + + # Set the inputs to the adder + qc.x(a[0]) # Set input a = 0...0001 + qc.x(b) # Set input b = 1...1111 + # Apply the adder + qc += adder_subcircuit + + # Measure the output register in the computational basis + for j in range(n): + qc.measure(b[j], ans[j]) + qc.measure(cout[0], ans[n]) + + return qc