cobaya icon indicating copy to clipboard operation
cobaya copied to clipboard

Support for more nested samplers

Open johannesulf opened this issue 1 year ago • 6 comments

Currently, PolyChord seems to be the only nested sampler supported by cobaya. Are there plans in the future to support other nested samplers such as Ultranest, dynesty, and nautilus?

Given the similarities to PolyChord, implementing them may not be too difficult. Additionally, especially for lower-dimensional problems, they can be much faster. As the developer of nautilus, I'd be happy to help implement it.

johannesulf avatar Jan 31 '25 14:01 johannesulf

That would be great. But to avoid bloating the main code, it might be better to make it an external sampler package inheriting from one of the standard classes (i.e. so it can be used like external likelihoods from a separate package).

If changes are needed in Cobaya to make that work better, we can look at that.

cmbant avatar Jan 31 '25 14:01 cmbant

Thanks! Do you mean following the guide here and putting the result under, e.g., cobaya/cobaya/samplers/nautilus? I hope this can be implemented without touching any of the other parts of cobaya. Or do you mean implementing something outside of cobaya's repo entirely?

johannesulf avatar Jan 31 '25 15:01 johannesulf

Hi,

For UltraNest there is already a branch, and I have been offered a draft for a Nautilus interface. Hopefully there will be an experimental implementation soon. So I would suggest you start with dynesty?

JesusTorrado avatar Jan 31 '25 15:01 JesusTorrado

In terms of how to structure it as an external package, you can take a look at this external sampler: https://github.com/ggalloni/profiler

JesusTorrado avatar Jan 31 '25 15:01 JesusTorrado

@JesusTorrado Would you mind pointing me to the branches/draft for UltraNest and nautilus? The 3 samplers (dynesty, ultranest, nautilus) have very similar interfaces. I think it would make sense to have a unified implementation with one base class that all 3 inherit from. Happy to help with this.

johannesulf avatar Feb 02 '25 12:02 johannesulf

The ultranest branch is local at the moment, and I have already requested the nautilus draft that I was offered. I will update you as soon as I am able to clean branch a bit and push it.

JesusTorrado avatar Feb 05 '25 16:02 JesusTorrado