[
https://issues.apache.org/jira/browse/MAHOUT-682?focusedWorklogId=996050&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-996050
]
ASF GitHub Bot logged work on MAHOUT-682:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 13/Dec/25 02:41
Start Date: 13/Dec/25 02:41
Worklog Time Spent: 10m
Work Description: JiangJiaWei1103 commented on code in PR #724:
URL: https://github.com/apache/mahout/pull/724#discussion_r2616005630
##########
docs/api.md:
##########
@@ -112,3 +139,19 @@
- **Parameters**:
- `param_name` (str): The name of the parameter to handle.
- **Usage**: Automatically invoked when applying parameterized gates to keep
track of parameters efficiently.
+
+## `swap_test(self, ancilla_qubit, qubit1, qubit2)`
+- **Purpose**: Builds the swap-test subcircuit (H–CSWAP–H) to compare two
quantum states.
+- **Parameters**:
+ - `ancilla_qubit` (int): Index of the ancilla control qubit.
+ - `qubit1` (int): Index of the first state qubit.
+ - `qubit2` (int): Index of the second state qubit.
+- **Usage**: Used in overlap/fidelity estimation between two states.
+
+## `measure_overlap(self, qubit1, qubit2, ancilla_qubit=0)`
+- **Purpose**: Executes the swap test and returns |⟨ψ|φ⟩|² using
backend-specific measurement parsing.
+- **Parameters**:
+ - `qubit1` (int): Index of the first state qubit.
+ - `qubit2` (int): Index of the second state qubit.
+ - `ancilla_qubit` (int, optional): Index of the ancilla qubit; defaults to
0.
Review Comment:
```suggestion
- `ancilla_qubit` (int, default to 0): Index of the ancilla qubit.
```
nit: Slightly different from idiomatic usage of specifying "optional" for
default to `None`.
##########
docs/api.md:
##########
@@ -64,10 +72,20 @@
- `qubit_index` (int): Index of the qubit.
- **Usage**: Alters the phase of a qubit without changing its amplitude.
+## `apply_t_gate(self, qubit_index)`
+- **Purpose**: Applies the T (π/8) phase gate to a specified qubit.
+- **Parameters**:
+ - `qubit_index` (int): Index of the qubit.
+- **Usage**: Adds a π/4 phase to |1⟩; with H and CNOT it enables universal
single-qubit control.
Review Comment:
```suggestion
- **Usage**: Adds a π/4 phase to |1⟩. Together with the Hadamard (H) and
CNOT gates, it enables universal single-qubit control.
```
nit: Make the usage description clearer.
Issue Time Tracking
-------------------
Worklog Id: (was: 996050)
Time Spent: 20m (was: 10m)
> The LDA output does not include the topic-probability distribution per
> document (p(z|d)). It outputs only the topics and corresponding words.
> ---------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: MAHOUT-682
> URL: https://issues.apache.org/jira/browse/MAHOUT-682
> Project: Mahout
> Issue Type: Improvement
> Components: classic
> Affects Versions: 0.4
> Reporter: Himanshu Gahlot
> Assignee: Jake Mannix
> Priority: Major
> Fix For: 0.5
>
> Attachments: ASF.LICENSE.NOT.GRANTED--MAHOUT-458.patch,
> ASF.LICENSE.NOT.GRANTED--MAHOUT-458.patch
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> The current implementation of LDA outputs only topics and their words. Many
> applications need the p(z|d) values of a document to use this vector as a
> reduced representation of the document (dimensionality reduction of
> document). We need to introduce a new key which would keep track of the gamma
> values for each document (as obtained from the document.infer() method) and
> writes these to the output stream and finally, PrintLDATopics should output
> these values per document id. Also, outputting the probabilities of words in
> a topic would also provide a more meaningful output.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)