Performing gate split operation using *cuTensorNet* adopts a very similar workflow as :ref:`QR example` and :ref:`SVD example`. Here, we here highlight the notable differences between the two APIs. The full code can be found in the `NVIDIA/cuQuantum `_ repository (`here `_). ---------------------- Define tensor operands ---------------------- As with QR/SVD decomposition, we first define all the tensor operands by specifying the data type, modes partition, and the extents. In this process, we choose to perform fixed extent truncation to a size of 16. .. literalinclude:: ../../../../tensor_network/samples/approxTN/gate_split_example.cu :language: c++ :linenos: :lineno-match: :start-after: Sphinx: #2 :end-before: Sphinx: #3 --------- Execution --------- Similar to :ref:`SVD example`, we can specify the SVD options in `cutensornetTensorSVDConfig_t`. Workspace size query can be achieved by calling `cutensornetWorkspaceComputeGateSplitSizes` with the provided `cutensornetGateSplitAlgo_t`. Finally, we can execute the gate split computation by calling `cutensornetGateSplit`. .. literalinclude:: ../../../../tensor_network/samples/approxTN/gate_split_example.cu :language: c++ :linenos: :lineno-match: :start-after: Sphinx: #7 :end-before: Sphinx: #8 .. note:: Like in `cutensornetTensorSVD`, since we turned on weighted truncation options in this example, the tensor descriptors for outputs A and B need to be restored if we wish to perform the same computation multiple times. After the computation, we always need to free up all resources.