diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 000000000..85e11d49a --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,8 @@ +"""Sphinx configuration for the TensorFlow Quantum docs. + +Adjust extensions and Sphinx options here. +""" + +extensions = [ + 'sphinx.ext.mathjax', +] diff --git a/tensorflow_quantum/core/ops/math_ops/fidelity_op.py b/tensorflow_quantum/core/ops/math_ops/fidelity_op.py index 8f2e87e44..a8c37a4ba 100644 --- a/tensorflow_quantum/core/ops/math_ops/fidelity_op.py +++ b/tensorflow_quantum/core/ops/math_ops/fidelity_op.py @@ -25,9 +25,11 @@ def fidelity(programs, symbol_names, symbol_values, other_programs): Compute (potentially many) fidelities between the given circuits and the symbol free comparison circuits. - Calculates out[i][j] = $ | \langle \psi_{\text{programs[i]}} \\ - (\text{symbol\_values[i]}) | \psi_{\text{other\_programs[j]}} \rangle \\ - |^2 $ + Calculates out[i][j] as: + $$ + |\langle \psi_{\text{programs[i]}}(\text{symbol\_values[i]}) \mid + \psi_{\text{other\_programs[j]}} \rangle|^2 + $$ >>> symbols = sympy.symbols('alpha beta') diff --git a/tensorflow_quantum/core/ops/math_ops/inner_product_op.py b/tensorflow_quantum/core/ops/math_ops/inner_product_op.py index 5d92b7b92..65f2bd08c 100644 --- a/tensorflow_quantum/core/ops/math_ops/inner_product_op.py +++ b/tensorflow_quantum/core/ops/math_ops/inner_product_op.py @@ -75,8 +75,11 @@ def inner_product(programs, symbol_names, symbol_values, other_programs): Compute (potentially many) inner products between the given circuits and the symbol free comparison circuits. - Calculates out[i][j] = $ \langle \psi_{\text{programs[i]}} \\ - (\text{symbol\_values[i]}) | \psi_{\text{other\_programs[j]}} \rangle $ + Calculates out[i][j] as: + $$ + \langle \psi_{\text{programs[i]}}(\text{symbol\_values[i]}) \mid + \psi_{\text{other\_programs[j]}} \rangle + $$ >>> symbols = sympy.symbols('alpha beta')