A C++11 class library port of the reference implementation originally published alongside paper Time-Optimal Qubit Mapping.
There are two build targets here:
libtoqm
, a class library that exposes the full breadth of configuration options and algorithms available in the reference implementation.mapper
, an interactive commandline program that mimics the behavior of the original reference program, written on top oflibtoqm
.
// Construct mapper with desired configuration.
toqm::ToqmMapper m(
toqm::DefaultQueue {},
std::make_unique<toqm::DefaultExpander>(),
std::make_unique<toqm::CXFrontier>(),
std::make_unique<toqm::Latency_1_3>(),
{},
{std::make_unique<toqm::HashFilter>(), std::make_unique<toqm::HashFilter2>()}
);
// Run TOQM algorithm on a particular gate listing and target.
m.run(gates, num_qubits, coupling_map);
- Time-Optimal Qubit Mapping paper: Chi Zhang, Ari B. Hayes, Longfei Qiu, Yuwei Jin, Yanhao Chen, and Eddy Z. Zhang. 2021. Time-Optimal Qubit Mapping. In Proceedings of the 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS โ21), April 19โ23, 2021, Virtual, USA. ACM, New York, NY, USA, 14 pages.
- TOQM reference implementation, published with paper.
- @arihayes fork, which adds the
Table
latency class used in this library to support arbitrary 2 qubit operations and also make changes to how latency is handled.