Commit a44155f3 authored by Dmitry I. Lyakh's avatar Dmitry I. Lyakh
Browse files

Activated Tree Tensor Network topology in exatn-gen

parent 73c70b4b
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -275,7 +275,7 @@ void ExatnGenVisitor<TNQVM_COMPLEX_TYPE>::initialize(
    m_initReconstructionRandom = options.get<bool>("init-random");
  }
  m_previousOptExpansion.reset();
  // Default builder: MPS
  // Tensor network builder
  m_reconstructBuilder = "MPS";
  if (m_layersReconstruct > 0) {
    if (options.keyExists<double>("reconstruct-tolerance")) {
@@ -722,6 +722,7 @@ void ExatnGenVisitor<TNQVM_COMPLEX_TYPE>::reconstructCircuitTensor(bool forced)
    auto &networkBuildFactory = *(exatn::numerics::NetworkBuildFactory::get());
    auto builder = networkBuildFactory.createNetworkBuilderShared(m_reconstructBuilder);
    builder->setParameter("max_bond_dim", m_maxBondDim);
    if(m_reconstructBuilder == "TTN") builder->setParameter("arity", 2);
    auto approximant = [&]() {
      if (m_initReconstructionRandom || !m_previousOptExpansion) {
        auto approximantTensorNetwork =
+11 −11
Original line number Diff line number Diff line
@@ -29,17 +29,17 @@
 *   Implementation - Dmitry Lyakh
 *
 **********************************************************************************/
// +-----------------------------+------------------------------------------------------------------------+-------------+--------------------------+
// +-----------------------------+------------------------------------------------------------------------+-----------------+--------------------------+
// |  Initialization Parameter   |                  Parameter Description                                 |    type         |         default          |
// +=============================+========================================================================+=============+==========================+
// +=============================+========================================================================+=================+==========================+
// | reconstruct-gates           | Perform reconstruction after this number of consecutive 2-q gates      |    int          | -1 (no reconstruct)      |
// +-----------------------------+------------------------------------------------------------------------+-------------+--------------------------+
// +-----------------------------+------------------------------------------------------------------------+-----------------+--------------------------+
// | reconstruct-tolerance       | Reconstruction convergence tolerance                                   |    double       | 1e-4                     |
// +-----------------------------+------------------------------------------------------------------------+-------------+--------------------------+
// +-----------------------------+------------------------------------------------------------------------+-----------------+--------------------------+
// | max-bond-dim                | Reconstruction max bond dimension (inside approximating tensor network)|    int          | 16                       |
// +-----------------------------+------------------------------------------------------------------------+-------------+--------------------------+
// | reconstruct-builder         | Reconstruction network builder (builds the tensor network ansatz)      |    string   | "MPS"                    |
// +-----------------------------+------------------------------------------------------------------------+-------------+--------------------------+
// +-----------------------------+------------------------------------------------------------------------+-----------------+--------------------------+
// | reconstruct-builder         | Reconstruction network builder (builds the tensor network ansatz)      | string: MPS,TTN | "MPS"                    |
// +-----------------------------+------------------------------------------------------------------------+-----------------+--------------------------+
#pragma once

#ifdef TNQVM_HAS_EXATN