Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove linalg #190

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ Types of changes:
- Updated `pyqasm` and `qbraid` dependencies ([#183](https://github.com/qBraid/qbraid-qir/pull/183))

### 👋 Deprecations
- Removed `qbraid_qir.qasm3.linag` module in favor of `pyqasm.linalg` ([#190](https://github.com/qBraid/qbraid-qir/pull/190))
11 changes: 6 additions & 5 deletions qbraid_qir/qasm3/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,21 @@
def qasm3_to_qir(
program: Union[openqasm3.ast.Program, str],
name: Optional[str] = None,
external_gates: Optional[list[str]] = None,
**kwargs,
) -> Module:
"""Converts an OpenQASM 3 program to a PyQIR module.

Args:
program (openqasm3.ast.Program or str): The OpenQASM 3 program to convert.
name (str, optional): Identifier for created QIR module. Auto-generated if not provided.
external_gates (list[str], optional): A list of custom gate names that are not natively
recognized by pyqasm but should be treated as valid during program unrolling.

Keyword Args:
initialize_runtime (bool): Whether to perform quantum runtime environment initialization,
default `True`.
record_output (bool): Whether to record output calls for registers, default `True`
defaults to `True`.
record_output (bool): Whether to record output calls for registers, defaults to `True`.

Returns:
The QIR ``pyqir.Module`` representation of the input OpenQASM 3 program.
Expand All @@ -52,8 +55,6 @@ def qasm3_to_qir(
elif not isinstance(program, str):
raise TypeError("Input quantum program must be of type openqasm3.ast.Program or str.")

external_gates: list[str] = kwargs.get("external_gates", [])

qasm3_module = pyqasm.loads(program)
qasm3_module.unroll(external_gates=external_gates)
if name is None:
Expand All @@ -62,7 +63,7 @@ def qasm3_to_qir(

final_module = QasmQIRModule(name, qasm3_module, llvm_module)

visitor = QasmQIRVisitor(**kwargs)
visitor = QasmQIRVisitor(external_gates=external_gates, **kwargs)
final_module.accept(visitor)

err = llvm_module.verify()
Expand Down
324 changes: 0 additions & 324 deletions qbraid_qir/qasm3/linalg.py

This file was deleted.

Loading
Loading