text: import numpy as np
  
  gauss_len = 52
  gaussian_amp = 0.2
  
  
  def gauss(amplitude, mu, sigma, length):
      t = np.linspace(-length / 2, length / 2, length)
      gauss_wave = amplitude * np.exp(-((t - mu) ** 2) / (2 * sigma ** 2))
      return [float(x) for x in gauss_wave]
  
  
  def IQ_imbalance(g, phi):
      c = np.cos(phi)
      s = np.sin(phi)
      N = 1 / ((1 - g ** 2) * (2 * c ** 2 - 1))
      return [float(N * x) for x in [(1 - g) * c, (1 + g) * s, (1 - g) * s, (1 + g) * c]]
  
  
  gauss_pulse = gauss(gaussian_amp, 0, 6, gauss_len)
  
  readout_len = 400
  qubit_IF = 50e6
  rr_IF = 50e6
  qubit_LO = 6.345e9
  rr_LO = 4.755e9
  
  config = {
      "version": 1,
      "controllers": {
          "con1": {
              "type": "opx1",
              "analog_outputs": {
                  1: {"offset": 0.05},
                  2: {"offset": 0.05},
                  3: {"offset": -0.024},
                  4: {"offset": 0.115},  # Readout resonator
              },
              "digital_outputs": {
                  1: {},
              },
              "analog_inputs": {
                  1: {"offset": +0.0},
              },
          }
      },
      "elements": {
          "qubit": {
              "mixInputs": {
                  "I": ("con1", 1),
                  "Q": ("con1", 2),
                  "lo_frequency": qubit_LO,
                  "mixer": "mixer_qubit",
              },
              "intermediate_frequency": qubit_IF,
              "operations": {
                  "X": "XPulse",
              },
          },
          "rr": {
              "mixInputs": {
                  "I": ("con1", 3),
                  "Q": ("con1", 4),
                  "lo_frequency": rr_LO,
                  "mixer": "mixer_RR",
              },
              "intermediate_frequency": rr_IF,
              "operations": {
                  "readout": "readout_pulse",
              },
              "outputs": {"out1": ("con1", 1)},
              "time_of_flight": 28,
              "smearing": 0,
          },
      },
      "pulses": {
          "XPulse": {
              "operation": "control",
              "length": gauss_len,
              "waveforms": {"I": "gauss_wf", "Q": "zero_wf"},
          },
          "readout_pulse": {
              "operation": "measurement",
              "length": readout_len,
              "waveforms": {"I": "readout_wf", "Q": "zero_wf"},
              "integration_weights": {
                  "integW1": "integW1",
                  "integW2": "integW2",
              },
              "digital_marker": "ON",
          },
      },
      "waveforms": {
          "zero_wf": {"type": "constant", "sample": 0.0},
          "gauss_wf": {"type": "arbitrary", "samples": gauss_pulse},
          "readout_wf": {"type": "constant", "sample": 0.3},
      },
      "digital_waveforms": {
          "ON": {"samples": [(1, 0)]},
      },
      "integration_weights": {
          "integW1": {
              "cosine": [1.0] * int(readout_len / 4),
              "sine": [0.0] * int(readout_len / 4),
          },
          "integW2": {
              "cosine": [0.0] * int(readout_len / 4),
              "sine": [1.0] * int(readout_len / 4),
          },
      },
      "mixers": {
          "mixer_qubit": [
              {
                  "intermediate_frequency": qubit_IF,
                  "lo_frequency": qubit_LO,
                  "correction": IQ_imbalance(0.0, 0.0),
              }
          ],
          "mixer_RR": [
              {
                  "intermediate_frequency": rr_IF,
                  "lo_frequency": rr_LO,
                  "correction": IQ_imbalance(0.0, 0.0),
              }
          ],
      },
  }
  