Total number of multiplications

Hello Everyone,

The below is the default OpenFHE BFV code (https://github.com/openfheorg/openfhe-development/blob/main/src/pke/examples/simple-integers.cpp) with multiplicative depth 4. After 15 multiplications I am unbale to multiply. Even changing multiplicative depth from 4 to 5 still 15 multiplication are possible.
Am I on the right track ?

parameters.SetPlaintextModulus(65537);
parameters.SetMultiplicativeDepth(4);

std::vector<int64_t> vectorOfInts1 = {1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2};
Plaintext plaintext1 = cryptoContext->MakePackedPlaintext(vectorOfInts1);
// Second plaintext vector is encoded
std::vector<int64_t> vectorOfInts2 = {2, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2};
Plaintext plaintext2 = cryptoContext->MakePackedPlaintext(vectorOfInts2);

\Homomorphic Multiplication

auto ciphertextMul1 = cryptoContext->EvalMult(ciphertext1, ciphertext2);
auto ciphertextMul2 = cryptoContext->EvalMult(ciphertext1, ciphertext2);
auto ciphertextMul3 = cryptoContext->EvalMult(ciphertext1, ciphertext2);
auto ciphertextMul4 = cryptoContext->EvalMult(ciphertext1, ciphertext2);
auto ciphertextMul5 = cryptoContext->EvalMult(ciphertext1, ciphertext2);
auto ciphertextMul6 = cryptoContext->EvalMult(ciphertext1, ciphertext2);
auto ciphertextMul7 = cryptoContext->EvalMult(ciphertext1, ciphertext2);
auto ciphertextMul8 = cryptoContext->EvalMult(ciphertext1, ciphertext2);

auto ciphertextMul9 = cryptoContext->EvalMult(ciphertextMul1, ciphertextMul2);
auto ciphertextMul10 = cryptoContext->EvalMult(ciphertextMul3, ciphertextMul4);
auto ciphertextMul11 = cryptoContext->EvalMult(ciphertextMul5, ciphertextMul6);
auto ciphertextMul12 = cryptoContext->EvalMult(ciphertextMul7, ciphertextMul8);

auto ciphertextMul13 = cryptoContext->EvalMult(ciphertextMul9, ciphertextMul10);
auto ciphertextMul14 = cryptoContext->EvalMult(ciphertextMul11, ciphertextMul12);

auto ciphertextMul15 = cryptoContext->EvalMult(ciphertextMul13, ciphertextMul14);

Thanks in advance.

I am not sure I understand the question (it is not clearly formulated). Changing the multiplicative depth from 4 to 5 should allow you to do more multiplications (by design) - one more level. Is that what you are asking and observing?

Yes.

By setting multiplicative depth to 5, it should allow more multiplication.

In my understanding it uses binary tree multiplication. This, setting 5 should enable 32 multiplication.
But my implementation code only multiply 15 ciphertext sat depth 5.

Are you saying that if you add more multiplications and set the multiplicative depth to 5, you get an incorrect answer? If yes, please provide the example. Or are you asking something else? I still don’t understand what your question is. Thanks.