guan404ming opened a new pull request, #567: URL: https://github.com/apache/mahout/pull/567
### Purpose of PR Fix quantum teleportation example to work with QuMat API by resolving backend configuration, circuit initialization, and gate method issues. ### Linked Issues Add links to related issues. - Closes #XXX (create issue for quantum teleportation example fixes) ### Changes Made - [x] Bug fix - [ ] New feature - [ ] Documentation update ### Important ToDos Please mark each with an "x" A GitHub issue exists (if not, please create one) [https://github.com/apache/mahout/issues] - [ ] Title of PR is "Issue #XXXX: Fix quantum teleportation example to work with QuMat API" where XXXX is the GitHub issue number. - [ ] Created unit tests where appropriate (N/A - example fix) - [ ] Added correct licenses on newly added files (N/A - only modified existing file) - [ ] Assigned GitHub issue to self - [ ] Added documentation in ScalaDocs/JavaDocs and to the website (N/A - example fix) - [x] Successfully built and ran all unit tests, verified that all tests pass locally If all of these items are not yet complete, but you still feel it is appropriate to open a PR, please open it as a **Draft PR** instead. Once all requirements are met, you can mark it as ready for review. ### Breaking Changes Does this PR introduce a breaking change? - [ ] Yes - [x] No ### Testing & Verification Describe how you tested the changes. - [ ] Unit tests added (N/A for example fix) - [x] Manually tested (verified example runs successfully) **Testing performed:** - Verified `python3 ./examples/quantum_teleportation.py` executes without errors - Confirmed quantum teleportation protocol completes with correct measurement results ### Checklist - [ ] The title follows the format "MAHOUT-XXXX Brief Description" - [ ] GitHub issue is created - [x] Code follows ASF guidelines **Summary of Changes:** **Fixed quantum_teleportation.py execution issues:** - **Backend configuration**: Changed backend name from incorrect `"qiskit_simulator"` to correct `"qiskit"` - **Circuit initialization**: Replaced `create_empty_circuit(3)` with `qiskit.QuantumCircuit(3, 3)` to include classical bits for measurement - **Gate method names**: Fixed incorrect method calls: - `apply_x_gate(2)` → `apply_pauli_x_gate(2)` - `apply_z_gate(2)` → `apply_pauli_z_gate(2)` - **Import statement**: Added missing `import qiskit` for direct circuit creation - **Applied fixes to both sender and receiver circuits** for complete functionality -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
