[
https://issues.apache.org/jira/browse/MAHOUT-624?focusedWorklogId=991560&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-991560
]
ASF GitHub Bot logged work on MAHOUT-624:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 13/Nov/25 18:02
Start Date: 13/Nov/25 18:02
Worklog Time Spent: 10m
Work Description: shiavm006 opened a new pull request, #627:
URL: https://github.com/apache/mahout/pull/627
### Purpose of PR
Add comprehensive qubit index validation to all gate methods in the QuMat
frontend layer, preventing cryptic backend-specific errors and improving
developer experience with clear, actionable error messages.
### Related Issues or PRs
Fixes #624
### Changes Made
- [x] Bug fix
- [ ] New feature
- [ ] Refactoring
- [ ] Documentation
- [ ] Test
- [ ] CI/CD pipeline
- [ ] Other
### Description
Added `_validate_qubit_index()` helper method that validates:
- Type checking (must be integer)
- Range validation (non-negative)
- Bounds checking (within 0 to num_qubits-1)
Integrated validation into all 13 gate application methods:
- Single-qubit gates (9): `apply_hadamard_gate`, `apply_not_gate`,
`apply_pauli_x_gate`, `apply_pauli_y_gate`, `apply_pauli_z_gate`,
`apply_rx_gate`, `apply_ry_gate`, `apply_rz_gate`, `apply_u_gate`
- Two-qubit gates (3): `apply_cnot_gate`, `apply_swap_gate`, plus
multi-index `apply_cswap_gate`
- Three-qubit gates (1): `apply_toffoli_gate`
### Breaking Changes
- [ ] Yes
- [x] No
### Checklist
- [x] Added or updated unit tests for all changes
- [x] Added or updated documentation for all changes
- [x] Successfully built and ran all unit tests or manual tests locally
- [ ] PR title follows "MAHOUT-XXX: Brief Description" format (if related to
an issue)
- [x] Code follows ASF guidelines
Issue Time Tracking
-------------------
Worklog Id: (was: 991560)
Remaining Estimate: 0h
Time Spent: 10m
> Documentation links broken on mahout.apache site
> ------------------------------------------------
>
> Key: MAHOUT-624
> URL: https://issues.apache.org/jira/browse/MAHOUT-624
> Project: Mahout
> Issue Type: Bug
> Reporter: Ted Dunning
> Assignee: Sean R. Owen
> Priority: Major
> Fix For: 0.5
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> All of our links to hudson have failed. The new link for the documentation
> should be based at
> https://builds.apache.org/hudson/job/Mahout-Quality/
> I am not sure how to change or push the site. Otherwise, I would have.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)