Skip to content

Conversation

@steffi7574
Copy link
Member

No description provided.

@steffi7574 steffi7574 changed the title Refactor config toml SG WIP: Refactor config toml SG Dec 19, 2025
Copy link
Collaborator

@tdrwenski tdrwenski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the decoherence and optim_tolerance changes! That setting update and the code changes look good. I'm not sure about crosskerr/Jkl-- see other comment.

Jkl = [0.0]
# Cross-kerr coupling strength for oscillators k<->l ("\xi_kl", multiplying a_k^d a_k a_l^d a_l, GHz).
# Format: table with keys "k-l" (e.g., "0-1") specifying coupling between oscillators k and l. Unspecified couplings default to zero. E.g. { "0-1" = <val>, "2-4" = <val>}
crosskerr = { "0-1" = 0.1 }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still prefer not to put oscillator indexes into the toml keys. Keys should identify which thing you're configuring, not describe the contents of that thing. And you can't make the key an integer (it must be a string), so by putting the oscillator indexes there you add an extra string parsing step.

How about something like this:

  crosskerr = [
    { oscillators = [0, 1], value = 0.1 },
    { oscillators = [1, 2], value = 0.05 }
  ]

This removes two toml configuration options:
* optim_penalty
* optim_penalty_param
And instead adds three new options to replace them:
* optim_penalty_leakage
* optim_penalty_weightedcost
* optim_penalty_weightedcost_width

Before this change, the leakage term and the weighted running cost term
were both controlled by the same option (optim_penalty). Now, those
options can be specified separately. Their calculation in the
timestepper is also split up into two separate functions. Naming of
those functions and their treatment in the optimization problem is
improved.
Multiple control segments for one oscillator are no longer supported.
Ensures backward compatibility with old cfg files using 'pure'.
Adds a testcase for reading cnot from file. Verified with main branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants