Workflow examples: Neutron Stars

Hi @ce-alpha-testers,

Firstly, thank you all for taking the time to give us valuable feedback, which helps us improve the MUSES Framework. Hopefully you’ve successfully followed the steps in our Quickstart guide, where you can

  1. Run a single job workflow with the CMF module.
  2. Run a sequential workflow with Crust DFT → Lepton → QLIMR.

Below, I will share a few additional workflows related to the Neutron Star modules for testing. While we are assigning them to alpha testers with expertise related to the specific modules, feel free to try any or all of them. You can find more details about the modules themselves on the documentation page.

We would greatly appreciate it if you can run the workflows, tweak the configuration parameters, and let us know if something does not work or could be improved.

You can run all the examples below by replacing the configuration in the current wf_config in the Quickstart guide.

- Crust-DFT + CMFLeptonSynthesisQLIMR

Example
processes:
- name: crust_dft_eos
  module: crust_dft
  inputs:
    EOS_table:
      type: upload
      uuid: 'b85c8ce0-cb32-4119-b921-e7133d79512d'
  config:
    output_format: CSV
    set:
      Ye_grid_spec: 70,0.01*(i+1)
      nB_grid_spec: 301,10^(i*0.04-12)*2.0
      verbose: 0
      inc_lepton: false
- name: lepton-crust_dft
  module: lepton
  config:
    global:
      run_name: ''
      use_beta_equilibrium: true
      use_charge_neutrality: false
    output:
      output_derivatives: true
    particles:
      use_electron: true
      use_muon: true
  pipes:
    input_eos:
      label: e4mma w/o lepton
      module: crust_dft
      process: crust_dft_eos
- name: cmf
  module: cmf_solver
  config:
    computational_parameters:
      options:
        vector_potential: 4
        use_octet: true
        use_hyperons: false
        use_decuplet: false
        use_quarks: false
      variables:
        chemical_optical_potentials:
          muB_begin: 940.0
          muB_end: 1800.0
          muB_step: 10.0
          muQ_begin: -400.0
          muQ_end: 0.0
          muQ_step: 5.0
        mean_fields:
          Phi_order0_begin: 0.0
          Phi_order0_end: 0.1
          Phi_order0_step: 1.0
- name: lepton-cmf
  module: lepton
  config:
    global:
      run_name: ''
      use_beta_equilibrium: true
      use_charge_neutrality: false
      check_eos_stability: true
      verbose: 2
    output:
      output_derivatives: false
    particles:
      use_electron: true
      use_muon: true
  pipes:
    input_eos:
      label: CMF_for_Lepton_baryons_only
      module: cmf_solver
      process: cmf
- name: synthesis
  module: synthesis
  config:
    global:
      run_name: ''
      synthesis_type: 'attach'
      verbose: 2
      check_eos_stability: true
    attach_method:
      attach_value: 0.14
      attach_variable: baryon_density
    output:
      output_derivatives: false
      output_hdf5: false
  pipes:
    model1_BetaEq_eos:
      label: eos_beta_equilibrium
      module: lepton
      process: lepton-crust_dft
    model2_BetaEq_eos:
      label: eos_beta_equilibrium
      module: lepton
      process: lepton-cmf
- name: qlimr
  module: qlimr
  pipes:
    eos:
      label: eos
      module: synthesis
      process: synthesis
  config:
    inputs:
      R_start: 0.0004
      eos_name: eos
      final_epsilon: 6000.0
      initial_epsilon: 250.0
      resolution_in_NS_M: 0.05
      resolution_in_NS_R: 0.2
      single_epsilon: 700.0
    options:
      eps_sequence: true
      output_format: csv
      stable_branch: true
    outputs:
      compute_inertia: false
      compute_love: false
      compute_mass_and_radius_correction: false
      compute_quadrupole: false
      local_functions: false
components:
- type: chain
  name: crust_dft_beta
  sequence:
    - crust_dft_eos
    - lepton-crust_dft
- type: chain
  name: cmf_beta
  sequence:
    - cmf
    - lepton-cmf
