{"id":37071290,"url":"https://github.com/chigwell/quantum-spec-parser","last_synced_at":"2026-01-14T08:19:51.650Z","repository":{"id":329744335,"uuid":"1120553106","full_name":"chigwell/quantum-spec-parser","owner":"chigwell","description":"A new package designed to extract and structure key technical specifications from quantum computing research and development texts. The package takes unstructured text input describing quantum process","archived":false,"fork":false,"pushed_at":"2025-12-21T13:16:29.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-23T04:44:58.568Z","etag":null,"topics":["benchmarking","data-consistency","developers","engineers","fidelity-ranges","llmatch-messages-integration","material-composition","quantum-computing","quantum-hardware-advancement","qubit-count","research-development","specification-extraction","structured-output","unstructured-data-parsing"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/quantum-spec-parser/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chigwell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-21T13:16:20.000Z","updated_at":"2025-12-21T13:16:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/chigwell/quantum-spec-parser","commit_stats":null,"previous_names":["chigwell/quantum-spec-parser"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/chigwell/quantum-spec-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fquantum-spec-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fquantum-spec-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fquantum-spec-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fquantum-spec-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chigwell","download_url":"https://codeload.github.com/chigwell/quantum-spec-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fquantum-spec-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:16:59.381Z","status":"ssl_error","status_checked_at":"2026-01-14T08:13:45.490Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["benchmarking","data-consistency","developers","engineers","fidelity-ranges","llmatch-messages-integration","material-composition","quantum-computing","quantum-hardware-advancement","qubit-count","research-development","specification-extraction","structured-output","unstructured-data-parsing"],"created_at":"2026-01-14T08:19:51.095Z","updated_at":"2026-01-14T08:19:51.645Z","avatar_url":"https://github.com/chigwell.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# quantum-spec-parser\n[![PyPI version](https://badge.fury.io/py/quantum-spec-parser.svg)](https://badge.fury.io/py/quantum-spec-parser)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n[![Downloads](https://static.pepy.tech/badge/quantum-spec-parser)](https://pepy.tech/project/quantum-spec-parser)\n[![LinkedIn](https://img.shields.io/badge/LinkedIn-blue)](https://www.linkedin.com/in/eugene-evstafev-716669181/)\n\n\n**quantum-spec-parser** is a lightweight Python package that extracts and structures key technical specifications from unstructured quantum computing texts. It parses descriptions of quantum processors and returns a standardized list containing essential details such as qubit count, material composition, and fidelity ranges.\n\nThe package relies on the **llmatch‑messages** library for robust pattern matching and uses **ChatLLM7** (from `langchain_llm7`) as the default language model. You can also supply any LangChain‑compatible LLM of your choice.\n\n---\n\n## 📦 Installation\n\n```bash\npip install quantum_spec_parser\n```\n\n---\n\n## 🚀 Quick Start\n\n```python\nfrom quantum_spec_parser import quantum_spec_parser\n\n# Example unstructured description of a quantum processor\nuser_input = \"\"\"\nThe new Q-42 chip features 56 superconducting transmon qubits fabricated on a silicon substrate.\nGate fidelity lies between 99.2% and 99.7%, and the coherence time averages 120 µs.\n\"\"\"\n\n# Simple call – uses the default ChatLLM7 internally\nspecs = quantum_spec_parser(user_input)\n\nprint(specs)\n# → ['56 qubits', 'silicon substrate', 'fidelity 99.2%‑99.7%', 'coherence time 120 µs']\n```\n\n---\n\n## 📚 Detailed Usage\n\n### Function Signature\n\n```python\ndef quantum_spec_parser(\n    user_input: str,\n    api_key: Optional[str] = None,\n    llm: Optional[BaseChatModel] = None,\n) -\u003e List[str]:\n```\n\n| Parameter   | Type                     | Description |\n|-------------|--------------------------|-------------|\n| `user_input`| `str`                    | The raw text containing quantum processor specifications. |\n| `api_key`   | `Optional[str]`          | Your LLM7 API key. If omitted, the function reads `LLM7_API_KEY` from the environment or falls back to a placeholder. |\n| `llm`       | `Optional[BaseChatModel]`| A LangChain LLM instance to use instead of the default `ChatLLM7`. Any model that implements `BaseChatModel` works. |\n\nIf `llm` is **not** provided, the function automatically creates a `ChatLLM7` instance using the supplied (or env‑provided) API key.\n\n---\n\n### Using a Custom LLM\n\nYou can replace the default **ChatLLM7** with any LangChain‑compatible model, such as OpenAI, Anthropic, or Google Generative AI.\n\n#### OpenAI\n\n```python\nfrom langchain_openai import ChatOpenAI\nfrom quantum_spec_parser import quantum_spec_parser\n\nllm = ChatOpenAI(model=\"gpt-4o-mini\")\nresponse = quantum_spec_parser(user_input, llm=llm)\n```\n\n#### Anthropic\n\n```python\nfrom langchain_anthropic import ChatAnthropic\nfrom quantum_spec_parser import quantum_spec_parser\n\nllm = ChatAnthropic(model=\"claude-3-haiku-20240307\")\nresponse = quantum_spec_parser(user_input, llm=llm)\n```\n\n#### Google Generative AI\n\n```python\nfrom langchain_google_genai import ChatGoogleGenerativeAI\nfrom quantum_spec_parser import quantum_spec_parser\n\nllm = ChatGoogleGenerativeAI(model=\"gemini-1.5-flash\")\nresponse = quantum_spec_parser(user_input, llm=llm)\n```\n\n---\n\n### Supplying Your Own LLM7 API Key\n\nThe free tier of LLM7 usually suffices, but for higher rate limits you can provide a personal key:\n\n```python\nresponse = quantum_spec_parser(user_input, api_key=\"your-llm7-api-key\")\n```\n\nOr set it globally via the environment:\n\n```bash\nexport LLM7_API_KEY=\"your-llm7-api-key\"\n```\n\nYou can obtain a free key by registering at \u003chttps://token.llm7.io/\u003e.\n\n---\n\n## 🛠️ Under the Hood\n\n1. **Prompt construction** – The package builds system and human prompts defined in `prompts.py`.\n2. **Pattern matching** – A regular expression (`pattern`) is compiled and passed to `llmatch` from `llmatch_messages`.\n3. **LLM call** – The selected LLM generates a response.\n4. **Extraction** – `llmatch` validates the response against the regex and returns the extracted data as a list of strings.\n\nIf the LLM call fails or the response does not match the pattern, a `RuntimeError` is raised with the underlying error message.\n\n---\n\n## 🐞 Issues \u0026 Contributions\n\nIf you encounter bugs or have feature requests, please open an issue:\n\n\u003chttps://github....\u003e\n\nPull requests are welcome! Feel free to fork the repository and submit your improvements.\n\n---\n\n## ✍️ Author\n\n**Eugene Evstafev** – \u003chi@euegne.plus\u003e  \nGitHub: [chigwell](https://github.com/chigwell)\n\n---\n\n## 📜 License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchigwell%2Fquantum-spec-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchigwell%2Fquantum-spec-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchigwell%2Fquantum-spec-parser/lists"}