SlideShare une entreprise Scribd logo
1  sur  35
Télécharger pour lire hors ligne
Building scientific
experiments with F#
A. Tcholakov, B. L. Green, A. C. Frangeskou, C. J. Stephen, P. Diggle,
J. Lishman, T. Wheeler, M. E. Newton, and G. W. Morley
A. Tcholakov, B. L. Green, A. C. Frangeskou, C. J. Stephen, P. Diggle,
J. Lishman, T. Wheeler, M. E. Newton, and G. W. Morley
Building scientific
experiments with F#
A. Tcholakov, B. L. Green, A. C. Frangeskou, C. J. Stephen, P. Diggle,
J. Lishman, T. Wheeler, M. E. Newton, and G. W. Morley
Building scientific
experiments with F#
A. Tcholakov, B. L. Green, A. C. Frangeskou, C. J. Stephen, P. Diggle,
J. Lishman, T. Wheeler, M. E. Newton, and G. W. Morley
Building scientific
experiments with F#
A. Tcholakov, B. L. Green, A. C. Frangeskou, C. J. Stephen, P. Diggle,
J. Lishman, T. Wheeler, M. E. Newton, and G. W. Morley
Building scientific
experiments with F#
Anatomy of an experiment
PC
Output
device
Input
device
Science!
@ant_pt
• Concurrent control of multiple devices
• Cancellation
• Reporting of partial progress
• Signal processing
• Robust error handling
• Good performance
Requirements
@ant_pt
• Concurrent control of multiple devices
• Cancellation
• Reporting of partial progress
• Signal processing
• Robust error handling
• Good performance
Requirements… and solutions
Async<'T>
IObservable<'T>
Choice<'T1,'T2> or exn?
}
}
@ant_pt
• Software isn’t actually the key output
• Experiments start as prototypes
• Need path to fully-fledged application
Requirements (process)
@ant_pt
• National Instruments VISA
• C API + DLL import
• Typically very imperative and stateful
• Inherently Async, MailboxProcessor-like
Instrument I/O
@ant_pt
Command-request agent
• Module for creating MailboxProcessor agents
which process Command or Request messages
• Instrument APIs often have large surface area
• Propagates errors to caller without stopping the
agent
@ant_pt
Code…
Command-request agent
@ant_pt
Oscilloscope
• Essential tool in a
physics lab
• Records voltages
against time
• Has settings for
triggering, input
range, offset, etc.
Source: “Oscilloscope.” Wikipedia: The Free Encyclopaedia.
Wikimedia Foundation, Inc. 20 Mar 2016. Web. 13 Apr 2016.
@ant_pt
Code…
PicoScope agent
@ant_pt
PicoScope agent: review
• Async but still imperative
• Device is typically used in one of several modes:
streaming, block acquisition, etc.
• Functional approach:
- model acquisition configuration
- define workflow to run a general acquisition
- push sample blocks via IObservable<'T>
@ant_pt
Code…
PicoScope streaming
@ant_pt
@ant_pt
laser
to optical fibre
@ant_pt
laser
to optical fibre
sample
@ant_pt
laser
to optical fibre
sample
todetector
@ant_pt
laser
to optical fibre
sample
todetector
microwave oscillator
@ant_pt
laser
to optical fibre
sample
todetector
microwave oscillator
toantenna
@ant_pt
laser
to optical fibre
sample
todetector
microwave oscillator
toantenna
frequency tuning
@ant_pt
laser
to optical fibre
sample
todetector
microwave oscillator
toantenna
frequency tuning
magnet
@ant_pt
Code…
N-V-
spectrometer
@ant_pt
N-V-
spectrometer: review
• Declarative streaming API makes code
straightforward to read, write, and modify
• IObservable<'T> + FSharp.Control.Reactive
offer a powerful way to implement DSP
• FSharp.Charting is great for prototyping
• Async provides robust cancellation support
• MailboxProcessor ensures sequential I/O
@ant_pt
397 GHz spectrometer
@ant_pt
397 GHz spectrometer
• Irradiate sample with
397 GHz mm-waves
• Sweep field on
superconducting
magnet system
• Measure what comes
back and stream
data with PicoScope
@ant_pt
397 GHz spectrometer
@ant_pt
Confocal microscope
@ant_pt
Confocal microscope
• 3-axis piezoelectric
scanning stage for
imaging
• Photon counting
detection
• Single molecule
sensitivity (for
fluorescent samples)
@ant_pt
Confocal microscope
Pulse length
(1ns resolution)
Integrated
photon counts
Acquisition
parameters
System development time: ~9 months
Oscillations represent
manipulation of a qubit!
@ant_pt
Performance
• Hasn’t really been a problem
• PicoScope streaming acquisition copes with 32ns
sample interval (fastest available) in .fsx
• Time tagging acquisition copes with several
million photon counts per second
@ant_pt
Towards open source…
• Aim to publish the code under Apache 2.0
• Wrappers for several common lab instruments
• First need to:
- migrate to Paket, FAKE
- make namespaces consistent
- consolidate git branches
- write some unit tests (?)
@ant_pt
Conclusions
• F# is a great fit for instrument control thanks to
powerful Async, Reactive programming features
• Functional paradigm + .fsx aids prototyping
• Units of measure are the cherry on top
• Working towards open source instrument
libraries
@ant_pt

Contenu connexe

Similaire à Building Scientific Experiments Using F# Functional Programming

UG thesis presentation
UG thesis presentationUG thesis presentation
UG thesis presentationLuke Zhao
 
Computational materials design with high-throughput and machine learning methods
Computational materials design with high-throughput and machine learning methodsComputational materials design with high-throughput and machine learning methods
Computational materials design with high-throughput and machine learning methodsAnubhav Jain
 
