[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-506200-105":3,"detail-sidebar-cat-0-en-105":81,"doc-detail-506200-en":130},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":74,"head_meta":76,"extra_data":78,"updated_unix":80},105,"en","qurts-automatic-quantum-uncomputation-by-affine-types-with-lifetime","Qurts: Automatic Quantum Uncomputation by Affine Types with Lifetime","","Uncomputation is a key technique in quantum programming that enables discarding values while preserving quantum information, and can allow compilers to reuse resources. Quantum data is typically constrained by linear type systems to prevent copying and unintended measurement. This work develops an automatic uncomputation framework that lets programmers treat quantum information affinely in controlled scopes. The paper extends the Rust type system with lifetimes and provides operational semantics suitable for uncomputation without committing to a specific strategy.",{"@graph":14,"@context":73},[15,34,56],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/research-report/","Research & Report",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/qurts-automatic-quantum-uncomputation-by-affine-types-with-lifetime/506200/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/qurts-automatic-quantum-uncomputation-by-affine-types-with-lifetime/506200.png","ImageObject",300,407,{"name":42,"@type":43},"8796093062539","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-07","2026-10-05",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",6,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"Why do quantum programming languages usually enforce linear types?","Question",{"text":63,"@type":64},"Quantum information cannot be copied or discarded without violating physical laws. Linear type disciplines prevent copying (contraction) and unintended discarding (weakening), avoiding issues like no-cloning and unwanted implicit measurements.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"What does uncomputation achieve in quantum programs?",{"text":68,"@type":64},"Uncomputation allows quantum values to be discarded while keeping quantum information intact. Dirty qubits must be cleaned by disentangling and resetting them before they can be safely dropped.",{"name":70,"@type":61,"acceptedAnswer":71},"How does Qurts use lifetimes to support affine treatment of quantum values?",{"text":72,"@type":64},"Qurts parameterises types by lifetimes, permitting values to be treated affinely during their lifetime. Outside that lifetime, the types are restricted to linear use, enabling precise control over when discarding is safe.","https://schema.org",{"og:url":32,"og:type":75,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":77,"canonical":32},"index,follow",{"doc_id":79,"site_id":7},506200,1792162625,{"code":4,"msg":82,"data":83},"success",[84,88,92,96,101,105,110,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":85,"show_sort_weight":86,"slug":87},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":89,"show_sort_weight":90,"slug":91},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":93,"show_sort_weight":94,"slug":95},"Exam",70,"exam",{"id":97,"doc_module":4,"doc_module_name":25,"category_name":98,"show_sort_weight":99,"slug":100},5,"Comic",60,"comic",{"id":55,"doc_module":4,"doc_module_name":25,"category_name":102,"show_sort_weight":103,"slug":104},"Technology",50,"technology",{"id":106,"doc_module":4,"doc_module_name":25,"category_name":107,"show_sort_weight":108,"slug":109},7,"Healthcare",40,"healthcare",{"id":111,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":112,"slug":113},8,30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":97,"slug":129},19,"General","general",{"code":4,"msg":82,"data":131},{"doc_id":79,"user_id":132,"nickname":42,"user_avatar":11,"doc_module":4,"category_id":111,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":133,"file_id":134,"file_url":135,"file_type":136,"file_size":137,"view_count":55,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":138,"language":139,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":12,"update_tm":143,"read_time":144,"preview_page_count":55,"preview_urls":145},8796093062539,"arXiv :2411 . 10835v1 [ cs .PL] 16 Nov 2024  \nQurts: Automatic Quantum Uncomputation by Affine Types with Lifetime  \nKENGO HIRATA, University of Edinburgh, UK and Kyoto University, Japan CHRIS HEUNEN, University of Edinburgh, UK  \nUncomputation is a feature in quantum programming that allows the programmer to discard a value without losing quantum information, and that allows the compiler to reuse resources. Whereas quantum information has to be treated linearly by the type system, automatic uncomputation enables the programmer to treat it affinely to some extent. Automatic uncomputation requires a substructural type system between linear and affine, a subtlety that has only been captured by existing languages in an ad hoc way. We extend the Rust type system to the quantum setting to give a uniform framework for automatic uncomputation called Qurts (pronounced quartz) . Specifically, we parameterise types by lifetimes, permitting them to be affine during their lifetime, while being restricted to linear use outside their lifetime. We also provide two operational semantics: one based on classical simulation, and one that does not depend on any specific uncomputation strategy.  \nCCS Concepts: • Theory of computation → Quantum computation theory; Type structures; Operational semantics.  \nAdditional Key Words and Phrases: Quantum Programming, Rust, Uncomputation, Affine Type, Linear Type, Lifetime  \nACM Reference Format:  \nKengo Hirata and Chris Heunen. 2024. Qurts: Automatic Quantum Uncomputation by Affine Types with  \nLifetime. 1, 1 (November 2024), 59 pages. [https://doi.org/10.1145/3704842](https://doi.org/10.1145/3704842)  \n1 INTRODUCTION  \nQuantum information famously cannot be copied or discarded by the laws of nature. Consequently, programming languages for quantum computers typically enforce a linear type discipline to prevent misuse of quantum information [Altenkirch and Grattage 2005; Pratt 1992; Selinger and Valiron 2006; Wadler 1990] . The contraction rule, which allows copying, must be abandoned in order to obey the no-cloning theorem of quantum mechanics [Wootters and Zurek 1982] . Similarly, the weakening rule, which allows discarding, must be abandoned in order to prevent unintended implicit measurements [Kumar Pati and Braunstein 2000] . However, the latter restriction on weakening is cumbersome because it mandates that quantum values is explicitly transformed into classical data through measurement before dropping them.  \nUncomputation is a technique in quantum programming that allows quantum values to be discarded without sacrificing quantum information. Discarding ‘dirty’ qubits has undesired effects on the rest ofthe computation via entanglement, so they first need to be ‘cleaned’. A qubit is cleaned by disentangling it from the other qubits and resetting it to its initial state. This uncomputation needs to be inserted into the computation at the appropriate place before discarding the qubit, giving a space-time trade-off [Meuli et al. 2019; Paradis et al. 2021, 2024; Venev et al. 2024]: it is more space-efficient to uncompute as early as possible, but more time-efficient to uncompute as late as possible. Moreover, uncomputing a qubit cannot be done too late – the process ofuncomputation may use other qubits that are entangled with the qubit in question, and must be done before the information in those other qubits is lost. Thus, the timing ofuncomputation is crucial.  \nAuthors’ addresses: Kengo Hirata, University of Edinburgh, Edinburgh, UK and Kyoto University, Kyoto, Japan, k.hirata@ [sms.ed.ac.uk](sms.ed.ac.uk); Chris Heunen, University of Edinburgh, Edinburgh, UK, [chris.heunen@ed.ac.uk](chris.heunen@ed.ac.uk).  \n2024. This is the author’s version of the work. It is posted here for your personal use. Not for redistribution. The definitive Version of Record was published in , [https://doi.org/10.1145/3704842](https://doi.org/10.1145/3704842) .  \n, Vol. 1, No. 1, Article . Publication date: November 2024 . ","cbCaih67BJB2MLvN","https://ap.wps.com/l/cbCaih67BJB2MLvN","pdf",1256541,59,"English","# Introduction\n## Uncomputation and type-system constraints\n## Dirty qubits, cleaning, and timing trade-offs\n## Related work and motivation\n## Substructural typing and lifetime-based affine use","[{\"question\":\"Why do quantum programming languages usually enforce linear types?\",\"answer\":\"Quantum information cannot be copied or discarded without violating physical laws. Linear type disciplines prevent copying (contraction) and unintended discarding (weakening), avoiding issues like no-cloning and unwanted implicit measurements.\"},{\"question\":\"What does uncomputation achieve in quantum programs?\",\"answer\":\"Uncomputation allows quantum values to be discarded while keeping quantum information intact. Dirty qubits must be cleaned by disentangling and resetting them before they can be safely dropped.\"},{\"question\":\"How does Qurts use lifetimes to support affine treatment of quantum values?\",\"answer\":\"Qurts parameterises types by lifetimes, permitting values to be treated affinely during their lifetime. Outside that lifetime, the types are restricted to linear use, enabling precise control over when discarding is safe.\"}]","Qurts: Automatic Quantum Uncomputation by Affine Types with Lifetime | PDF",1791160884,149,[146,150,154,158,162,166],{"page_no":22,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/3b52b54b96f97953321d48196077de69.webp",983,1415,{"page_no":26,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/b3fd95119cd2395632669243cda5fd83.webp",982,1414,{"page_no":30,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/fdc25fbd7b28f88cb17f14e897b54a0a.webp",981,1412,{"page_no":33,"url":159,"width":160,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/0f4fa7f038e04e6eb24f25ab48563e37.webp",980,1411,{"page_no":97,"url":163,"width":164,"height":165},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/dee17ec89bf6d790c3cff3349a7efbf0.webp",979,1409,{"page_no":55,"url":167,"width":168,"height":169},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/a58ed3996e4b88394f09c18cdecb2292.webp",978,1408]