- type: group
  name: beta_equilibrium
  group:
    - crust_dft_beta
    - cmf_beta
- type: chain
  name: workflow
  sequence:
    - beta_equilibrium
    - synthesis
    - qlimr

- Crust-DFT + \chi EFT + CMFLeptonSynthesisQLIMR

Obs: Depending on the hyperbolic-tangent parameters, the EoS (P x \varepsilon) might not be monotonically increasing. This will cause the workflow to fail when it reaches the QLIMR module. You can check this by removing QLIMR from the workflow components and asserting it is successful.

Example
processes:
- name: crust_dft_eos
  module: crust_dft
  inputs:
    EOS_table:
      type: upload
      uuid: 'b85c8ce0-cb32-4119-b921-e7133d79512d'
  config:
    output_format: CSV
    set:
      Ye_grid_spec: 70,0.01*(i+1)
      nB_grid_spec: 301,10^(i*0.04-12)*2.0
      verbose: 0
      inc_lepton: false
- name: lepton-crust_dft
  module: lepton
  config:
    global:
      run_name: ''
      use_beta_equilibrium: true
    derivatives:
      relative_step_size: 1.0e-3
      precision: 1
    output:
      output_derivatives: true
    particles:
      use_electron: true
      use_muon: true
  pipes:
    input_eos:
      label: e4mma w/o lepton
      module: crust_dft
      process: crust_dft_eos
- name: ceft_eos
  module: chiral_eft
  config:
    run_name: 'test_ceft_lepton'
    chiraleft_parameters:
      fitted_parameter_set: 'n3lo-450'
    calculation_options:
      use_multithreading: true
      use_quadratic_asymmetry_expansion: true
    output_options:
      include_output_stable: false
      include_output_lepton: true
      include_output_flavor: false
      include_output_saturation_properties: false
      verbose: false
    eos_grid:
      density_start: 0.04
      density_end: 0.32
      density_step: 0.02
      isospin_asymmetry_start: 0.0
      isospin_asymmetry_end: 1.0
      isospin_asymmetry_step: 0.2
- name: lepton-ceft
  module: lepton
  config:
    global:
      run_name: ''
      use_beta_equilibrium: true
      verbose: 2
    output:
      output_derivatives: true
    particles:
      use_electron: true
      use_muon: true
  pipes:
    input_eos:
      label: ChEFT_Output_Lepton
      module: chiral_eft
      process: ceft_eos
- name: cmf
  module: cmf_solver
  config:
    computational_parameters:
      options:
        vector_potential: 4
        use_octet: true
        use_hyperons: false
        use_decuplet: false
        use_quarks: false
      variables:
        chemical_optical_potentials:
          muB_begin: 940.0
          muB_end: 1800.0
          muB_step: 10.0
          muQ_begin: -400.0
          muQ_end: 0.0
          muQ_step: 5.0
        mean_fields:
          Phi_order0_begin: 0.0
          Phi_order0_end: 0.1
          Phi_order0_step: 1.0
- name: lepton-cmf
  module: lepton
  config:
    global:
      run_name: ''
      use_beta_equilibrium: true
      use_charge_neutrality: false
      check_eos_stability: true
      verbose: 2
    output:
      output_derivatives: false
    particles:
      use_electron: true
      use_muon: true
  pipes:
    input_eos:
      label: CMF_for_Lepton_baryons_only
      module: cmf_solver
      process: cmf
- name: synthesis-ceft-cmf
  module: synthesis
  config:
    global:
      run_name: ''
      synthesis_type: 'hyperbolic-tangent'
      verbose: 2
      check_eos_stability: true
    interpolation_method:
      Gamma: 50.0
      number_of_points: 50
      use_thermodynamic_consistency: true
      x_variable: baryon_chemical_potential
      x_variable_midpoint: 960.0
      y_variable: pressure
  pipes:
    model1_BetaEq_eos:
      label: eos_beta_equilibrium
      module: lepton
      process: lepton-ceft
    model2_BetaEq_eos:  
      label: eos_beta_equilibrium
      module: lepton
      process: lepton-cmf
