We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Implement Negation operation for FV HE Scheme
## Feature Description
Negation operations of FV Scheme need to be implemented.

It should Negate a ciphertext object and return the result in ciphertext form.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `syft/frameworks/torch/he/fv/evaluator.py`
Content:
```
1 import copy
2 
3 from syft.frameworks.torch.he.fv.util.operations import poly_add_mod
4 from syft.frameworks.torch.he.fv.util.operations import multiply_add_plain_with_delta
5 from syft.frameworks.torch.he.fv.ciphertext import CipherText
6 from syft.frameworks.torch.he.fv.plaintext import PlainText
7 
8 
9 class Evaluator:
10     def __init__(self, context):
11         self.context = context
12         self.coeff_modulus = context.param.coeff_modulus
13         self.plain_modulus = context.param.plain_modulus
14 
15     def add(self, op1, op2):
16         """Adds two operands using FV scheme.
17 
18         Args:
19             op1 (Ciphertext/Plaintext): First argument.
20             op2 (Ciphertext/Plaintext): Second argument.
21 
22         Returns:
23             If both arguments are Plaintext elements then the result will be a Plaintext object
24                 otherwise a Ciphertext object with value equivalent to the result of addition
25                 operation of two provided arguments.
26         """
27         if isinstance(op1, CipherText) and isinstance(op2, CipherText):
28             return self._add_cipher_cipher(op1, op2)
29 
30         elif isinstance(op1, PlainText) and isinstance(op2, PlainText):
31             return self._add_plain_plain(op1, op2)
32 
33         elif isinstance(op1, PlainText) and isinstance(op2, CipherText):
34             return self._add_plain_cipher(op1, op2)
35 
36         elif isinstance(op1, CipherText) and isinstance(op2, PlainText):
37             return self._add_plain_cipher(op2, op1)
38 
39         else:
40             raise TypeError(f"Addition Operation not supported between {type(op1)} and {type(op2)}")
41 
42     def _add_cipher_cipher(self, ct1, ct2):
43         """Adds two ciphertexts.
44 
45         Args:
46             ct1 (Ciphertext): First argument.
47             ct2 (Ciphertext): Second argument.
48 
49         Returns:
50             A Ciphertext object with value equivalent to result of addition of two provided
51                 arguments.
52         """
53         ct1, ct2 = copy.deepcopy(ct1.data), copy.deepcopy(ct2.data)
54         result = ct2 if len(ct2) > len(ct1) else ct1
55 
56         for i in range(min(len(ct1), len(ct2))):
57             for j in range(len(self.coeff_modulus)):
58                 result[i][j] = poly_add_mod(ct1[i][j], ct2[i][j], self.coeff_modulus[j])
59 
60         return CipherText(result)
61 
62     def _add_plain_cipher(self, pt, ct):
63         """Adds a ciphertext and a plaintext.
64 
65         Args:
66             pt (Plaintext): First argument.
67             ct (Ciphertext): Second argument.
68         Returns:
69             A Ciphertext object with value equivalent to result of addition of two provided
70                 arguments.
71         """
72         ct = copy.deepcopy(ct)
73         return multiply_add_plain_with_delta(ct, pt, self.context)
74 
75     def _add_plain_plain(self, pt1, pt2):
76         """Adds two plaintexts object.
77 
78         Args:
79             pt1 (Plaintext): First argument.
80             pt2 (Plaintext): Second argument.
81 
82         Returns:
83             A Plaintext object with value equivalent to result of addition of two provided
84                 arguments.
85         """
86         pt1, pt2 = copy.deepcopy(pt1), copy.deepcopy(pt2)
87         return PlainText(poly_add_mod(pt1.data, pt2.data, self.plain_modulus))
88
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/syft/frameworks/torch/he/fv/evaluator.py b/syft/frameworks/torch/he/fv/evaluator.py
--- a/syft/frameworks/torch/he/fv/evaluator.py
+++ b/syft/frameworks/torch/he/fv/evaluator.py
@@ -1,6 +1,7 @@
 import copy
 
 from syft.frameworks.torch.he.fv.util.operations import poly_add_mod
+from syft.frameworks.torch.he.fv.util.operations import negate_mod
 from syft.frameworks.torch.he.fv.util.operations import multiply_add_plain_with_delta
 from syft.frameworks.torch.he.fv.ciphertext import CipherText
 from syft.frameworks.torch.he.fv.plaintext import PlainText
@@ -39,6 +40,24 @@
         else:
             raise TypeError(f"Addition Operation not supported between {type(op1)} and {type(op2)}")
 
+    def negate(self, ct):
+        """Negate a cipher i.e -(ct_value)
+
+        Args:
+            ct (Ciphertext): Ciphertext to be negated.
+
+        Returns:
+            A Ciphertext object with value equivalent to result of -(ct_value).
+        """
+        result = copy.deepcopy(ct.data)
+
+        for i in range(len(result)):
+            for j in range(len(result[i])):
+                for k in range(len(result[i][j])):
+                    result[i][j][k] = negate_mod(ct.data[i][j][k], self.coeff_modulus[j])
+
+        return CipherText(result)
+
     def _add_cipher_cipher(self, ct1, ct2):
         """Adds two ciphertexts.

{"golden_diff": "diff --git a/syft/frameworks/torch/he/fv/evaluator.py b/syft/frameworks/torch/he/fv/evaluator.py\n--- a/syft/frameworks/torch/he/fv/evaluator.py\n+++ b/syft/frameworks/torch/he/fv/evaluator.py\n@@ -1,6 +1,7 @@\n import copy\n \n from syft.frameworks.torch.he.fv.util.operations import poly_add_mod\n+from syft.frameworks.torch.he.fv.util.operations import negate_mod\n from syft.frameworks.torch.he.fv.util.operations import multiply_add_plain_with_delta\n from syft.frameworks.torch.he.fv.ciphertext import CipherText\n from syft.frameworks.torch.he.fv.plaintext import PlainText\n@@ -39,6 +40,24 @@\n         else:\n             raise TypeError(f\"Addition Operation not supported between {type(op1)} and {type(op2)}\")\n \n+    def negate(self, ct):\n+        \"\"\"Negate a cipher i.e -(ct_value)\n+\n+        Args:\n+            ct (Ciphertext): Ciphertext to be negated.\n+\n+        Returns:\n+            A Ciphertext object with value equivalent to result of -(ct_value).\n+        \"\"\"\n+        result = copy.deepcopy(ct.data)\n+\n+        for i in range(len(result)):\n+            for j in range(len(result[i])):\n+                for k in range(len(result[i][j])):\n+                    result[i][j][k] = negate_mod(ct.data[i][j][k], self.coeff_modulus[j])\n+\n+        return CipherText(result)\n+\n     def _add_cipher_cipher(self, ct1, ct2):\n         \"\"\"Adds two ciphertexts.\n", "issue": "Implement Negation operation for FV HE Scheme\n## Feature Description\r\nNegation operations of FV Scheme need to be implemented.\r\n\r\nIt should Negate a ciphertext object and return the result in ciphertext form.\n", "before_files": [{"content": "import copy\n\nfrom syft.frameworks.torch.he.fv.util.operations import poly_add_mod\nfrom syft.frameworks.torch.he.fv.util.operations import multiply_add_plain_with_delta\nfrom syft.frameworks.torch.he.fv.ciphertext import CipherText\nfrom syft.frameworks.torch.he.fv.plaintext import PlainText\n\n\nclass Evaluator:\n    def __init__(self, context):\n        self.context = context\n        self.coeff_modulus = context.param.coeff_modulus\n        self.plain_modulus = context.param.plain_modulus\n\n    def add(self, op1, op2):\n        \"\"\"Adds two operands using FV scheme.\n\n        Args:\n            op1 (Ciphertext/Plaintext): First argument.\n            op2 (Ciphertext/Plaintext): Second argument.\n\n        Returns:\n            If both arguments are Plaintext elements then the result will be a Plaintext object\n                otherwise a Ciphertext object with value equivalent to the result of addition\n                operation of two provided arguments.\n        \"\"\"\n        if isinstance(op1, CipherText) and isinstance(op2, CipherText):\n            return self._add_cipher_cipher(op1, op2)\n\n        elif isinstance(op1, PlainText) and isinstance(op2, PlainText):\n            return self._add_plain_plain(op1, op2)\n\n        elif isinstance(op1, PlainText) and isinstance(op2, CipherText):\n            return self._add_plain_cipher(op1, op2)\n\n        elif isinstance(op1, CipherText) and isinstance(op2, PlainText):\n            return self._add_plain_cipher(op2, op1)\n\n        else:\n            raise TypeError(f\"Addition Operation not supported between {type(op1)} and {type(op2)}\")\n\n    def _add_cipher_cipher(self, ct1, ct2):\n        \"\"\"Adds two ciphertexts.\n\n        Args:\n            ct1 (Ciphertext): First argument.\n            ct2 (Ciphertext): Second argument.\n\n        Returns:\n            A Ciphertext object with value equivalent to result of addition of two provided\n                arguments.\n        \"\"\"\n        ct1, ct2 = copy.deepcopy(ct1.data), copy.deepcopy(ct2.data)\n        result = ct2 if len(ct2) > len(ct1) else ct1\n\n        for i in range(min(len(ct1), len(ct2))):\n            for j in range(len(self.coeff_modulus)):\n                result[i][j] = poly_add_mod(ct1[i][j], ct2[i][j], self.coeff_modulus[j])\n\n        return CipherText(result)\n\n    def _add_plain_cipher(self, pt, ct):\n        \"\"\"Adds a ciphertext and a plaintext.\n\n        Args:\n            pt (Plaintext): First argument.\n            ct (Ciphertext): Second argument.\n        Returns:\n            A Ciphertext object with value equivalent to result of addition of two provided\n                arguments.\n        \"\"\"\n        ct = copy.deepcopy(ct)\n        return multiply_add_plain_with_delta(ct, pt, self.context)\n\n    def _add_plain_plain(self, pt1, pt2):\n        \"\"\"Adds two plaintexts object.\n\n        Args:\n            pt1 (Plaintext): First argument.\n            pt2 (Plaintext): Second argument.\n\n        Returns:\n            A Plaintext object with value equivalent to result of addition of two provided\n                arguments.\n        \"\"\"\n        pt1, pt2 = copy.deepcopy(pt1), copy.deepcopy(pt2)\n        return PlainText(poly_add_mod(pt1.data, pt2.data, self.plain_modulus))\n", "path": "syft/frameworks/torch/he/fv/evaluator.py"}], "after_files": [{"content": "import copy\n\nfrom syft.frameworks.torch.he.fv.util.operations import poly_add_mod\nfrom syft.frameworks.torch.he.fv.util.operations import negate_mod\nfrom syft.frameworks.torch.he.fv.util.operations import multiply_add_plain_with_delta\nfrom syft.frameworks.torch.he.fv.ciphertext import CipherText\nfrom syft.frameworks.torch.he.fv.plaintext import PlainText\n\n\nclass Evaluator:\n    def __init__(self, context):\n        self.context = context\n        self.coeff_modulus = context.param.coeff_modulus\n        self.plain_modulus = context.param.plain_modulus\n\n    def add(self, op1, op2):\n        \"\"\"Adds two operands using FV scheme.\n\n        Args:\n            op1 (Ciphertext/Plaintext): First argument.\n            op2 (Ciphertext/Plaintext): Second argument.\n\n        Returns:\n            If both arguments are Plaintext elements then the result will be a Plaintext object\n                otherwise a Ciphertext object with value equivalent to the result of addition\n                operation of two provided arguments.\n        \"\"\"\n        if isinstance(op1, CipherText) and isinstance(op2, CipherText):\n            return self._add_cipher_cipher(op1, op2)\n\n        elif isinstance(op1, PlainText) and isinstance(op2, PlainText):\n            return self._add_plain_plain(op1, op2)\n\n        elif isinstance(op1, PlainText) and isinstance(op2, CipherText):\n            return self._add_plain_cipher(op1, op2)\n\n        elif isinstance(op1, CipherText) and isinstance(op2, PlainText):\n            return self._add_plain_cipher(op2, op1)\n\n        else:\n            raise TypeError(f\"Addition Operation not supported between {type(op1)} and {type(op2)}\")\n\n    def negate(self, ct):\n        \"\"\"Negate a cipher i.e -(ct_value)\n\n        Args:\n            ct (Ciphertext): Ciphertext to be negated.\n\n        Returns:\n            A Ciphertext object with value equivalent to result of -(ct_value).\n        \"\"\"\n        result = copy.deepcopy(ct.data)\n\n        for i in range(len(result)):\n            for j in range(len(result[i])):\n                for k in range(len(result[i][j])):\n                    result[i][j][k] = negate_mod(ct.data[i][j][k], self.coeff_modulus[j])\n\n        return CipherText(result)\n\n    def _add_cipher_cipher(self, ct1, ct2):\n        \"\"\"Adds two ciphertexts.\n\n        Args:\n            ct1 (Ciphertext): First argument.\n            ct2 (Ciphertext): Second argument.\n\n        Returns:\n            A Ciphertext object with value equivalent to result of addition of two provided\n                arguments.\n        \"\"\"\n        ct1, ct2 = copy.deepcopy(ct1.data), copy.deepcopy(ct2.data)\n        result = ct2 if len(ct2) > len(ct1) else ct1\n\n        for i in range(min(len(ct1), len(ct2))):\n            for j in range(len(self.coeff_modulus)):\n                result[i][j] = poly_add_mod(ct1[i][j], ct2[i][j], self.coeff_modulus[j])\n\n        return CipherText(result)\n\n    def _add_plain_cipher(self, pt, ct):\n        \"\"\"Adds a ciphertext and a plaintext.\n\n        Args:\n            pt (Plaintext): First argument.\n            ct (Ciphertext): Second argument.\n        Returns:\n            A Ciphertext object with value equivalent to result of addition of two provided\n                arguments.\n        \"\"\"\n        ct = copy.deepcopy(ct)\n        return multiply_add_plain_with_delta(ct, pt, self.context)\n\n    def _add_plain_plain(self, pt1, pt2):\n        \"\"\"Adds two plaintexts object.\n\n        Args:\n            pt1 (Plaintext): First argument.\n            pt2 (Plaintext): Second argument.\n\n        Returns:\n            A Plaintext object with value equivalent to result of addition of two provided\n                arguments.\n        \"\"\"\n        pt1, pt2 = copy.deepcopy(pt1), copy.deepcopy(pt2)\n        return PlainText(poly_add_mod(pt1.data, pt2.data, self.plain_modulus))\n", "path": "syft/frameworks/torch/he/fv/evaluator.py"}]}