# How to contribute to openfhe-numpy?

**URL:** <https://openfhe.discourse.group/t/how-to-contribute-to-openfhe-numpy/2274>\
**Category:** OpenFHE-NumPy\
**Created:** [February 8, 2026, 5:37am UTC](https://openfhe.discourse.group/t/how-to-contribute-to-openfhe-numpy/2274 "2026-02-08T05:37:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mayank64ce](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@mayank64ce](https://openfhe.discourse.group/u/mayank64ce)\
**Post date:** [February 8, 2026, 5:37am UTC](https://openfhe.discourse.group/t/how-to-contribute-to-openfhe-numpy/2274/1 "2026-02-08T05:37:10Z")

</div>

Hello all, I think I have found a bug in the openfhe-numpy library that errors out for scalar subtraction. Here is the minimal script to reproduce this error:

```python
import numpy as np

from openfhe import *

import openfhe_numpy as onp

# Cryptographic setup

mult_depth = 4

params = CCParamsCKKSRNS()

cc = GenCryptoContext(params)

params.SetMultiplicativeDepth(mult_depth)

cc.Enable(PKESchemeFeature.PKE)

cc.Enable(PKESchemeFeature.LEVELEDSHE)

cc.Enable(PKESchemeFeature.ADVANCEDSHE)

keys = cc.KeyGen()

ring_dim = cc.GetRingDimension()

batch_size = ring_dim // 2

print(f"\nCKKS ring dimension: {ring_dim}")

print(f"Available slots: {batch_size}")

# Sample input vectors

vector = [1.0, 2.0, 3.0, 4.0, 5.0]

ct_v = onp.array(

cc=cc,

data=vector,

batch_size=batch_size,

order=onp.ROW_MAJOR,

mode="tile",

fhe_type="C",

public_key=keys.publicKey,

)

# Scalar value

scalar = 2.0

print(f"Vector: {vector}")

print(f"Scalar: {scalar}")

# Add scalar to vector

ct_v_add = ct_v + scalar

res_add = ct_v_add.decrypt(keys.secretKey, unpack_type="original")

print(f"Result (add): {res_add}")

# Subtract scalar from vector

ct_v_sub = ct_v + (-scalar)

res_sub_true = ct_v_sub.decrypt(keys.secretKey, unpack_type="original")

print(f"Result (sub true): {res_sub_true}")

# Subtract scalar from vector

ct_v_sub = ct_v - scalar # errors out

res_sub = ct_v_sub.decrypt(keys.secretKey, unpack_type="original")

print(f"Result (sub): {res_sub}")

```

I have prepared a fix for this in my local fork. But I am unable to create a PR on the parent repo.

Let me know if there is any other way to contribute.

---

<div class="post-metadata">

**Author:** ![ypolyakov](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/ypolyakov/32/47_2.png) [@ypolyakov](https://openfhe.discourse.group/u/ypolyakov)\
**Post date:** [March 2, 2026, 11:59am UTC](https://openfhe.discourse.group/t/how-to-contribute-to-openfhe-numpy/2274/2 "2026-03-02T11:59:25Z")

</div>

Thank you. I will reply to you directly. The high-level idea is that we can add your github account to the repo so you could contribute to the `openfhe-numpy` project.

---

<div class="post-metadata">

**Author:** ![mayank64ce](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@mayank64ce](https://openfhe.discourse.group/u/mayank64ce)\
**Post date:** [March 4, 2026, 2:29pm UTC](https://openfhe.discourse.group/t/how-to-contribute-to-openfhe-numpy/2274/3 "2026-03-04T14:29:17Z")

</div>

Hello Yuriy. My github username is `mayank64ce`.
