# 6G Network Architecture Using FSO-PDM/PV-OCDMA System with Weather Performance Analysis
## 2 PV Code Construction  
The PV code is characterized by the code length (\(C_{L}\)), code weight (\(C_{W}\)), zero cross-correlation, and the number of users (\(N\)). The construction of the PV code is based on permutation vectors. The \(C_{L}\) can be expressed in terms of \(C_{W}\) and \(N\) as [15]  
\[C_{L}=C_{W}\ \times\ N \tag{1}\]  
To explain the code construction, let \(Z\) indicate the field of real numbers, and \(Z^{n}\) represent the space of n-tuples of real numbers that form an n-dimensional vector space over \(Z\). Furthermore, express the dimension of vector space, \(S\), over the field \(Z\) as dim \(Z\) (S), so the element \(S\) of \(Z^{n}\) can be represented as [15]  
\[S=\begin{bmatrix}s_{1}\\ s_{2}\\.\\.\\ s_{n}\end{bmatrix} \tag{2}\]  
Thus, in general, dim \(Z\) (\(Z^{n}\)) = \(n\). Using a standard basis of vector, so the vector \(S\) can be expressed as a linear combination as [15]  
\[S=s_{1}e_{1}+s_{2}e_{2}+\ldots+s_{n}e_{n} \tag{3}\]  
where \(e_{1},e_{2},\ldots,e_{n}\) are the standard unit basis of \(Z^{n}\). Let L: \(Z^{n}\to Z^{n}\) be a linear transformation that is defined as [15]  
\[\text{L}(e_{1})=\begin{bmatrix}1\\ 0\\ \cdot\\ \cdot\\ 0\end{bmatrix};\,\text{L}(e_{2})=\begin{bmatrix}0\\ 1\\ \cdot\\ \cdot\\ 0\end{bmatrix};\,\ldots;\,\text{L}(e_{n})=\begin{bmatrix}0\\ 0\\ \cdot\\ \cdot\\ 1\end{bmatrix} \tag{4}\]  
The matrix of representation can be written as  
\[\left[\text{L}(e_{1})\,,\,\text{L}(e_{2})\,,\,\ldots,\,\text{L}(e_{n})\right] =\begin{bmatrix}\begin{bmatrix}1\\ 0\\ \cdot\\ \cdot\\ 0\end{bmatrix};\,\begin{bmatrix}0\\ 1\\ \cdot\\ 0\end{bmatrix};\ldots;\,\begin{bmatrix}0\\ 0\\ \cdot\\ \cdot\\ 1\end{bmatrix}\right] \tag{5}\]  
As an example, at \(n\) = 4, the matrix of representation of \(Z^{4}\) is [15]  
\[\left[\text{L}(e_{1})\,,\,\text{L}(e_{2})\,,\,\text{L}(e_{3})\,,\,\text{L}(e_{4 })\right]=\begin{bmatrix}\begin{bmatrix}1\\ 0\\ 0\\ 0\end{bmatrix};\,\begin{bmatrix}0\\ 0\\ 1\\ 0\end{bmatrix};\,\begin{bmatrix}0\\ 0\\ 0\end{bmatrix};\,\begin{bmatrix}0\\ 0\\ 0\end{bmatrix}\,\right] \tag{6}\]  
A PV is a \(1\times\) m or m \(\times\) 1 vector. So, the following permutation matrix and PV are the same [15]  
\[\text{Permutation}=\begin{bmatrix}1\\ 2\\ 3\\ 4\end{bmatrix}\leftrightarrow\left[\text{L}(e_{1})\,,\,\text{L}(e_{2})\,,\, \text{L}(e_{3})\,,\,\text{L}(e_{4})\right]=\begin{bmatrix}\begin{bmatrix} 1\\ 0\\ 0\\ 0\end{bmatrix};\,\begin{bmatrix}0\\ 0\\ 0\end{bmatrix};\,\begin{bmatrix}0\\ 0\\ 0\end{bmatrix};\,\begin{bmatrix}0\\ 0\\ 0\end{bmatrix}\,\right] \tag{7}\]  
Based on \(N\), \(C_{w}\) and the above definitions, all possibilities of PV code can be generated by getting all permutations of the vectors with repetition of [L(e_{1}), L(e_{2}), L(e_{3}),\,\text{L}(e_{4})\)] each vector \(C_{w}\) times. So, the PV code consists of \(N\times C_{L}\) matrix and its construction depend on \(Z^{N}\) and an arbitrary PV which can be given as [15]  
\[\text{PV}=\left(\,Z^{N}\Big{|}perm\,\right)_{N\times C_{L}} \tag{8}\]where perm is a PV used to permute the columns of the matrix and the number of perm possibilities is given as  
\[\text{PV possibilities}=\frac{(C_{W}N)!}{(C_{W}!(C_{L}-C_{W})!)} \tag{9}\]  
An example, if we want to generate PV code that has four users and \(C_{W}\) = 2, then there will be 28 possibilities of PV code according to Equation (9) with \(C_{L}\)= 4 \(\times\) 2 = 8. Two of these possibilities can be written as [15]  
\[\text{First possible PV code}==\begin{bmatrix}00100010\\ 00001100\\ 01000001\\ 10010000\end{bmatrix} \tag{10}\]  
\[\text{Second possible PV code}==\begin{bmatrix}00101000\\ 00000101\\ 10000010\\ 01010000\end{bmatrix}\]  
In this study, we consider the first possible PV code.