qu-tan-um / olsq Goto Github PK
View Code? Open in Web Editor NEWOLSQ (pronounced all-s-k): Optimal Layout Synthesis for Quantum Computing
License: BSD 3-Clause "New" or "Revised" License
OLSQ (pronounced all-s-k): Optimal Layout Synthesis for Quantum Computing
License: BSD 3-Clause "New" or "Revised" License
The latest commit gives the following error on the README example. The previous commit works fine.
UnboundLocalError: local variable 'map_to_block' referenced before assignment.
Example code to reproduce:
from olsq import OLSQ
from olsq.device import qcdevice
qasm_in = "OPENQASM 2.0;\n include \"qelib1.inc\";\n qreg q[3];\n h q[2];\n cx q[1], q[2];\n tdg q[2];\n " \
"cx q[0], q[2];\n t q[2];\n cx q[1], q[2];\n tdg q[2];\n cx q[0], q[2];\n t q[1];\n t q[2];\n " \
"cx q[0], q[1];\n h q[2];\n t q[0];\n tdg q[1];\n cx q[0], q[1];\n"
lsqc_solver = OLSQ("depth", "normal")
lsqc_solver.setprogram(qasm_in)
lsqc_solver.setdevice(qcdevice("dev", 5, [(0, 1), (1, 2), (1, 3), (3, 4)], 3))
qasm_out = lsqc_solver.solve()
Also if I change mode to "transition" in the above, I get a different error:
line 263, in solve
lsqc.add(sigma[k][t] == False)
IndexError: list index out of range
Hi,
I bumped into KEYERROR when trying out the Cirq interface. I think in the Cirq interface section in the README, setdevicegraph
needs to be called before setprogram
. Otherwise the mapping dictionary is empty and would trigger KEYERROR. I also have a question about the mapping. It seems like the qubits type in the input device graph and the input quantum circuit needs to be the same. Can I input a circuit in Cirq with cirq.devices.LineQubit
and a coupling graph with cirq.devices.GridQubit
for the solver?
Best,
Sitao
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.