Apr-26-2022, 12:20 PM
Hello everyone
Suppose I have two arrays:
![[Image: generator-matrix.png]](https://i.ibb.co/Tc4PrMx/generator-matrix.png)
and
![[Image: received-message.png]](https://i.ibb.co/xzkyZN8/received-message.png)
And I wanted to do calculations using this equation:
![[Image: operations.png]](https://i.ibb.co/hBTRNtT/operations.png)
The code that I have created so far:
Suppose I have two arrays:
![[Image: generator-matrix.png]](https://i.ibb.co/Tc4PrMx/generator-matrix.png)
and
![[Image: received-message.png]](https://i.ibb.co/xzkyZN8/received-message.png)
And I wanted to do calculations using this equation:
![[Image: operations.png]](https://i.ibb.co/hBTRNtT/operations.png)
The code that I have created so far:
import numpy as np import math as mt G = np.array([[1, 0, 0, 0, 0, 0, 0, 0], [1, 1, 0, 0, 0, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0], [1, 1, 1, 1, 0, 0, 0, 0], [1, 0, 0, 0, 1, 0, 0, 0], [1, 1, 0, 0, 1, 1, 0, 0], [1, 0, 1, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 1, 1]]) r = np.array([-56.53511658, -96.6740462, -85.23212419, -90.05029513, -86.19336384, -79.31883055, -67.7323369, -86.49784743]) def boxplus(a, b): return 2 * aatanh(mt.tanh(a / 2) * mt.tanh(b / 2)) def aatanh(x): if x == 1: return mt.atanh(x - 0.0000001) elif x == -1: return mt.atanh(x + 0.0000001) else: return mt.atanh(x) L = np.zeros(8)Right now I am stuck on how to do the boxplus operation and put it into array L. And please forgive me if my post is in wrong location.