{"id":22015594,"url":"https://github.com/originq/pychemiq","last_synced_at":"2025-10-11T05:30:59.008Z","repository":{"id":97514852,"uuid":"607601036","full_name":"OriginQ/pyChemiQ","owner":"OriginQ","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-23T07:27:11.000Z","size":39,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-23T08:25:52.440Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OriginQ.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-28T09:57:45.000Z","updated_at":"2025-01-23T07:27:15.000Z","dependencies_parsed_at":"2025-01-23T08:32:34.702Z","dependency_job_id":null,"html_url":"https://github.com/OriginQ/pyChemiQ","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OriginQ%2FpyChemiQ","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OriginQ%2FpyChemiQ/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OriginQ%2FpyChemiQ/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OriginQ%2FpyChemiQ/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OriginQ","download_url":"https://codeload.github.com/OriginQ/pyChemiQ/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236043702,"owners_count":19086064,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-30T04:26:33.562Z","updated_at":"2025-10-11T05:30:53.678Z","avatar_url":"https://github.com/OriginQ.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## pyChemiQ\r\n\r\npyChemiQ是一款由本源量子开发的python软件库, 它基于ChemiQ封装的python接口，可以用于在真实量子计算机或虚拟机上实现费米子体系的模拟与计算。支持用户自定义映射、拟设、优化器，方便用户二次开发。该软件包为量子化学计算和方法开发提供了一个简单、轻量且高效的平台。 pyChemiQ 可用于在量子计算机上使用平均场和后平均场方法模拟分子来解决量子化学问题。 pyChemiQ简化了分子结构输入和量子电路之间的转换，最大限度地减少了进入该领域所需的领域专业知识，让感兴趣的学者更方便解决和研究量子计算机上的电子结构问题。\r\n\r\n\r\n- pyChemiQ详细使用文档及代码示例详见：[pyChemiQ-tutorial](https://pychemiq-tutorial.readthedocs.io/en/latest/index.html)\r\n\r\n- 体验全部最新功能的可视化教学工具ChemiQ，请前往 [官网](https://qcloud.originqc.com.cn/zh/chemistryIntroduce) 下载。\r\n\r\n- 若您想在文献中引用pyChemiQ或ChemiQ, 请按照如下格式: Wang Q, Liu H Y, Li Q S, et al. Chemiq: A chemistry simulator for quantum computer[J]. arXiv preprint arXiv:2106.10162, 2021.\r\n\r\n\r\n## 安装pyChemiQ\r\n\r\n我们提供了Linux,macOS,Windows上的python预编译包供安装，目前pyChemiQ支持3.8、3.9、3.10版本的python。\r\n\r\n```python\r\npip install pychemiq\r\n```\r\n\r\n\r\n## 计算氢分子单点能代码示例\r\n\r\n```python\r\nfrom pychemiq import Molecules,ChemiQ,QMachineType\r\nfrom pychemiq.Transform.Mapping import (jordan_wigner,MappingType)\r\nfrom pychemiq.Optimizer import vqe_solver\r\nfrom pychemiq.Circuit.Ansatz import UCC\r\nimport numpy as np\r\n\r\nmultiplicity = 1\r\ncharge = 0\r\nbasis =  \"sto-3g\"\r\ngeom = \"H 0 0 0,H 0 0 0.74\"\r\n\r\nmol = Molecules(\r\n    geometry = geom,\r\n    basis    = basis,\r\n    multiplicity = multiplicity,\r\n    charge = charge)\r\n\r\nfermion_H2 = mol.get_molecular_hamiltonian()\r\npauli_H2 = jordan_wigner(fermion_H2)\r\n\r\n\r\nchemiq = ChemiQ()\r\nmachine_type = QMachineType.CPU_SINGLE_THREAD\r\nmapping_type = MappingType.Jordan_Wigner\r\npauli_size = len(pauli_H2.data())\r\nn_qubits = mol.n_qubits\r\nn_elec = mol.n_electrons\r\nchemiq.prepare_vqe(machine_type,mapping_type,n_elec,pauli_size,n_qubits)\r\nansatz = UCC(\"UCCSD\",n_elec,mapping_type,chemiq=chemiq)\r\n\r\nmethod = \"SLSQP\"\r\ninit_para = np.zeros(ansatz.get_para_num())\r\nsolver = vqe_solver(\r\n        method = method,\r\n        pauli = pauli_H2,\r\n        chemiq = chemiq,\r\n        ansatz = ansatz,\r\n        init_para=init_para)\r\nresult = solver.fun_val\r\nn_calls = solver.fcalls\r\nprint(result)\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foriginq%2Fpychemiq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foriginq%2Fpychemiq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foriginq%2Fpychemiq/lists"}