Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Fix handling of cargs in BasicQisVisitor#37

Merged
idavis merged 1 commit intomicrosoft:mainfrom
Alice-Bob-SW:fix-clbits-in-process_composite_instruction
Apr 19, 2023
Merged

Fix handling of cargs in BasicQisVisitor#37
idavis merged 1 commit intomicrosoft:mainfrom
Alice-Bob-SW:fix-clbits-in-process_composite_instruction

Conversation

@jrj-d
Copy link
Copy Markdown
Contributor

@jrj-d jrj-d commented Apr 3, 2023

The unit tests in this commit fail without the change made to file src/qiskit_qir/visitor.py.

File ~/ab/demos/20230404/venv/lib/python3.9/site-packages/qiskit_qir/visitor.py:189, in <listcomp>(.0)
    187 for (inst, i_qargs, i_cargs) in subcircuit.data:
    188     mapped_qbits = [qargs[subcircuit.qubits.index(i)] for i in i_qargs]
--> 189     mapped_clbits = [cargs[subcircuit.clbits.index] for i in i_cargs]
    190     _log.debug(
    191         f"Processing sub-instruction {inst.name} with mapped qubits {mapped_qbits}")
    192     self.visit_instruction(inst, mapped_qbits, mapped_clbits)

TypeError: list indices must be integers or slices, not builtin_function_or_method

@jrj-d
Copy link
Copy Markdown
Contributor Author

jrj-d commented Apr 3, 2023

@microsoft-github-policy-service agree company="Alice & Bob"

@idavis
Copy link
Copy Markdown
Contributor

idavis commented Apr 3, 2023

Thanks for the PR @jrj-d! Would you mind re-signing the CLA without the company name for an individual contributions?

Options:
(default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.

@microsoft-github-policy-service agree

@idavis
Copy link
Copy Markdown
Contributor

idavis commented Apr 11, 2023

@jrj-d Following up. Happy to merge once we resolve the CLA check.

@jrj-d
Copy link
Copy Markdown
Contributor Author

jrj-d commented Apr 14, 2023

@microsoft-github-policy-service agree

@jrj-d
Copy link
Copy Markdown
Contributor Author

jrj-d commented Apr 14, 2023

Sorry I missed your message @idavis !

@jrj-d jrj-d mentioned this pull request Apr 14, 2023
@idavis idavis force-pushed the fix-clbits-in-process_composite_instruction branch from e8285fa to e17f5cb Compare April 19, 2023 03:38
The unit tests in this commit fail without the change made to file
src/qiskit_qir/visitor.py.
@idavis idavis merged commit b972ed9 into microsoft:main Apr 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants