It's been *way* too long since the last release of QMASM. Perhaps the most far-reaching improvement is that QMASM can now run programs even without access to D-Wave's hardware and proprietary software. In their place, QMASM can use either D-Wave's open-source [`qbsolv`](https://github.com/dwavesystems/qbsolv) solver or the [MiniZinc](http://www.minizinc.org/) constraint-modeling language (using the [Chuffed](https://github.com/chuffed/chuffed) lazy clause generation solver as its back end).
See the [commit log](https://github.com/lanl/qmasm/compare/v1.2...v2.0) for the complete list of changes, but here are the highlights:
* Pinning is implemented in terms of a chain to a biased qubit.
* "Flattened" QMASM code can be output using `--format=qmasm`.
* Spin-reversal transformations can be introduced to compensate for asymmetry in the hardware. Specify `--spin-revs=`*number* to indicate the number of random spin-reversals to perform.
* Classical postprocessing can be applied to the D-Wave's output to search for better solutions that lie near the solutions found by the hardware. Specify `--postproc=opt` to enable "optimization" postprocessing, which is usually what you want.
* A new script, [`qb2qmasm`](https://github.com/lanl/qmasm/wiki/qb2qmasm) converts D-Wave programs from the format used on D-Wave's "Qubist" Web interface to QMASM code.
* A new script, [`qmasm-ground-state`](https://github.com/lanl/qmasm/wiki/qmasm-ground-state), computes the complete ground state of a QMASM macro via exhaustive evaluation. This can be useful for verifying that a macro is defined correctly.
* A new script, [`qmasm-qbsolv`](https://github.com/lanl/qmasm/wiki/qmasm-qbsolv), wraps D-Wave's [`qbsolv`](https://github.com/dwavesystems/qbsolv) solver. It uses comments introduced by `--format=qbsolv` to report results in terms of individual QMASM variables instead of as a single bit string.
* `!begin_replace_sym` and `!end_replace_sym` directives perform regular-expression search-and-replace operations on symbol names *after* macro expansion.
* The `!use_macro` directive can instantiate a macro multiple times in a single invocation. The `!next.` directive expands to the next instantiation name in a list of instantiations. These directives are useful for establishing a chain of macro instantiations, each feeding into the next.
* QMASM honors a `QMASMCACHE` environment variable that points to a directory in which QMASM can cache problem embeddings. On subsequent executions of the same problem (or even a different problem with identical structure), QMASM can skip the (slow) embedding step and run programs much faster.
* Instead of always discarding known-incorrect answers, `--discard=no` tells QMASM to retain them. `--discard=maybe` normally discards known-incorrect answers, but if no answers are left, it will retain the least incorrect of the remainder.
* The `--run` option no longer requires hardware access. QMASM can additionally run programs with `--format=qbsolv` or `--format=minizinc`.
* QMASM works with Python 3.x in addition to Python 2.x.
* Custom topologies can be specified with `--topology-file=`*filename* as a means for gauging qubit counts at problems scales larger than what is supported by current hardware.
* [`qbsolv`](https://github.com/dwavesystems/qbsolv) and [MiniZinc](http://www.minizinc.org/) output can be generated either before (default) or after (with `--always-embed`) embedding into a topology.
* Finer-grained control is provided over QMASM optimizations. `-O` (and `-O1`) merely attempt to reduce the logical qubit count, which is a fairly fast operation. `-O2` additionally packs the problem as tightly as possible in a corner of the Chimera graph, which can take quite a long time.
* Programs can be output in [bqpjson](https://github.com/lanl-ansi/bqpjson) format.
* It is no longer forbidden to alias an undefined variable. Variables come into existence with weight 0.0 in that case.
In addition, there have been plenty of bug fixes. Most importantly, the implementation of the `-O` optimizations have been rewritten from scratch to address some serious correctness issues.
All users should consider upgrading from QMASM v1.2 to QMASM v2.0.