Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pulse_lib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
QuTech QDLabs
pulse_lib
Commits
6f3eca7b
Commit
6f3eca7b
authored
7 months ago
by
Sander de Snoo
Browse files
Options
Downloads
Patches
Plain Diff
Removed old Qblox Pulsar code
parent
a257bded
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pulse_lib/examples/configuration/init_pulsars.py
+38
-66
38 additions, 66 deletions
pulse_lib/examples/configuration/init_pulsars.py
pulse_lib/examples/configuration/init_pulsars_3.py
+43
-71
43 additions, 71 deletions
pulse_lib/examples/configuration/init_pulsars_3.py
with
81 additions
and
137 deletions
pulse_lib/examples/configuration/init_pulsars.py
+
38
−
66
View file @
6f3eca7b
import
qcodes
as
qc
import
qcodes
as
qc
from
qblox_instruments
import
Pulsar
from
qblox_instruments
import
Cluster
,
ClusterType
from
qblox_instruments
import
Cluster
,
ClusterType
try
:
try
:
from
q1simulator
import
Q1Simulato
r
from
q1simulator
import
Cluster
as
SimCluste
r
_q1simulator_found
=
True
_q1simulator_found
=
True
except
:
except
:
print
(
'
package q1simulator not found
'
)
print
(
'
package q1simulator not found
'
)
_q1simulator_found
=
False
_q1simulator_found
=
False
def
add_module
(
module_type
,
name
,
ip_addr
):
if
name
in
station
.
components
:
pulsar
=
station
[
name
]
else
:
if
_use_simulator
:
if
not
_q1simulator_found
:
raise
Exception
(
'
q1simulator not found
'
)
pulsar
=
Q1Simulator
(
name
,
sim_type
=
module_type
)
# pulsar.config('trace', True)
elif
_use_dummy
:
print
(
f
'
Starting
{
module_type
}
{
name
}
dummy
'
)
pulsar
=
Pulsar
(
name
,
ip_addr
,
dummy_type
=
'
Pulsar
'
+
module_type
)
pulsar
.
is_dummy
=
True
else
:
print
(
f
'
Connecting
{
module_type
}
{
name
}
on
{
ip_addr
}
...
'
)
pulsar
=
Pulsar
(
name
,
ip_addr
)
station
.
add_component
(
pulsar
)
pulsar
.
reset
()
return
pulsar
if
not
qc
.
Station
.
default
:
if
not
qc
.
Station
.
default
:
station
=
qc
.
Station
()
station
=
qc
.
Station
()
else
:
else
:
...
@@ -41,45 +17,41 @@ else:
...
@@ -41,45 +17,41 @@ else:
_use_simulator
=
True
_use_simulator
=
True
_use_dummy
=
False
_use_dummy
=
False
_use_cluster
=
False
if
_use_cluster
:
try
:
cluster
=
station
[
'
Qblox_Cluster
'
]
cluster
.
reset
()
qcm0
=
cluster
.
module8
qrm1
=
cluster
.
module10
except
:
dummy_cfg
=
None
if
_use_dummy
:
cfg
=
{
8
:
ClusterType
.
CLUSTER_QCM
,
10
:
ClusterType
.
CLUSTER_QRM
}
cluster
=
Cluster
(
'
Qblox_Cluster
'
,
'
192.168.0.2
'
,
dummy_cfg
=
cfg
)
# set property is_dummy to use in Q1Pulse state checking
cluster
.
is_dummy
=
True
else
:
cluster
=
Cluster
(
'
Qblox_Cluster
'
,
'
192.168.0.2
'
)
station
.
add_component
(
cluster
)
try
:
cluster
.
reset
()
cluster
=
station
[
'
Qblox_Cluster
'
]
cluster
.
reset
()
print
(
f
'
Cluster:
'
)
qcm0
=
cluster
.
module8
print
(
cluster
.
get_system_state
())
qrm1
=
cluster
.
module10
for
module
in
cluster
.
modules
:
except
:
if
module
.
present
():
if
_use_simulator
:
rf
=
'
-RF
'
if
module
.
is_rf_type
else
''
cfg
=
{
print
(
f
'
slot
{
module
.
slot_idx
}
:
{
module
.
module_type
}{
rf
}
'
)
8
:
"
QCM
"
,
10
:
"
QRM
"
,
qcm0
=
cluster
.
module8
}
qrm1
=
cluster
.
module10
cluster
=
SimCluster
(
'
Q1Simulator_Cluster
'
,
modules
=
cfg
)
station
.
add_component
(
qcm0
)
elif
_use_dummy
:
station
.
add_component
(
qrm1
)
cfg
=
{
else
:
8
:
ClusterType
.
CLUSTER_QCM
,
qcm0
=
add_module
(
'
QCM
'
,
'
qcm0
'
,
'
192.168.0.2
'
)
10
:
ClusterType
.
CLUSTER_QRM
qrm1
=
add_module
(
'
QRM
'
,
'
qrm1
'
,
'
192.168.0.3
'
)
}
cluster
=
Cluster
(
'
Qblox_Cluster
'
,
'
192.168.0.2
'
,
dummy_cfg
=
cfg
)
qcm0
.
reference_source
(
'
internal
'
)
# set property is_dummy to use in Q1Pulse state checking
qrm1
.
reference_source
(
'
external
'
)
cluster
.
is_dummy
=
True
else
:
cluster
=
Cluster
(
'
Qblox_Cluster
'
,
'
192.168.0.2
'
)
station
.
add_component
(
cluster
)
cluster
.
reset
()
print
(
'
Cluster:
'
)
print
(
cluster
.
get_system_status
())
for
module
in
cluster
.
modules
:
if
module
.
present
():
rf
=
'
-RF
'
if
module
.
is_rf_type
else
''
print
(
f
'
slot
{
module
.
slot_idx
}
:
{
module
.
module_type
}{
rf
}
'
)
qcm0
=
cluster
.
module8
qrm1
=
cluster
.
module10
station
.
add_component
(
qcm0
)
station
.
add_component
(
qrm1
)
This diff is collapsed.
Click to expand it.
pulse_lib/examples/configuration/init_pulsars_3.py
+
43
−
71
View file @
6f3eca7b
import
qcodes
as
qc
import
qcodes
as
qc
from
qblox_instruments
import
Pulsar
from
qblox_instruments
import
Cluster
,
ClusterType
from
qblox_instruments
import
Cluster
,
ClusterType
try
:
try
:
from
q1simulator
import
Q1Simulato
r
from
q1simulator
import
Cluster
as
SimCluste
r
_q1simulator_found
=
True
_q1simulator_found
=
True
except
:
except
:
print
(
'
package q1simulator not found
'
)
print
(
'
package q1simulator not found
'
)
_q1simulator_found
=
False
_q1simulator_found
=
False
def
add_module
(
module_type
,
name
,
ip_addr
):
try
:
pulsar
=
station
[
name
]
except
:
if
_use_simulator
:
if
not
_q1simulator_found
:
raise
Exception
(
'
q1simulator not found
'
)
pulsar
=
Q1Simulator
(
name
,
sim_type
=
module_type
)
elif
_use_dummy
:
print
(
f
'
Starting
{
module_type
}
{
name
}
dummy
'
)
pulsar
=
Pulsar
(
name
,
ip_addr
,
dummy_type
=
'
Pulsar
'
+
module_type
)
pulsar
.
is_dummy
=
True
else
:
print
(
f
'
Connecting
{
module_type
}
{
name
}
on
{
ip_addr
}
...
'
)
pulsar
=
Pulsar
(
name
,
ip_addr
)
station
.
add_component
(
pulsar
)
pulsar
.
reset
()
return
pulsar
if
not
qc
.
Station
.
default
:
if
not
qc
.
Station
.
default
:
station
=
qc
.
Station
()
station
=
qc
.
Station
()
else
:
else
:
...
@@ -40,53 +18,47 @@ else:
...
@@ -40,53 +18,47 @@ else:
_use_simulator
=
True
_use_simulator
=
True
_use_dummy
=
False
_use_dummy
=
False
_use_cluster
=
False
if
_use_cluster
:
try
:
cluster
=
station
[
'
Qblox_Cluster
'
]
cluster
.
reset
()
qcm0
=
cluster
.
module8
qrm1
=
cluster
.
module10
qcm2
=
cluster
.
module6
except
:
dummy_cfg
=
None
if
_use_dummy
:
cfg
=
{
6
:
ClusterType
.
CLUSTER_QCM
,
8
:
ClusterType
.
CLUSTER_QCM
,
10
:
ClusterType
.
CLUSTER_QRM
}
cluster
=
Cluster
(
'
Qblox_Cluster
'
,
'
192.168.0.2
'
,
dummy_cfg
=
cfg
)
# set property is_dummy to use in Q1Pulse state checking
cluster
.
is_dummy
=
True
else
:
cluster
=
Cluster
(
'
Qblox_Cluster
'
,
'
192.168.0.2
'
)
station
.
add_component
(
cluster
)
cluster
.
reset
()
print
(
f
'
Cluster:
'
)
print
(
cluster
.
get_system_state
())
for
module
in
cluster
.
modules
:
if
module
.
present
():
rf
=
'
-RF
'
if
module
.
is_rf_type
else
''
print
(
f
'
slot
{
module
.
slot_idx
}
:
{
module
.
module_type
}{
rf
}
'
)
qcm0
=
cluster
.
module8
qrm1
=
cluster
.
module10
qcm2
=
cluster
.
module6
station
.
add_component
(
qcm0
)
station
.
add_component
(
qrm1
)
station
.
add_component
(
qcm2
)
else
:
qcm0
=
add_module
(
'
QCM
'
,
'
qcm0
'
,
'
192.168.0.2
'
)
qrm1
=
add_module
(
'
QRM
'
,
'
qrm1
'
,
'
192.168.0.3
'
)
qcm2
=
add_module
(
'
QCM
'
,
'
qcm2
'
,
'
192.168.0.4
'
)
qcm0
.
reference_source
(
'
internal
'
)
qrm1
.
reference_source
(
'
external
'
)
qcm2
.
reference_source
(
'
external
'
)
try
:
cluster
=
station
[
'
Qblox_Cluster
'
]
cluster
.
reset
()
qcm0
=
cluster
.
module8
qrm1
=
cluster
.
module10
qcm2
=
cluster
.
module6
except
:
if
_use_simulator
:
cfg
=
{
6
:
"
QCM
"
,
8
:
"
QCM
"
,
10
:
"
QRM
"
,
}
cluster
=
SimCluster
(
'
Q1Simulator_Cluster
'
,
modules
=
cfg
)
elif
_use_dummy
:
cfg
=
{
6
:
ClusterType
.
CLUSTER_QCM
,
8
:
ClusterType
.
CLUSTER_QCM
,
10
:
ClusterType
.
CLUSTER_QRM
}
cluster
=
Cluster
(
'
Qblox_Cluster
'
,
'
192.168.0.2
'
,
dummy_cfg
=
cfg
)
# set property is_dummy to use in Q1Pulse state checking
cluster
.
is_dummy
=
True
else
:
cluster
=
Cluster
(
'
Qblox_Cluster
'
,
'
192.168.0.2
'
)
station
.
add_component
(
cluster
)
cluster
.
reset
()
print
(
'
Cluster:
'
)
print
(
cluster
.
get_system_state
())
for
module
in
cluster
.
modules
:
if
module
.
present
():
rf
=
'
-RF
'
if
module
.
is_rf_type
else
''
print
(
f
'
slot
{
module
.
slot_idx
}
:
{
module
.
module_type
}{
rf
}
'
)
qcm0
=
cluster
.
module8
qrm1
=
cluster
.
module10
qcm2
=
cluster
.
module6
station
.
add_component
(
qcm0
)
station
.
add_component
(
qrm1
)
station
.
add_component
(
qcm2
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment