We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Fix the handling of file suffixes when saving and loading Qobjs
### Bug Description

This bug was introduced n #1813 and reported by @nleehone in a post-release review of https://github.com/qutip/qutip/pull/1813#pullrequestreview-950335153

### Code to Reproduce the Bug

_No response_

### Code Output

_No response_

### Expected Behaviour

The file suffix should be added if it is not present.

### Your Environment

```shell
QuTiP version: 4.7.0
```


### Additional Context

_No response_

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `qutip/fileio.py`
Content:
```
1 __all__ = ['file_data_store', 'file_data_read', 'qsave', 'qload']
2 
3 import pickle
4 import numpy as np
5 import sys
6 from pathlib import Path
7 
8 
9 # -----------------------------------------------------------------------------
10 # Write matrix data to a file
11 #
12 def file_data_store(filename, data, numtype="complex", numformat="decimal",
13                     sep=","):
14     """Stores a matrix of data to a file to be read by an external program.
15 
16     Parameters
17     ----------
18     filename : str or pathlib.Path
19         Name of data file to be stored, including extension.
20     data: array_like
21         Data to be written to file.
22     numtype : str {'complex, 'real'}
23         Type of numerical data.
24     numformat : str {'decimal','exp'}
25         Format for written data.
26     sep : str
27         Single-character field seperator.  Usually a tab, space, comma,
28         or semicolon.
29 
30     """
31     if filename is None or data is None:
32         raise ValueError("filename or data is unspecified")
33 
34     M, N = np.shape(data)
35 
36     f = open(filename, "w")
37 
38     f.write("# Generated by QuTiP: %dx%d %s matrix " % (M, N, numtype) +
39             "in %s format ['%s' separated values].\n" % (numformat, sep))
40 
41     if numtype == "complex":
42 
43         if numformat == "exp":
44 
45             for m in range(M):
46                 for n in range(N):
47                     if np.imag(data[m, n]) >= 0.0:
48                         f.write("%.10e+%.10ej" % (np.real(data[m, n]),
49                                                   np.imag(data[m, n])))
50                     else:
51                         f.write("%.10e%.10ej" % (np.real(data[m, n]),
52                                                  np.imag(data[m, n])))
53                     if n != N - 1:
54                         f.write(sep)
55                 f.write("\n")
56 
57         elif numformat == "decimal":
58 
59             for m in range(M):
60                 for n in range(N):
61                     if np.imag(data[m, n]) >= 0.0:
62                         f.write("%.10f+%.10fj" % (np.real(data[m, n]),
63                                                   np.imag(data[m, n])))
64                     else:
65                         f.write("%.10f%.10fj" % (np.real(data[m, n]),
66                                                  np.imag(data[m, n])))
67                     if n != N - 1:
68                         f.write(sep)
69                 f.write("\n")
70 
71         else:
72             raise ValueError("Illegal numformat value (should be " +
73                              "'exp' or 'decimal')")
74 
75     elif numtype == "real":
76 
77         if numformat == "exp":
78 
79             for m in range(M):
80                 for n in range(N):
81                     f.write("%.10e" % (np.real(data[m, n])))
82                     if n != N - 1:
83                         f.write(sep)
84                 f.write("\n")
85 
86         elif numformat == "decimal":
87 
88             for m in range(M):
89                 for n in range(N):
90                     f.write("%.10f" % (np.real(data[m, n])))
91                     if n != N - 1:
92                         f.write(sep)
93                 f.write("\n")
94 
95         else:
96             raise ValueError("Illegal numformat value (should be " +
97                              "'exp' or 'decimal')")
98 
99     else:
100         raise ValueError("Illegal numtype value (should be " +
101                          "'complex' or 'real')")
102 
103     f.close()
104 
105 
106 # -----------------------------------------------------------------------------
107 # Read matrix data from a file
108 #
109 def file_data_read(filename, sep=None):
110     """Retrieves an array of data from the requested file.
111 
112     Parameters
113     ----------
114     filename : str or pathlib.Path
115         Name of file containing reqested data.
116     sep : str
117         Seperator used to store data.
118 
119     Returns
120     -------
121     data : array_like
122         Data from selected file.
123 
124     """
125     if filename is None:
126         raise ValueError("filename is unspecified")
127 
128     f = open(filename, "r")
129 
130     #
131     # first count lines and numbers of
132     #
133     M = N = 0
134     for line in f:
135         # skip comment lines
136         if line[0] == '#' or line[0] == '%':
137             continue
138         # find delim
139         if N == 0 and sep is None:
140             if len(line.rstrip().split(",")) > 1:
141                 sep = ","
142             elif len(line.rstrip().split(";")) > 1:
143                 sep = ";"
144             elif len(line.rstrip().split(":")) > 1:
145                 sep = ":"
146             elif len(line.rstrip().split("|")) > 1:
147                 sep = "|"
148             elif len(line.rstrip().split()) > 1:
149                 # sepical case for a mix of white space deliminators
150                 sep = None
151             else:
152                 raise ValueError("Unrecognized column deliminator")
153         # split the line
154         line_vec = line.split(sep)
155         n = len(line_vec)
156         if N == 0 and n > 0:
157             N = n
158             # check type
159             if ("j" in line_vec[0]) or ("i" in line_vec[0]):
160                 numtype = "complex"
161             else:
162                 numtype = "np.real"
163 
164             # check format
165             if ("e" in line_vec[0]) or ("E" in line_vec[0]):
166                 numformat = "exp"
167             else:
168                 numformat = "decimal"
169 
170         elif N != n:
171             raise ValueError("Badly formatted data file: " +
172                              "unequal number of columns")
173         M += 1
174 
175     #
176     # read data and store in a matrix
177     #
178     f.seek(0)
179 
180     if numtype == "complex":
181         data = np.zeros((M, N), dtype="complex")
182         m = n = 0
183         for line in f:
184             # skip comment lines
185             if line[0] == '#' or line[0] == '%':
186                 continue
187             n = 0
188             for item in line.rstrip().split(sep):
189                 data[m, n] = complex(item)
190                 n += 1
191             m += 1
192 
193     else:
194         data = np.zeros((M, N), dtype="float")
195         m = n = 0
196         for line in f:
197             # skip comment lines
198             if line[0] == '#' or line[0] == '%':
199                 continue
200             n = 0
201             for item in line.rstrip().split(sep):
202                 data[m, n] = float(item)
203                 n += 1
204             m += 1
205 
206     f.close()
207 
208     return data
209 
210 
211 def qsave(data, name='qutip_data'):
212     """
213     Saves given data to file named 'filename.qu' in current directory.
214 
215     Parameters
216     ----------
217     data : instance/array_like
218         Input Python object to be stored.
219     filename : str or pathlib.Path
220         Name of output data file.
221 
222     """
223     # open the file for writing
224     file = Path(name)
225     file = file.with_suffix(file.suffix + ".qu")
226 
227     with open(name, "wb") as fileObject:
228         # this writes the object a to the file named 'filename.qu'
229         pickle.dump(data, fileObject)
230 
231 
232 def qload(name):
233     """
234     Loads data file from file named 'filename.qu' in current directory.
235 
236     Parameters
237     ----------
238     name : str or pathlib.Path
239         Name of data file to be loaded.
240 
241     Returns
242     -------
243     qobject : instance / array_like
244         Object retrieved from requested file.
245 
246     """
247     file = Path(name)
248     file = file.with_suffix(file.suffix + ".qu")
249 
250     with open(name, "rb") as fileObject:
251         if sys.version_info >= (3, 0):
252             out = pickle.load(fileObject, encoding='latin1')
253         else:
254             out = pickle.load(fileObject)
255 
256     return out
257
```
--- 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/qutip/fileio.py b/qutip/fileio.py
--- a/qutip/fileio.py
+++ b/qutip/fileio.py
@@ -221,10 +221,10 @@
 
     """
     # open the file for writing
-    file = Path(name)
-    file = file.with_suffix(file.suffix + ".qu")
+    path = Path(name)
+    path = path.with_suffix(path.suffix + ".qu")
 
-    with open(name, "wb") as fileObject:
+    with open(path, "wb") as fileObject:
         # this writes the object a to the file named 'filename.qu'
         pickle.dump(data, fileObject)
 
@@ -244,10 +244,10 @@
         Object retrieved from requested file.
 
     """