- name: synthesis-crust_dft-ceft-cmf
  module: synthesis
  config:
    global:
      run_name: ''
      synthesis_type: 'hyperbolic-tangent'
      verbose: 2
      check_eos_stability: true
    interpolation_method:
      Gamma: 300.0
      number_of_points: 150
      use_thermodynamic_consistency: true
      x_variable: baryon_chemical_potential
      x_variable_midpoint: 1300.0
      y_variable: pressure
  pipes:
    model1_BetaEq_eos:
      label: eos_beta_equilibrium
      module: lepton
      process: lepton-crust_dft
    model2_BetaEq_eos:
      label: eos
      module: synthesis
      process: synthesis-ceft-cmf
- name: qlimr
  module: qlimr
  pipes:
    eos:
      label: eos
      module: synthesis
      process: synthesis-crust_dft-ceft-cmf
  config:
    inputs:
      R_start: 0.0004
      eos_name: eos
      final_epsilon: 6000.0
      initial_epsilon: 250.0
      resolution_in_NS_M: 0.05
      resolution_in_NS_R: 0.2
      single_epsilon: 700.0
    options:
      eps_sequence: true
      output_format: csv
      stable_branch: true
    outputs:
      compute_inertia: false
      compute_love: false
      compute_mass_and_radius_correction: false
      compute_quadrupole: false
      local_functions: false
components:
- type: chain
  name: crust_dft_beta
  sequence:
    - crust_dft_eos
    - lepton-crust_dft
- type: chain
  name: ceft_beta
  sequence:
    - ceft_eos
    - lepton-ceft
- type: chain
  name: cmf_beta
  sequence:
    - cmf
    - lepton-cmf
- type: group
  name: beta_equilibrium
  group:
    - crust_dft_beta
    - ceft_beta
    - cmf_beta
- type: chain
  name: workflow
  sequence:
    - beta_equilibrium
    - synthesis-ceft-cmf
    - synthesis-crust_dft-ceft-cmf
    - qlimr 
