3 Created on Fri Jun 26 14:42:56 2020 4 Copyright 2020 Peter Rakyta, Ph.D. 6 Licensed under the Apache License, Version 2.0 (the "License"); 7 you may not use this file except in compliance with the License. 8 You may obtain a copy of the License at 10 http://www.apache.org/licenses/LICENSE-2.0 12 Unless required by applicable law or agreed to in writing, software 13 distributed under the License is distributed on an "AS IS" BASIS, 14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 See the License for the specific language governing permissions and 16 limitations under the License. 18 @author: Peter Rakyta, Ph.D. 24 from squander
import utils
28 if __name__ ==
'__main__':
32 'strategy':
"TreeSearch",
33 'test_subcircuits':
True,
34 'test_final_circuit':
True,
35 'max_partition_size': 3
38 filename =
"examples/partitioning/qasm_samples/heisenberg-16-20.qasm" 40 start_time = time.time()
43 circ, parameters = utils.qasm_to_squander_circuit(filename)
46 wide_circuit_optimizer = Wide_Circuit_Optimization.qgd_Wide_Circuit_Optimization( config )
49 wide_circuit_optimizer.OptimizeWideCircuit( circ, parameters )
51 print(
"--- %s seconds elapsed during optimization ---" % (time.time() - start_time))