EvalAutomorphismKeyGen ModInverse index

Hello, I don’t understand why compute ModInverse of index in EvalAutomorphismKeyGen.
In SEAL, create_galois_keys use the galois_elt of input to do apply_galois_ntt of secret_key.

for (size_t i = 0; i < sz; ++i) {
        PrivateKey<Element> privateKeyPermuted = std::make_shared<PrivateKeyImpl<Element>>(cc);

        uint32_t index = NativeInteger(indexList[i]).ModInverse(2 * N).ConvertToInt();
        std::vector<uint32_t> vec(N);
        PrecomputeAutoMap(N, index, &vec);

        privateKeyPermuted->SetPrivateElement(s.AutomorphismTransform(index, vec));
        (*evalKeys)[indexList[i]] = algo->KeySwitchGen(privateKey, privateKeyPermuted);
    }

The double-hoisting optimization from Efficient Bootstrapping for Approximate Homomorphic Encryption with Non-Sparse Keys is used here (See Section 4.2 of the paper). It has no effect on efficiency for a single automorphism but is more efficient when multiple automorphisms for the same ciphertext are needed.