Skip to content

Commit f9be8f7

Browse files
committed
Enable MathJax for Sphinx documentation to fix math rendering
1 parent 3769709 commit f9be8f7

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
extensions = [
2+
'sphinx.ext.mathjax',
3+
]

tensorflow_quantum/core/ops/math_ops/fidelity_op.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ def fidelity(programs, symbol_names, symbol_values, other_programs):
2525
Compute (potentially many) fidelities between the given circuits and
2626
the symbol free comparison circuits.
2727
28-
Calculates out[i][j] = $ | \langle \psi_{\text{programs[i]}} \\
29-
(\text{symbol\_values[i]}) | \psi_{\text{other\_programs[j]}} \rangle \\
30-
|^2 $
28+
Calculates out[i][j] as:
29+
$$
30+
|\langle \psi_{\text{programs[i]}}(\text{symbol\_values[i]}) \mid
31+
\psi_{\text{other\_programs[j]}} \rangle|^2
32+
$$
3133
3234
3335
>>> symbols = sympy.symbols('alpha beta')

tensorflow_quantum/core/ops/math_ops/inner_product_op.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,11 @@ def inner_product(programs, symbol_names, symbol_values, other_programs):
7575
Compute (potentially many) inner products between the given circuits and
7676
the symbol free comparison circuits.
7777
78-
Calculates out[i][j] = $ \langle \psi_{\text{programs[i]}} \\
79-
(\text{symbol\_values[i]}) | \psi_{\text{other\_programs[j]}} \rangle $
78+
Calculates out[i][j] as:
79+
$$
80+
\langle \psi_{\text{programs[i]}}(\text{symbol\_values[i]}) \mid
81+
\psi_{\text{other\_programs[j]}} \rangle
82+
$$
8083
8184
8285
>>> symbols = sympy.symbols('alpha beta')

0 commit comments

Comments
 (0)