-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
fake_1q.py
91 lines (85 loc) · 3.03 KB
/
fake_1q.py
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# This code is part of Qiskit.
#
# (C) Copyright IBM 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.
"""
Fake 1Q device (1 qubit).
"""
import datetime
from qiskit.providers.models.backendproperties import BackendProperties, Gate, Nduv
from .fake_backend import FakeBackend
class Fake1Q(FakeBackend):
"""A fake 1Q backend."""
def __init__(self):
"""
0
"""
mock_time = datetime.datetime.now()
dt = 1.3333
configuration = BackendProperties(
backend_name="fake_1q",
backend_version="0.0.0",
num_qubits=1,
basis_gates=["u1", "u2", "u3", "cx"],
simulator=False,
local=True,
conditional=False,
memory=False,
max_shots=1024,
qubits=[
[
Nduv(date=mock_time, name="T1", unit="µs", value=71.9500421005539),
Nduv(date=mock_time, name="frequency", unit="MHz", value=4919.96800692),
]
],
gates=[
Gate(
gate="u1",
name="u1_0",
qubits=[0],
parameters=[
Nduv(date=mock_time, name="gate_error", unit="", value=1.0),
Nduv(date=mock_time, name="gate_length", unit="ns", value=0.0),
],
),
Gate(
gate="u3",
name="u3_0",
qubits=[0],
parameters=[
Nduv(date=mock_time, name="gate_error", unit="", value=1.0),
Nduv(date=mock_time, name="gate_length", unit="ns", value=2 * dt),
],
),
Gate(
gate="u3",
name="u3_1",
qubits=[1],
parameters=[
Nduv(date=mock_time, name="gate_error", unit="", value=1.0),
Nduv(date=mock_time, name="gate_length", unit="ns", value=4 * dt),
],
),
Gate(
gate="cx",
name="cx0_1",
qubits=[0, 1],
parameters=[
Nduv(date=mock_time, name="gate_error", unit="", value=1.0),
Nduv(date=mock_time, name="gate_length", unit="ns", value=22 * dt),
],
),
],
coupling_map=None,
n_registers=1,
last_update_date=mock_time,
general=[],
)
super().__init__(configuration)