''')

- CMFLeptonSynthesiscompOSE

Example
processes:
- name: cmf
  module: cmf_solver
  config:
    computational_parameters:
      options:
        vector_potential: 4
        use_octet: true
        use_hyperons: false
        use_decuplet: false
        use_quarks: true
      variables:
        chemical_optical_potentials:
          muB_begin: 940.0
          muB_end: 1800.0
          muB_step: 10.0
          muQ_begin: -400.0
          muQ_end: 0.0
          muQ_step: 5.0
- name: lepton-baryons
  module: lepton
  config:
    global:
      run_name: ''
      use_beta_equilibrium: true
      use_charge_neutrality: false
      check_eos_stability: true
      verbose: 2
    output:
      output_derivatives: true
      output_hdf5: false
      output_compOSE: false
      output_particle_properties: true
    particles:
      use_electron: true
      use_muon: true
  pipes:
    input_eos:
      label: CMF_for_Lepton_baryons_only
      module: cmf_solver
      process: cmf
    input_particle_properties:
      label: CMF_particle_properties_baryons_only
      module: cmf_solver
      process: cmf
- name: lepton-quarks
  module: lepton
  config:
    global:
      run_name: ''
      use_beta_equilibrium: true
      use_charge_neutrality: false
      check_eos_stability: true
      verbose: 2
    output:
      output_derivatives: true
      output_hdf5: false
      output_compOSE: false
      output_particle_properties: true
    particles:
      use_electron: true
      use_muon: true
  pipes:
    input_eos:
      label: CMF_for_Lepton_quarks_only
      module: cmf_solver
      process: cmf
  input_particle_properties:
      label: CMF_particle_properties_quarks_only
      module: cmf_solver
      process: cmf
- name: synthesis
  module: synthesis
  config:
    global:
      run_name: ''
      synthesis_type: 'maxwell'
      verbose: 2
    derivatives:
      relative_step_size: 3.0e-3
      precision: 1
    output:
      output_derivatives: true
      output_hdf5: false
      output_compOSE: true
      output_particle_properties: true
  pipes:
    model1_BetaEq_eos:
      label: eos_beta_equilibrium
      module: lepton
      process: lepton-baryons
    model2_BetaEq_eos:
      label: eos_beta_equilibrium
      module: lepton
      process: lepton-quarks
    model1_BetaEq_particle_properties:
      label: particle_properties_beta_equilibrium
      module: lepton
      process: lepton-baryons
    model2_BetaEq_particle_properties:
      label: particle_properties_beta_equilibrium
      module: lepton
      process: lepton-quarks
components:
- type: group
  name: lepton-run
  group:
  - lepton-baryons
  - lepton-quarks                
- type: chain
  name: workflow
  sequence:
  - cmf
  - lepton-run
  - synthesis

- SLy + CMFLeptonSynthesisQLIMR

To run the SLy + CMF case, we need the SLy EoS, which is not provided by default in MUSES. To overcome that, I’ve uploaded the EoS as public, so we can all use it with the UUID that is given in the configuration below.

You can upload and use your own EoS with MUSES observable modules. We’ll update quickstart for more info about how to upload files and how to use them.

Example
processes:
- name: cmf
  module: cmf_solver
  config:
    computational_parameters:
      options:
        vector_potential: 4
        use_octet: true
        use_hyperons: false
        use_decuplet: false
        use_quarks: false
      variables:
        chemical_optical_potentials:
          muB_begin: 940.0
          muB_end: 1800.0
          muB_step: 10.0
          muQ_begin: -400.0
          muQ_end: 0.0
          muQ_step: 5.0
- name: lepton-baryons
  module: lepton
  config:
    global:
      run_name: ''
      use_beta_equilibrium: true
      use_charge_neutrality: false
      check_eos_stability: true
      verbose: 2
    output:
      output_derivatives: true
      output_hdf5: false
      output_compOSE: false
      output_particle_properties: true
    particles:
      use_electron: true
      use_muon: true
  pipes:
    input_eos:
      label: CMF_for_Lepton_baryons_only
      module: cmf_solver
      process: cmf
    input_particle_properties:
      label: CMF_particle_properties_baryons_only
      module: cmf_solver
      process: cmf
- name: synthesis
  module: synthesis
  config:
    global:
      run_name: ''
      synthesis_type: 'attach'
      verbose: 2
    attach_method:
      attach_value: 0.1
      attach_variable: 'baryon_density'
    derivatives:
      relative_step_size: 3.0e-3
      precision: 1
    output:
      output_derivatives: true
      output_hdf5: false
      output_compOSE: false
      output_particle_properties: false
  inputs:
    model1_BetaEq_eos:
      type: upload
      uuid: '75ab3094-3f9e-435d-9ab8-b458d2b0cf35'
  pipes:
    model2_BetaEq_eos:
      label: eos_beta_equilibrium
      module: lepton
      process: lepton-baryons
- name: qlimr
  module: qlimr
  pipes:
    eos:
      label: eos
      module: synthesis
      process: synthesis
  config:
    inputs:
      R_start: 0.0004
      eos_name: eos
      final_epsilon: 6000.0
      initial_epsilon: 250.0
      resolution_in_NS_M: 0.05
      resolution_in_NS_R: 0.2
      single_epsilon: 700.0
    options:
      eps_sequence: true
      output_format: csv
      stable_branch: true
    outputs:
      compute_inertia: false
      compute_love: false
      compute_mass_and_radius_correction: false
      compute_quadrupole: false
      local_functions: false
components:
- type: chain
  name: workflow
  sequence:
  - cmf
  - lepton-baryons
  - synthesis
  - qlimr

Hi Mateus, thanks for creating the workflows for testing. My example work flow works well to produce EOS and compOSE format as I want.

However, I suggest to implement a few modifications.

  1. In the documentation of CMF module, I cannot access the links provided there to both openAPI spec yaml and the python scripts. I think for users who want to figure out the parameter lists of yaml config, it is helpful to give them the access.
  2. In the Output section, I deduce from your example workflow and outputs that output_particle_properties and output_Lepton have default value set to true now. I think its a good practice to remark on this in the documentation.
  3. For the lepton module, I am curious about whether the label in pipes:input_eos makes a difference for how the lepton module read in specific eos outputs from previous workflow modules. It seems to me that the only differences in the config of these two lepton modules is the label (one specified for quarks and one for baryons). However, I cannot find the description of this in the documentation.
  4. For the synthesis module, as @andrew.manning has pointed out in another post, new users do not have ideas of how to write the pipes of synthesis. Maybe put some example in the complex workflow section just as what you provided me with here, or maybe put the instruction into documentation of synthesis module.

Sorry for this long reply. Hope these feedbacks help! :slightly_smiling_face:

Thank you for the suggestions @jiaxiwu. They are extremely helpful.

  1. Unfortunately, the CMF repository will remain private until the official release, which is why you currently don’t have access to the OpenAPI Specs. However, we should definitely add the config options to the documentation. @cnc6, could you please take a look into this?

  2. @dfriede1 could you also check this when you can?

  3. The label in Lepton’s pipes: input_eos doesn’t change how Lepton reads the input file. Rather, the label is related to the path of the output from the precursor module. In the example, it sets the path to the baryons and quarks grids of CMF. It is a great idea to add the labels’ information to each module’s documentation. Or perhaps compile them into a single reference page. Do you have any thoughts on this @andrew.manning?

  4. That’s a good point. I’ll work on it.

Once again, I really appreciate all the valuable suggestions.

Hi, the example you asked me to test seems to succeed as desired for me (Crust-DFT + χEFT + CMF).

However, when I tried running the SLy + CMF example as provided, the job results in a Failure every time. Are there any other caveats to running this example on the user end?

@loane2 You can find clues about why a job failed using the error_info value returned by the GET /api/v0/ce/job/{id}/ endpoint. In this case it shows:

Invalid inputs spec: "Upload 75ab3094-3f9e-435d-9ab8-b458d2b0cf35 not found or is private."

Apparently the upload referenced in line 67 of the SLy + CMF → Lepton → Synthesis → QLIMR workflow config is either private because @mrpelicer uploaded it but forgot to set it to public, or it does not exist because it was deleted.

Scratch that previous error message; I was using the dev instance accidentally. Using the alpha release instance I get this error:

Object does not exist, resource: 
/phy230156-bucket01/apps/ce-alpha/prod/jobs/738c55be-670a-408c-8032-0db10eeb344e/synthesis-crust_dft-ceft-cmf/opt/output/eos.csv, 
request_id: tx00000ff0a9f6c28aa729b-00670325ff-8e89e1-default, 
host_id: None, 
bucket_name: phy230156-bucket01, 
object_name: apps/ce-alpha/prod/jobs/738c55be-670a-408c-8032-0db10eeb344e/synthesis-crust_dft-ceft-cmf/opt/output/eos.csv\n'

@loane2

That’s on me. There is a typo in the qlimr pipes of the CMF + SLy.

Instead of

- name: qlimr
  module: qlimr
  pipes:
    eos:
      label: eos
      module: synthesis
      process: synthesis-crust_dft-ceft-cmf

it should be

- name: qlimr
  module: qlimr
  pipes:
    eos:
      label: eos
      module: synthesis
      process: synthesis

I fixed the example in the post.

Hi @mrpelicer, is there anywhere that I could find the EoS file used in this example? It’s no longer available under that UUID through the api, so the SLy + CMF example doesn’t work out-of-the-box anymore. A brief tutorial on how to upload a custom file would be helpful too.

hi @loane2 ,

You are correct, that UUID was deleted. For the moment I uploaded another one, so you can use

uuid: '3bccd279-03db-4b8f-b1e5-60222d764e13'
checksum: 'd9a23f79e35436f12ebb199a6bfa87bc'

You have to add the checksum below the uuid now too.

I believe there is an example of how to upload a file in the current tutorial notebook, but if you have any problem with that, let me know.