Power point presentation for science research
Power point presentation for science researchPower point presentation for science research
Power point presentation for science researchSatish Bhat
 
PEA技術 国際学会発表資料
PEA技術 国際学会発表資料PEA技術 国際学会発表資料
PEA技術 国際学会発表資料FINE PIECE
 
Using Polycaprolactone for Tissue Regeneration
Using Polycaprolactone for Tissue RegenerationUsing Polycaprolactone for Tissue Regeneration
Using Polycaprolactone for Tissue RegenerationSatish Bhat
 
Talk multiscale analysis of ionic solutions is unavoidable
  Talk multiscale analysis of ionic solutions is unavoidable  Talk multiscale analysis of ionic solutions is unavoidable
Talk multiscale analysis of ionic solutions is unavoidableBob Eisenberg
 
Nanotechnology Progess And Pitfalls
Nanotechnology Progess And PitfallsNanotechnology Progess And Pitfalls
Nanotechnology Progess And Pitfallsphackettualberta
 
Cleo pr-invited
Cleo pr-invitedCleo pr-invited
Cleo pr-invitedKelvin Ooi
 
Going Smart and Deep on Materials at ALCF
Going Smart and Deep on Materials at ALCFGoing Smart and Deep on Materials at ALCF
Going Smart and Deep on Materials at ALCFIan Foster
 
Neural Engineering Research Overview
Neural Engineering Research OverviewNeural Engineering Research Overview
Neural Engineering Research OverviewRyanClement
 
From physics to data science
From physics to data scienceFrom physics to data science
From physics to data scienceAndrew Lowe
 
University Case Study Bangladesh
University Case Study BangladeshUniversity Case Study Bangladesh
University Case Study Bangladeshomorfarukparveztopu
 
My resume_Nai-Chen Cheng
My resume_Nai-Chen ChengMy resume_Nai-Chen Cheng
My resume_Nai-Chen ChengNai-Chen Cheng
 
Running Hot October 2008
Running Hot October 2008Running Hot October 2008
Running Hot October 2008Ian Foster
 
Ce Zhang, Postdoctoral Researcher, Stanford University at MLconf ATL - 9/18/15
Ce Zhang, Postdoctoral Researcher, Stanford University at MLconf ATL - 9/18/15Ce Zhang, Postdoctoral Researcher, Stanford University at MLconf ATL - 9/18/15
Ce Zhang, Postdoctoral Researcher, Stanford University at MLconf ATL - 9/18/15MLconf
 

Similaire à Building Scientific Experiments Using F# Functional Programming (20)

UG thesis presentation
UG thesis presentationUG thesis presentation
UG thesis presentation
 
Computational materials design with high-throughput and machine learning methods
Computational materials design with high-throughput and machine learning methodsComputational materials design with high-throughput and machine learning methods
Computational materials design with high-throughput and machine learning methods
 
Power point presentation for science research
Power point presentation for science researchPower point presentation for science research
Power point presentation for science research
 
PEA技術 国際学会発表資料
PEA技術 国際学会発表資料PEA技術 国際学会発表資料
PEA技術 国際学会発表資料
 
Using Polycaprolactone for Tissue Regeneration
Using Polycaprolactone for Tissue RegenerationUsing Polycaprolactone for Tissue Regeneration
Using Polycaprolactone for Tissue Regeneration
 
Barth, B. B. CV
Barth, B. B. CVBarth, B. B. CV
Barth, B. B. CV
 
Talk multiscale analysis of ionic solutions is unavoidable
  Talk multiscale analysis of ionic solutions is unavoidable  Talk multiscale analysis of ionic solutions is unavoidable
Talk multiscale analysis of ionic solutions is unavoidable
 
Nanotechnology Progess And Pitfalls
Nanotechnology Progess And PitfallsNanotechnology Progess And Pitfalls
Nanotechnology Progess And Pitfalls
 
Cleo pr-invited
Cleo pr-invitedCleo pr-invited
Cleo pr-invited
 
Going Smart and Deep on Materials at ALCF
Going Smart and Deep on Materials at ALCFGoing Smart and Deep on Materials at ALCF
Going Smart and Deep on Materials at ALCF
 
Cern general information
Cern general informationCern general information
Cern general information
 
Neural Engineering Research Overview
Neural Engineering Research OverviewNeural Engineering Research Overview
Neural Engineering Research Overview
 
From physics to data science
From physics to data scienceFrom physics to data science
From physics to data science
 
University Case Study Bangladesh
University Case Study BangladeshUniversity Case Study Bangladesh
University Case Study Bangladesh
 
bio tenten.pptx
bio tenten.pptxbio tenten.pptx
bio tenten.pptx
 
My resume_Nai-Chen Cheng
My resume_Nai-Chen ChengMy resume_Nai-Chen Cheng
My resume_Nai-Chen Cheng
 
Science and Technology
Science and TechnologyScience and Technology
Science and Technology
 
Running Hot October 2008
Running Hot October 2008Running Hot October 2008
Running Hot October 2008
 
CV
CVCV
CV
 
Ce Zhang, Postdoctoral Researcher, Stanford University at MLconf ATL - 9/18/15
Ce Zhang, Postdoctoral Researcher, Stanford University at MLconf ATL - 9/18/15Ce Zhang, Postdoctoral Researcher, Stanford University at MLconf ATL - 9/18/15
Ce Zhang, Postdoctoral Researcher, Stanford University at MLconf ATL - 9/18/15
 

Dernier

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 

Dernier (20)

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 

Building Scientific Experiments Using F# Functional Programming