예제 #1
0
import qmasm
import os
import os.path
import string
import sys

# Specify the minimum distinguishable difference between energy readings.
min_energy_delta = 0.005

# Define the set of classical solvers we support.
classical_solvers = ["qbsolv", "minizinc"]

# Parse the command line.
cl_args = qmasm.parse_command_line()
qmasm.report_command_line(cl_args)

# Parse the original input file(s) into an internal representation.
fparse = qmasm.FileParser()
fparse.parse_files(cl_args.input)

# Parse the variable pinnings specified on the command line.  Append these to
# the program.
if cl_args.pin != None:
    for pin in cl_args.pin:
        qmasm.program.extend(qmasm.process_pin("[command line]", 1, pin))

# Walk the statements in the program, processing each in turn.
logical_either = qmasm.Problem(cl_args.qubo)
for stmt in qmasm.program:
    stmt.update_qmi("", "<ERROR>", logical_either)
예제 #2
0
파일: qmasm.py 프로젝트: losalamos/qasm
import copy
import os
import os.path
import qmasm
import string
import sys

# Specify the minimum distinguishable difference between energy readings.
min_energy_delta = 0.005

# Define the set of classical solvers we support.
classical_solvers = ["qbsolv", "minizinc"]

# Parse the command line.
cl_args = qmasm.parse_command_line()
qmasm.report_command_line(cl_args)

# Parse the original input file(s) into an internal representation.
fparse = qmasm.FileParser()
fparse.process_files(cl_args.input)

# Parse the variable pinnings specified on the command line.  Append these to
# the program.
if cl_args.pin != None:
    for pin in cl_args.pin:
        qmasm.program.extend(fparse.process_pin("[command line]", 1, pin))

# Walk the statements in the program, processing each in turn.
logical_either = qmasm.Problem(cl_args.qubo)
for stmt in qmasm.program:
    stmt.update_qmi("", "<ERROR>", logical_either)