From cc387997b7e6a7db2ef11151a545c5f8c237b8a4 Mon Sep 17 00:00:00 2001 From: Peng Zhou Date: Fri, 7 Jan 2022 09:30:18 +0800 Subject: [PATCH] update repo url to newest --- README.md | 4 ++-- README_ZH.md | 4 ++-- setup.cfg | 4 ++-- setup.py | 20 +++++++++++++------- src/quingo/core/compiler_config.py | 2 +- src/quingo/core/manager.py | 26 +++++++++++++++++--------- 6 files changed, 37 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 19d0d3f..25c4f8b 100755 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The Quingo installation comprises of two main steps: ### Install the Runtime system and simulator Install Quingo runtime system with required simulators using the following command: ```sh -git clone https://gitee.com/hpcl_quanta/quingo-runtime.git +git clone https://gitee.com/quingo/quingo-runtime.git cd /your/download/path/quingo-runtime/ pip install -e . ``` @@ -72,4 +72,4 @@ The `Quingo_interface` class expose the following methods: - For QCIS-based backend, the result format is defined by PyQCISim. Please refer to the docstring of `quingo.if_backend.non_arch_backend.pyqcisim_quantumsim.PyQCISim_quantumsim::execute()` ## Quingo programming tutorial -At present, Qingguo runtime system has included sample programs such as `Bell_state`, `GHZ`, `VQE`, etc. Details can be found [here](https://gitee.com/hpcl_quanta/quingo-runtime/tree/master/src/examples). \ No newline at end of file +At present, Qingguo runtime system has included sample programs such as `Bell_state`, `GHZ`, `VQE`, etc. Details can be found [here](https://gitee.com/quingo/quingo-runtime/tree/master/src/examples). \ No newline at end of file diff --git a/README_ZH.md b/README_ZH.md index 27afb41..955697d 100755 --- a/README_ZH.md +++ b/README_ZH.md @@ -10,7 +10,7 @@ 依次执行以下命令便可以安装青果运行时系统、PyQCAS模拟器以及PyQCISim模拟器。 ```sh -git clone https://gitee.com/hpcl_quanta/quingo-runtime.git +git clone https://gitee.com/quingo/quingo-runtime.git cd /your/download/path/quingo-runtime/ pip install -e . ``` @@ -71,4 +71,4 @@ The result of bell_state is: - 对于能够执行QCIS指令的后端,结果的格式由PyQCISim进行定义。详情请参考`quingo.if_backend.non_arch_backend.pyqcisim_quantumsim.PyQCISim_quantumsim::execute()`中的文档描述。 ## 青果示例程序 -目前青果运行时系统中已经包含了`Bell_state`、`GHZ`、`VQE`等示例程序,详情可见[此处](https://gitee.com/hpcl_quanta/quingo-runtime/tree/master/src/examples)。 \ No newline at end of file +目前青果运行时系统中已经包含了`Bell_state`、`GHZ`、`VQE`等示例程序,详情可见[此处](https://gitee.com/quingo/quingo-runtime/tree/master/src/examples)。 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 7b48b30..b4678be 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,9 +7,9 @@ use_2to3 = False description = Quingo Runtime System long_description = file: README.md long_description_content_type = text/markdown -url = https://gitee.com/hpcl_quanta/quingo-runtime +url = https://gitee.com/quingo/quingo-runtime project_urls = - Bug Tracker = https://gitee.com/hpcl_quanta/quingo-runtime/issues + Bug Tracker = https://gitee.com/quingo/quingo-runtime/issues classifiers = Programming Language :: Python :: 3 :: Only License :: OSI Approved :: Apache Software License diff --git a/setup.py b/setup.py index 65db303..0c25b09 100755 --- a/setup.py +++ b/setup.py @@ -21,7 +21,8 @@ def set_path_env_on_Linux(install_path): stderr=subprocess.PIPE, text=True, shell=True) if ret_value.returncode != 0: - raise RuntimeError("Failed to retrieve system path using 'echo $PATH'.") + raise RuntimeError( + "Failed to retrieve system path using 'echo $PATH'.") if str(quingoc_dir.absolute()) in ret_value.stdout: return @@ -86,7 +87,8 @@ def install_on_Windows(mlir_compiler_path): zip_file.extractall(mlir_compiler_install_path) zip_file.close() - files = [file for file in mlir_compiler_install_path.glob("*/*") if file.is_file()] + files = [file for file in mlir_compiler_install_path.glob( + "*/*") if file.is_file()] for file in files: file.replace(mlir_compiler_install_path / file.name) @@ -110,7 +112,7 @@ def download_compiler(os_name, tmp_dir_name): dl_file_suffix = os_dl_suffix[os_name] latest_release_url = "https://gitee.com/api/v5/repos/{owner}/{repo}/releases/latest".format( - owner="hpcl_quanta", repo="quingo-runtime") + owner="quingo", repo="quingo-runtime") try: latest_release = requests.get(latest_release_url).text @@ -122,9 +124,11 @@ def download_compiler(os_name, tmp_dir_name): quingoc_asset = asset break if quingoc_asset is None: - raise RuntimeError("Failed to download quingo compiler from gitee.") + raise RuntimeError( + "Failed to download quingo compiler from gitee.") - quingoc_url = quingoc_asset['browser_download_url'] + '/' + quingoc_asset['name'] + quingoc_url = quingoc_asset['browser_download_url'] + \ + '/' + quingoc_asset['name'] quingoc_response = requests.get(quingoc_url) mlir_compiler_path = tmp_dir_name / quingoc_asset['name'] @@ -144,7 +148,8 @@ def download_and_install_latest_quingoc(): """ os_name = platform.system() if os_name not in ['Linux', 'Windows']: - raise SystemError("Currently pip installation does not support {}".format(os_name)) + raise SystemError( + "Currently pip installation does not support {}".format(os_name)) tmp_dir = tempfile.TemporaryDirectory() tmp_dir_path = Path(tmp_dir.name) @@ -164,7 +169,8 @@ def friendly(command_subclass): def modified_run(self): default_path = Path.home() / '.quingo' - quingoc_path = distutils.spawn.find_executable('quingoc', str(default_path)) + quingoc_path = distutils.spawn.find_executable( + 'quingoc', str(default_path)) if quingoc_path is None: quingoc_path = distutils.spawn.find_executable('quingoc') diff --git a/src/quingo/core/compiler_config.py b/src/quingo/core/compiler_config.py index f0a66d8..8d1bee8 100644 --- a/src/quingo/core/compiler_config.py +++ b/src/quingo/core/compiler_config.py @@ -32,7 +32,7 @@ def set_compiler_path(path_str, is_mlir=False): def download_latest_quingoc(): latest_release_url = "https://gitee.com/api/v5/repos/{owner}/{repo}/releases/latest".format( - owner="hpcl_quanta", repo="quingo-runtime") + owner="quingo", repo="quingo-runtime") try: latest_release = get_text(latest_release_url) diff --git a/src/quingo/core/manager.py b/src/quingo/core/manager.py index d0013f1..d9c8a59 100755 --- a/src/quingo/core/manager.py +++ b/src/quingo/core/manager.py @@ -135,7 +135,8 @@ class Runtime_system_manager(): - mlir """ if (compiler_name not in self.supported_compilers): - raise ValueError("Found unsupported compiler: {}".format(compiler_name)) + raise ValueError( + "Found unsupported compiler: {}".format(compiler_name)) self.compiler_name = compiler_name @@ -182,7 +183,8 @@ class Runtime_system_manager(): try: self.backend = backend_hub.get_instance(backend_name) except Exception as e: - quingo_err("Cannot connect backend '{}' with the following error:".format(backend_name)) + quingo_err( + "Cannot connect backend '{}' with the following error:".format(backend_name)) quingo_err("{}".format(e)) quingo_info("To fix this problem, you could explicitly connect another " "backend use the the following method: \n" @@ -318,13 +320,16 @@ class Runtime_system_manager(): "The backend {} is not available.".format(backend.name())) if self.mode == 'state_vector' and not backend.is_simulator(): - raise ValueError("Cannot retrieve state vector from a non-simulator backend.") + raise ValueError( + "Cannot retrieve state vector from a non-simulator backend.") if self.verbose: - quingo_msg("Uploading the program to the backend {}...".format(backend.name())) + quingo_msg( + "Uploading the program to the backend {}...".format(backend.name())) if not backend.upload_program(self.qasm_file_path): - quingo_err("Failed to upload the program to the backend {}.".format(backend.name())) + quingo_err( + "Failed to upload the program to the backend {}.".format(backend.name())) quingo_info(" Suggestion: are you uploading QCIS program to an eQASM backend " "or eQASM program to a QCIS backend?\n" " If so, please specify the compiler and backend accordingly.") @@ -359,10 +364,11 @@ class Runtime_system_manager(): if compiler_name == 'mlir': quingoc_path = get_mlir_path() if quingoc_path is None: - quingo_err("Cannot find the mlir-based quingoc compiler in the system path.") + quingo_err( + "Cannot find the mlir-based quingoc compiler in the system path.") quingo_info( "To resolve this problem, you can download quingoc from " - "https://gitee.com/hpcl_quanta/quingo-runtime/releases and save " + "https://gitee.com/quingo/quingo-runtime/releases and save " "it at a directory in the system path \n" "or configure its path by calling this method inside python:\n" " `quingo.quingo_interface.set_mlir_compiler_path()`") @@ -432,8 +438,10 @@ class Runtime_system_manager(): compile_files.extend(user_files) compile_files.extend(default_files) - logger.debug(self.compose_xtext_cmd(compile_cmd_head, compile_files, print=True)) - compile_cmd = self.compose_xtext_cmd(compile_cmd_head, compile_files, False) + logger.debug(self.compose_xtext_cmd( + compile_cmd_head, compile_files, print=True)) + compile_cmd = self.compose_xtext_cmd( + compile_cmd_head, compile_files, False) else: raise ValueError("Found undefined compiler to use.") -- Gitee