<jupyter_start><jupyter_text>Sweeping two things at onceThis example notebook shows how to sweep two parameters in one go  Setting up the dummy experimentOur dummy experiment consists of a DAC and a DMM. The DAC has two channels each connected to one port of the DMM. One Port measures the square of the DAC voltage, the other measures the cube of the DAC voltage (this is my understanding of a physical system!)<jupyter_code>import qcodes as qc
from qcodes.utils.wrappers import init, do1d
from qcodes.tests.instrument_mocks import DummyInstrument
dac = DummyInstrument('dac', gates=['ch1', 'ch2'])
dmm = DummyInstrument('dmm', gates=['v1', 'v2'])

station = qc.Station(dac, dmm)
init('./sandboxdata', 'sandboxsample', station, annotate_image=False)
# set up some simulated wiring and physical system between the dac and dmm
dmm.v1.get = lambda: dac.ch1.get()**2
dmm.v2.get = lambda: dac.ch2.get()**3<jupyter_output><empty_output><jupyter_text>Check that this makes sense<jupyter_code>do1d(dac.ch1, -2, 2, 25, 0.1, dmm.v1)
do1d(dac.ch2, -2, 2, 25, 0.1, dmm.v2)<jupyter_output>Started at 2017-10-17 11:14:13
DataSet:
   location = '/Users/william/sourcecodes/qdev-dk/docs/examples/Sandbox/sandboxdata/sandboxsample/050'
   <Type>   | <array_id>  | <array.name> | <array.shape>
   Setpoint | dac_ch2_set | ch2          | (25,)
   Measured | dmm_v2      | v2           | (25,)
Finished at 2017-10-17 11:14:16<jupyter_text>Simultaneously sweep both in opposite directionsNow let's sweep both voltages in opposite directions simultaneously<jupyter_code># Define the mapping from one param two the two voltages

def combi_setter(value):
    dac.ch1.set(value)
    dac.ch2.set(-value)
    
# And simply add this as a new parameter two the instrument

dac.add_parameter('combi',
                  label='Dac Ch1 and minus Dac Ch2',
                  set_cmd=combi_setter)<jupyter_output><empty_output><jupyter_text>Sweep and see that we get the expected traces<jupyter_code>do1d(dac.combi, -2, 2, 50, 0.2, dmm.v1, dmm.v2, use_threads=False)<jupyter_output>Started at 2017-10-17 11:17:19
DataSet:
   location = '/Users/william/sourcecodes/qdev-dk/docs/examples/Sandbox/sandboxdata/sandboxsample/051'
   <Type>   | <array_id>    | <array.name> | <array.shape>
   Setpoint | dac_combi_set | combi        | (50,)
   Measured | dmm_v1        | v1           | (50,)
   Measured | dmm_v2        | v2           | (50,)
Finished at 2017-10-17 11:17:32
{'fraction_non_alphanumeric': 0.11170431211498973, 'fraction_numerical': 0.05010266940451746, 'mean_word_length': 3.951219512195122, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '610770', 'license': 'MIT', 'n_tokens_mistral': 966, 'n_tokens_neox': 874, 'n_words': 239, 'path': 'docs/examples/UserRequests/Sweeping two things at once.ipynb', 'repo_name': 'aaroncslau/Qcodes', 'size': '2435'}