Skip to content

Commit

Permalink
Remove unused imports and functions from cudaq.py (#105)
Browse files Browse the repository at this point in the history
Signed-off-by: A.M. Santana <[email protected]>
  • Loading branch information
anthony-santana authored Apr 21, 2023
1 parent 82e5804 commit 0a2f273
Showing 1 changed file with 7 additions and 32 deletions.
39 changes: 7 additions & 32 deletions python/cudaq.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,22 @@
# the terms of the Apache License 2.0 which accompanies this distribution. #
# ============================================================================ #

from _pycudaq import *
from typing import List
import sys, subprocess, os

def nvqpp():
command = os.path.join(os.path.dirname(__file__), "bin/nvq++")
subprocess.call([command] + sys.argv[1:])

def cudaq_quake():
installDir = os.path.dirname(__file__)
# Get lib/clang resource dir, it has a version name sub-folder
# get that version, its the only subfolder in the directory
clangVer = os.listdir(os.path.join(installDir, "lib/clang"))[0]
resourceDir = os.path.join(installDir, "lib/clang/{}".format(clangVer))
command = os.path.join(installDir, "bin/cudaq-quake")
subprocess.call([command] + sys.argv[1:] +['-resource-dir', resourceDir])
import sys

def cudaq_opt():
command = os.path.join(os.path.dirname(__file__), "bin/cudaq-opt")
subprocess.call([command] + sys.argv[1:])

def quake_translate():
command = os.path.join(os.path.dirname(__file__), "bin/quake-translate")
subprocess.call([command] + sys.argv[1:])

def quake_synth():
command = os.path.join(os.path.dirname(__file__), "bin/quake-synth")
subprocess.call([command] + sys.argv[1:])
from _pycudaq import *

initKwargs = {'qpu': 'qpp', 'platform':'default'}
initKwargs = {'qpu': 'qpp', 'platform': 'default'}

if '-qpu' in sys.argv:
initKwargs['qpu'] = sys.argv[sys.argv.index('-qpu')+1]
initKwargs['qpu'] = sys.argv[sys.argv.index('-qpu') + 1]

if '--qpu' in sys.argv:
initKwargs['qpu'] = sys.argv[sys.argv.index('--qpu')+1]
initKwargs['qpu'] = sys.argv[sys.argv.index('--qpu') + 1]

if '-platform' in sys.argv:
initKwargs['platform'] = sys.argv[sys.argv.index('-platform')+1]
initKwargs['platform'] = sys.argv[sys.argv.index('-platform') + 1]

if '--platform' in sys.argv:
initKwargs['platform'] = sys.argv[sys.argv.index('--platform')+1]
initKwargs['platform'] = sys.argv[sys.argv.index('--platform') + 1]

initialize_cudaq(**initKwargs)

0 comments on commit 0a2f273

Please sign in to comment.