# Identifying multiplication depth

**URL:** <https://openfhe.discourse.group/t/identifying-multiplication-depth/1772>\
**Category:** Library Questions\
**Created:** [December 13, 2024, 4:00pm UTC](https://openfhe.discourse.group/t/identifying-multiplication-depth/1772 "2024-12-13T16:00:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ttb](https://avatars.discourse-cdn.com/v4/letter/t/e79b87/32.png) [@ttb](https://openfhe.discourse.group/u/ttb)\
**Post date:** [December 13, 2024, 4:00pm UTC](https://openfhe.discourse.group/t/identifying-multiplication-depth/1772/1 "2024-12-13T16:00:21Z")

</div>

Is there a way to identify the multiplication depth of a final ciphertext produced by an OpenFHE CKKS program, either through a function (such as ciphertext.depth would be helpful, but I’m not sure if something like that exists) or a systematic code analysis?

My program is made up of a number of operations (using EvalInnerProduct, EvalMerge, EvalChebyshev, EvalAdd) and I seem to have difficulty estimating the overall depth from my understanding of these functions.

Thanks a lot

---

<div class="post-metadata">

**Author:** ![Caesar](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/caesar/32/63_2.png) [@Caesar](https://openfhe.discourse.group/u/Caesar)\
**Post date:** [December 13, 2024, 4:35pm UTC](https://openfhe.discourse.group/t/identifying-multiplication-depth/1772/2 "2024-12-13T16:35:06Z")

</div>

You can use `ctxt->GetLevel()` to retrieve the current level of the ciphertext `ctxt`. The ciphertext property `level` starts at 0 (for fresh encryption at the maximum parameters) and keeps incrementing as you multiply until you reach the maximum multiplicative depth. This is an easy way to keep track of the multiplication budget consumed. However, there are some subtleties when multiplication does not consume a level. But for most purposes, this method should be good enough.
