Exemple #1
0
    qmasm.write_output(logical_ising, cl_args.output, cl_args.format,
                       cl_args.qubo)
    if not cl_args.run:
        sys.exit(0)

# If the user requested bqpjson output, output it here unless --always-embed
# was specified.
if write_output_file and cl_args.format == "bqpjson" and not cl_args.always_embed:
    qmasm.write_output(logical_ising, cl_args.output, cl_args.format,
                       cl_args.qubo)
    if not cl_args.run:
        sys.exit(0)

# Process all classical solvers unless we were told to do so post-embedding.
if not cl_args.always_embed and cl_args.format in classical_solvers:
    qmasm.process_classical(logical_ising, cl_args)
    sys.exit(0)

# Embed the problem onto the D-Wave.
physical_ising = qmasm.embed_problem_on_dwave(logical_ising, cl_args.O,
                                              cl_args.verbose,
                                              cl_args.topology_file)

# Set all chains to the user-specified strength then combine user-specified
# chains with embedder-created chains.
physical_ising.update_strengths_from_chains()
if cl_args.verbose >= 2:
    sys.stderr.write("Introduced the following new chains:\n\n")
    if len(physical_ising.embedder_chains) == 0:
        sys.stderr.write("    [none]\n")
    else:
Exemple #2
0
                       cl_args.qubo)
    if not cl_args.run:
        sys.exit(0)

# If the user requested bqpjson output, output it here unless --always-embed
# was specified.
if write_output_file and cl_args.format == "bqpjson" and not cl_args.always_embed:
    qmasm.write_output(logical_ising, cl_args.output, cl_args.format,
                       cl_args.qubo)
    if not cl_args.run:
        sys.exit(0)

# Process all classical solvers unless we were told to do so post-embedding.
if not cl_args.always_embed and cl_args.format in classical_solvers:
    qmasm.process_classical(logical_ising, cl_args.format, cl_args.output,
                            cl_args.run, cl_args.extra_args, cl_args.qubo,
                            cl_args.verbose)
    sys.exit(0)

# Embed the problem onto the D-Wave.
physical_ising = qmasm.embed_problem_on_dwave(logical_ising, cl_args.O,
                                              cl_args.verbose,
                                              cl_args.topology_file)

# Set all chains to the user-specified strength then combine user-specified
# chains with embedder-created chains.
physical_ising = qmasm.update_strengths_from_chains(physical_ising)
if cl_args.verbose >= 2:
    sys.stderr.write("Introduced the following new chains:\n\n")
    if len(physical_ising.chains) == 0:
        sys.stderr.write("    [none]\n")
Exemple #3
0
# If the user requested QMASM output, always output it here.
if write_output_file and cl_args.format == "qmasm":
    qmasm.write_output(logical_ising, cl_args.output, cl_args.format, cl_args.qubo)
    if not cl_args.run:
        sys.exit(0)

# If the user requested bqpjson output, output it here unless --always-embed
# was specified.
if write_output_file and cl_args.format == "bqpjson" and not cl_args.always_embed:
    qmasm.write_output(logical_ising, cl_args.output, cl_args.format, cl_args.qubo)
    if not cl_args.run:
        sys.exit(0)

# Process all classical solvers unless we were told to do so post-embedding.
if not cl_args.always_embed and cl_args.format in classical_solvers:
    qmasm.process_classical(logical_ising, cl_args)
    sys.exit(0)

# Embed the problem onto the D-Wave.
physical_ising = qmasm.embed_problem_on_dwave(logical_ising,
                                              cl_args.O,
                                              cl_args.verbose,
                                              cl_args.topology_file)

# Set all chains to the user-specified strength then combine user-specified
# chains with embedder-created chains.
physical_ising.update_strengths_from_chains()
if cl_args.verbose >= 2:
    sys.stderr.write("Introduced the following new chains:\n\n")
    if len(physical_ising.embedder_chains) == 0:
        sys.stderr.write("    [none]\n")