summaryrefslogtreecommitdiff
path: root/dev-python/qiskit-aer/files/qiskit-aer-0.11.2-terra-test.patch
blob: e9f65dd6a42a27b14fdc563276f40545592d287a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
https://github.com/Qiskit/qiskit-aer/commit/cec5c11513118fa8d701e2bef1376dc3db7263c3

From cec5c11513118fa8d701e2bef1376dc3db7263c3 Mon Sep 17 00:00:00 2001
From: Jun Doi <doichan@jp.ibm.com>
Date: Fri, 27 Jan 2023 18:55:59 +0900
Subject: [PATCH] Fix test_aer_statevector (#1710)

* fix test_aer_statevector

* add plot directive to docs

* fix test_aer_statevector and remove reno

Co-authored-by: Hiroshi Horii <horii@jp.ibm.com>
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -67,6 +67,7 @@ extensions = [
     'sphinx_tabs.tabs',
     'jupyter_sphinx',
     'reno.sphinxext',
+    'matplotlib.sphinxext.plot_directive',
 ]
 html_static_path = ['_static']
 templates_path = ['_templates']
--- a/test/terra/states/test_aer_statevector.py
+++ b/test/terra/states/test_aer_statevector.py
@@ -1347,13 +1347,14 @@ class TestAerStatevector(common.QiskitAerTestCase):
             ([-1, 1j], ["-", "+i"]),
             ([1e-16 + 1j], ["i"]),
             ([-1 + 1e-16 * 1j], ["-"]),
-            ([-1, -1 - 1j], ["-", "+ (-1 - i)"]),
+            ([-1, -1 - 1j], ["-", "+(-1 - i)"]),
             ([np.sqrt(2) / 2, np.sqrt(2) / 2], ["\\frac{\\sqrt{2}}{2}", "+\\frac{\\sqrt{2}}{2}"]),
             ([1 + np.sqrt(2)], ["(1 + \\sqrt{2})"]),
         ]
-        for numbers, latex_terms in cases:
-            terms = numbers_to_latex_terms(numbers)
-            self.assertListEqual(terms, latex_terms)
+        with self.assertWarns(DeprecationWarning):
+            for numbers, latex_terms in cases:
+                terms = numbers_to_latex_terms(numbers, 15)
+                self.assertListEqual(terms, latex_terms)
 
     def test_statevector_draw_latex_regression(self):
         """Test numerical rounding errors are not printed"""