-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
385d3fe
commit e59f484
Showing
7 changed files
with
85 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
def draw(qc, **kwargs): | ||
name = qc.__class__.__name__ | ||
base = qc.__class__.__base__.__name__ | ||
|
||
if name == 'QuantumCircuit': # Qiskit | ||
print(qc.draw(**kwargs)) | ||
elif name == 'QNode': # PennyLane | ||
from pennylane import draw | ||
print(draw(qc)(**kwargs)) | ||
elif base == 'pybind11_object': # tket | ||
raise NotImplementedError('Drawing tket circuits is not supported yet.') | ||
elif name == 'Circuit': # Cirq | ||
print(qc) | ||
elif name == 'Program': # Quil | ||
import pyquil.latex | ||
res = pyquil.latex.to_latex(qc, **kwargs) | ||
print(res) | ||
|
||
elif name == 'PyKernel': # CudaQ | ||
from cudaq import draw | ||
print(draw(qc, **kwargs)) | ||
else: | ||
raise ValueError(f'Unsupported circuit: {name}') | ||
|
||
return 0 |
Empty file.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.