-    file = Path(name)
-    file = file.with_suffix(file.suffix + ".qu")
+    path = Path(name)
+    path = path.with_suffix(path.suffix + ".qu")
 
-    with open(name, "rb") as fileObject:
+    with open(path, "rb") as fileObject:
         if sys.version_info >= (3, 0):
             out = pickle.load(fileObject, encoding='latin1')
         else:

{"golden_diff": "diff --git a/qutip/fileio.py b/qutip/fileio.py\n--- a/qutip/fileio.py\n+++ b/qutip/fileio.py\n@@ -221,10 +221,10 @@\n \n     \"\"\"\n     # open the file for writing\n-    file = Path(name)\n-    file = file.with_suffix(file.suffix + \".qu\")\n+    path = Path(name)\n+    path = path.with_suffix(path.suffix + \".qu\")\n \n-    with open(name, \"wb\") as fileObject:\n+    with open(path, \"wb\") as fileObject:\n         # this writes the object a to the file named 'filename.qu'\n         pickle.dump(data, fileObject)\n \n@@ -244,10 +244,10 @@\n         Object retrieved from requested file.\n \n     \"\"\"\n-    file = Path(name)\n-    file = file.with_suffix(file.suffix + \".qu\")\n+    path = Path(name)\n+    path = path.with_suffix(path.suffix + \".qu\")\n \n-    with open(name, \"rb\") as fileObject:\n+    with open(path, \"rb\") as fileObject:\n         if sys.version_info >= (3, 0):\n             out = pickle.load(fileObject, encoding='latin1')\n         else:\n", "issue": "Fix the handling of file suffixes when saving and loading Qobjs\n### Bug Description\n\nThis bug was introduced n #1813 and reported by @nleehone in a post-release review of https://github.com/qutip/qutip/pull/1813#pullrequestreview-950335153\n\n### Code to Reproduce the Bug\n\n_No response_\n\n### Code Output\n\n_No response_\n\n### Expected Behaviour\n\nThe file suffix should be added if it is not present.\n\n### Your Environment\n\n```shell\nQuTiP version: 4.7.0\n```\n\n\n### Additional Context\n\n_No response_\n", "before_files": [{"content": "__all__ = ['file_data_store', 'file_data_read', 'qsave', 'qload']\n\nimport pickle\nimport numpy as np\nimport sys\nfrom pathlib import Path\n\n\n# -----------------------------------------------------------------------------\n# Write matrix data to a file\n#\ndef file_data_store(filename, data, numtype=\"complex\", numformat=\"decimal\",\n                    sep=\",\"):\n    \"\"\"Stores a matrix of data to a file to be read by an external program.\n\n    Parameters\n    ----------\n    filename : str or pathlib.Path\n        Name of data file to be stored, including extension.\n    data: array_like\n        Data to be written to file.\n    numtype : str {'complex, 'real'}\n        Type of numerical data.\n    numformat : str {'decimal','exp'}\n        Format for written data.\n    sep : str\n        Single-character field seperator.  Usually a tab, space, comma,\n        or semicolon.\n\n    \"\"\"\n    if filename is None or data is None:\n        raise ValueError(\"filename or data is unspecified\")\n\n    M, N = np.shape(data)\n\n    f = open(filename, \"w\")\n\n    f.write(\"# Generated by QuTiP: %dx%d %s matrix \" % (M, N, numtype) +\n            \"in %s format ['%s' separated values].\\n\" % (numformat, sep))\n\n    if numtype == \"complex\":\n\n        if numformat == \"exp\":\n\n            for m in range(M):\n                for n in range(N):\n                    if np.imag(data[m, n]) >= 0.0:\n                        f.write(\"%.10e+%.10ej\" % (np.real(data[m, n]),\n                                                  np.imag(data[m, n])))\n                    else:\n                        f.write(\"%.10e%.10ej\" % (np.real(data[m, n]),\n                                                 np.imag(data[m, n])))\n                    if n != N - 1:\n                        f.write(sep)\n                f.write(\"\\n\")\n\n        elif numformat == \"decimal\":\n\n            for m in range(M):\n                for n in range(N):\n                    if np.imag(data[m, n]) >= 0.0:\n                        f.write(\"%.10f+%.10fj\" % (np.real(data[m, n]),\n                                                  np.imag(data[m, n])))\n                    else:\n                        f.write(\"%.10f%.10fj\" % (np.real(data[m, n]),\n                                                 np.imag(data[m, n])))\n                    if n != N - 1:\n                        f.write(sep)\n                f.write(\"\\n\")\n\n        else:\n            raise ValueError(\"Illegal numformat value (should be \" +\n                             \"'exp' or 'decimal')\")\n\n    elif numtype == \"real\":\n\n        if numformat == \"exp\":\n\n            for m in range(M):\n                for n in range(N):\n                    f.write(\"%.10e\" % (np.real(data[m, n])))\n                    if n != N - 1:\n                        f.write(sep)\n                f.write(\"\\n\")\n\n        elif numformat == \"decimal\":\n\n            for m in range(M):\n                for n in range(N):\n                    f.write(\"%.10f\" % (np.real(data[m, n])))\n                    if n != N - 1:\n                        f.write(sep)\n                f.write(\"\\n\")\n\n        else:\n            raise ValueError(\"Illegal numformat value (should be \" +\n                             \"'exp' or 'decimal')\")\n\n    else:\n        raise ValueError(\"Illegal numtype value (should be \" +\n                         \"'complex' or 'real')\")\n\n    f.close()\n\n\n# -----------------------------------------------------------------------------\n# Read matrix data from a file\n#\ndef file_data_read(filename, sep=None):\n    \"\"\"Retrieves an array of data from the requested file.\n\n    Parameters\n    ----------\n    filename : str or pathlib.Path\n        Name of file containing reqested data.\n    sep : str\n        Seperator used to store data.\n\n    Returns\n    -------\n    data : array_like\n        Data from selected file.\n\n    \"\"\"\n    if filename is None:\n        raise ValueError(\"filename is unspecified\")\n\n    f = open(filename, \"r\")\n\n    #\n    # first count lines and numbers of\n    #\n    M = N = 0\n    for line in f:\n        # skip comment lines\n        if line[0] == '#' or line[0] == '%':\n            continue\n        # find delim\n        if N == 0 and sep is None:\n            if len(line.rstrip().split(\",\")) > 1:\n                sep = \",\"\n            elif len(line.rstrip().split(\";\")) > 1:\n                sep = \";\"\n            elif len(line.rstrip().split(\":\")) > 1:\n                sep = \":\"\n            elif len(line.rstrip().split(\"|\")) > 1:\n                sep = \"|\"\n            elif len(line.rstrip().split()) > 1:\n                # sepical case for a mix of white space deliminators\n                sep = None\n            else:\n                raise ValueError(\"Unrecognized column deliminator\")\n        # split the line\n        line_vec = line.split(sep)\n        n = len(line_vec)\n        if N == 0 and n > 0:\n            N = n\n            # check type\n            if (\"j\" in line_vec[0]) or (\"i\" in line_vec[0]):\n                numtype = \"complex\"\n            else:\n                numtype = \"np.real\"\n\n            # check format\n            if (\"e\" in line_vec[0]) or (\"E\" in line_vec[0]):\n                numformat = \"exp\"\n            else:\n                numformat = \"decimal\"\n\n        elif N != n:\n            raise ValueError(\"Badly formatted data file: \" +\n                             \"unequal number of columns\")\n        M += 1\n\n    #\n    # read data and store in a matrix\n    #\n    f.seek(0)\n\n    if numtype == \"complex\":\n        data = np.zeros((M, N), dtype=\"complex\")\n        m = n = 0\n        for line in f:\n            # skip comment lines\n            if line[0] == '#' or line[0] == '%':\n                continue\n            n = 0\n            for item in line.rstrip().split(sep):\n                data[m, n] = complex(item)\n                n += 1\n            m += 1\n\n    else:\n        data = np.zeros((M, N), dtype=\"float\")\n        m = n = 0\n        for line in f:\n            # skip comment lines\n            if line[0] == '#' or line[0] == '%':\n                continue\n            n = 0\n            for item in line.rstrip().split(sep):\n                data[m, n] = float(item)\n                n += 1\n            m += 1\n\n    f.close()\n\n    return data\n\n\ndef qsave(data, name='qutip_data'):\n    \"\"\"\n    Saves given data to file named 'filename.qu' in current directory.\n\n    Parameters\n    ----------\n    data : instance/array_like\n        Input Python object to be stored.\n    filename : str or pathlib.Path\n        Name of output data file.\n\n    \"\"\"\n    # open the file for writing\n    file = Path(name)\n    file = file.with_suffix(file.suffix + \".qu\")\n\n    with open(name, \"wb\") as fileObject:\n        # this writes the object a to the file named 'filename.qu'\n        pickle.dump(data, fileObject)\n\n\ndef qload(name):\n    \"\"\"\n    Loads data file from file named 'filename.qu' in current directory.\n\n    Parameters\n    ----------\n    name : str or pathlib.Path\n        Name of data file to be loaded.\n\n    Returns\n    -------\n    qobject : instance / array_like\n        Object retrieved from requested file.\n\n    \"\"\"\n    file = Path(name)\n    file = file.with_suffix(file.suffix + \".qu\")\n\n    with open(name, \"rb\") as fileObject:\n        if sys.version_info >= (3, 0):\n            out = pickle.load(fileObject, encoding='latin1')\n        else:\n            out = pickle.load(fileObject)\n\n    return out\n", "path": "qutip/fileio.py"}], "after_files": [{"content": "__all__ = ['file_data_store', 'file_data_read', 'qsave', 'qload']\n\nimport pickle\nimport numpy as np\nimport sys\nfrom pathlib import Path\n\n\n# -----------------------------------------------------------------------------\n# Write matrix data to a file\n#\ndef file_data_store(filename, data, numtype=\"complex\", numformat=\"decimal\",\n                    sep=\",\"):\n    \"\"\"Stores a matrix of data to a file to be read by an external program.\n\n    Parameters\n    ----------\n    filename : str or pathlib.Path\n        Name of data file to be stored, including extension.\n    data: array_like\n        Data to be written to file.\n    numtype : str {'complex, 'real'}\n        Type of numerical data.\n    numformat : str {'decimal','exp'}\n        Format for written data.\n    sep : str\n        Single-character field seperator.  Usually a tab, space, comma,\n        or semicolon.\n\n    \"\"\"\n    if filename is None or data is None:\n        raise ValueError(\"filename or data is unspecified\")\n\n    M, N = np.shape(data)\n\n    f = open(filename, \"w\")\n\n    f.write(\"# Generated by QuTiP: %dx%d %s matrix \" % (M, N, numtype) +\n            \"in %s format ['%s' separated values].\\n\" % (numformat, sep))\n\n    if numtype == \"complex\":\n\n        if numformat == \"exp\":\n\n            for m in range(M):\n                for n in range(N):\n                    if np.imag(data[m, n]) >= 0.0:\n                        f.write(\"%.10e+%.10ej\" % (np.real(data[m, n]),\n                                                  np.imag(data[m, n])))\n                    else:\n                        f.write(\"%.10e%.10ej\" % (np.real(data[m, n]),\n                                                 np.imag(data[m, n])))\n                    if n != N - 1:\n                        f.write(sep)\n                f.write(\"\\n\")\n\n        elif numformat == \"decimal\":\n\n            for m in range(M):\n                for n in range(N):\n                    if np.imag(data[m, n]) >= 0.0:\n                        f.write(\"%.10f+%.10fj\" % (np.real(data[m, n]),\n                                                  np.imag(data[m, n])))\n                    else:\n                        f.write(\"%.10f%.10fj\" % (np.real(data[m, n]),\n                                                 np.imag(data[m, n])))\n                    if n != N - 1:\n                        f.write(sep)\n                f.write(\"\\n\")\n\n        else:\n            raise ValueError(\"Illegal numformat value (should be \" +\n                             \"'exp' or 'decimal')\")\n\n    elif numtype == \"real\":\n\n        if numformat == \"exp\":\n\n            for m in range(M):\n                for n in range(N):\n                    f.write(\"%.10e\" % (np.real(data[m, n])))\n                    if n != N - 1:\n                        f.write(sep)\n                f.write(\"\\n\")\n\n        elif numformat == \"decimal\":\n\n            for m in range(M):\n                for n in range(N):\n                    f.write(\"%.10f\" % (np.real(data[m, n])))\n                    if n != N - 1:\n                        f.write(sep)\n                f.write(\"\\n\")\n\n        else:\n            raise ValueError(\"Illegal numformat value (should be \" +\n                             \"'exp' or 'decimal')\")\n\n    else:\n        raise ValueError(\"Illegal numtype value (should be \" +\n                         \"'complex' or 'real')\")\n\n    f.close()\n\n\n# -----------------------------------------------------------------------------\n# Read matrix data from a file\n#\ndef file_data_read(filename, sep=None):\n    \"\"\"Retrieves an array of data from the requested file.\n\n    Parameters\n    ----------\n    filename : str or pathlib.Path\n        Name of file containing reqested data.\n    sep : str\n        Seperator used to store data.\n\n    Returns\n    -------\n    data : array_like\n        Data from selected file.\n\n    \"\"\"\n    if filename is None:\n        raise ValueError(\"filename is unspecified\")\n\n    f = open(filename, \"r\")\n\n    #\n    # first count lines and numbers of\n    #\n    M = N = 0\n    for line in f:\n        # skip comment lines\n        if line[0] == '#' or line[0] == '%':\n            continue\n        # find delim\n        if N == 0 and sep is None:\n            if len(line.rstrip().split(\",\")) > 1:\n                sep = \",\"\n            elif len(line.rstrip().split(\";\")) > 1:\n                sep = \";\"\n            elif len(line.rstrip().split(\":\")) > 1:\n                sep = \":\"\n            elif len(line.rstrip().split(\"|\")) > 1:\n                sep = \"|\"\n            elif len(line.rstrip().split()) > 1:\n                # sepical case for a mix of white space deliminators\n                sep = None\n            else:\n                raise ValueError(\"Unrecognized column deliminator\")\n        # split the line\n        line_vec = line.split(sep)\n        n = len(line_vec)\n        if N == 0 and n > 0:\n            N = n\n            # check type\n            if (\"j\" in line_vec[0]) or (\"i\" in line_vec[0]):\n                numtype = \"complex\"\n            else:\n                numtype = \"np.real\"\n\n            # check format\n            if (\"e\" in line_vec[0]) or (\"E\" in line_vec[0]):\n                numformat = \"exp\"\n            else:\n                numformat = \"decimal\"\n\n        elif N != n:\n            raise ValueError(\"Badly formatted data file: \" +\n                             \"unequal number of columns\")\n        M += 1\n\n    #\n    # read data and store in a matrix\n    #\n    f.seek(0)\n\n    if numtype == \"complex\":\n        data = np.zeros((M, N), dtype=\"complex\")\n        m = n = 0\n        for line in f:\n            # skip comment lines\n            if line[0] == '#' or line[0] == '%':\n                continue\n            n = 0\n            for item in line.rstrip().split(sep):\n                data[m, n] = complex(item)\n                n += 1\n            m += 1\n\n    else:\n        data = np.zeros((M, N), dtype=\"float\")\n        m = n = 0\n        for line in f:\n            # skip comment lines\n            if line[0] == '#' or line[0] == '%':\n                continue\n            n = 0\n            for item in line.rstrip().split(sep):\n                data[m, n] = float(item)\n                n += 1\n            m += 1\n\n    f.close()\n\n    return data\n\n\ndef qsave(data, name='qutip_data'):\n    \"\"\"\n    Saves given data to file named 'filename.qu' in current directory.\n\n    Parameters\n    ----------\n    data : instance/array_like\n        Input Python object to be stored.\n    filename : str or pathlib.Path\n        Name of output data file.\n\n    \"\"\"\n    # open the file for writing\n    path = Path(name)\n    path = path.with_suffix(path.suffix + \".qu\")\n\n    with open(path, \"wb\") as fileObject:\n        # this writes the object a to the file named 'filename.qu'\n        pickle.dump(data, fileObject)\n\n\ndef qload(name):\n    \"\"\"\n    Loads data file from file named 'filename.qu' in current directory.\n\n    Parameters\n    ----------\n    name : str or pathlib.Path\n        Name of data file to be loaded.\n\n    Returns\n    -------\n    qobject : instance / array_like\n        Object retrieved from requested file.\n\n    \"\"\"\n    path = Path(name)\n    path = path.with_suffix(path.suffix + \".qu\")\n\n    with open(path, \"rb\") as fileObject:\n        if sys.version_info >= (3, 0):\n            out = pickle.load(fileObject, encoding='latin1')\n        else:\n            out = pickle.load(fileObject)\n\n    return out\n", "path": "qutip/fileio.py"}]}