From 3b2f603051bdd046941e6a8fbf7877b0f94f4c76 Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Thu, 9 Nov 2023 11:07:01 +0000 Subject: [PATCH 1/3] `devenv update` rust version 1.73 stable --- devenv.lock | 30 +++++++++++++++--------------- devenv.nix | 1 + 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/devenv.lock b/devenv.lock index e3cc2a4e..ab437e51 100644 --- a/devenv.lock +++ b/devenv.lock @@ -3,11 +3,11 @@ "devenv": { "locked": { "dir": "src/modules", - "lastModified": 1697058441, - "narHash": "sha256-gjtW+nkM9suMsjyid63HPmt6WZQEvuVqA5cOAf4lLM0=", + "lastModified": 1699492209, + "narHash": "sha256-AhaFZrKIpU6GYUaA26erOQg2X+YHHzJpJ8r1mBHOaM8=", "owner": "cachix", "repo": "devenv", - "rev": "55294461a62d90c8626feca22f52b0d3d0e18e39", + "rev": "80e740c7eb91b3d1c82013ec0ba4bfbc9a83734a", "type": "github" }, "original": { @@ -25,11 +25,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1697610178, - "narHash": "sha256-1wdFrJU3ga81CbAWqx4Ix4GyXN8iC3tZg3BPI3R17ks=", + "lastModified": 1699510895, + "narHash": "sha256-eaOkJUvHeYNW/xEoRotz0rHkKihKoQdWB1ctX4q1MTQ=", "owner": "nix-community", "repo": "fenix", - "rev": "6de79c0b8dfb584d5423bec1612fcc357b32f60f", + "rev": "8eeef23f2c8d092227af40eff98afe5b41891e3b", "type": "github" }, "original": { @@ -95,11 +95,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1697379843, - "narHash": "sha256-RcnGuJgC2K/UpTy+d32piEoBXq2M+nVFzM3ah/ZdJzg=", + "lastModified": 1699343069, + "narHash": "sha256-s7BBhyLA6MI6FuJgs4F/SgpntHBzz40/qV0xLPW6A1Q=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "12bdeb01ff9e2d3917e6a44037ed7df6e6c3df9d", + "rev": "ec750fd01963ab6b20ee1f0cb488754e8036d89d", "type": "github" }, "original": { @@ -136,11 +136,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1696846637, - "narHash": "sha256-0hv4kbXxci2+pxhuXlVgftj/Jq79VSmtAyvfabCCtYk=", + "lastModified": 1699271226, + "narHash": "sha256-8Jt1KW3xTjolD6c6OjJm9USx/jmL+VVmbooADCkdDfU=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "42e1b6095ef80a51f79595d9951eb38e91c4e6ca", + "rev": "ea758da1a6dcde6dc36db348ed690d09b9864128", "type": "github" }, "original": { @@ -160,11 +160,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1697480602, - "narHash": "sha256-XiBylVAQRwulBD0pEbct9ir+dLEAe8j3oJyrNnmRL3w=", + "lastModified": 1699451299, + "narHash": "sha256-7HJMyp62fCS6/aCCCASz8MdJM2/M8d1pBNukyLmPdwA=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "d6afb4fa239fe7b5b34e5cefa9e58148fdff65b8", + "rev": "7059ae2fc2d55fa20d7e2671597b516431129445", "type": "github" }, "original": { diff --git a/devenv.nix b/devenv.nix index 88389e65..4d427c89 100644 --- a/devenv.nix +++ b/devenv.nix @@ -32,6 +32,7 @@ languages.rust = { enable = true; + channel = "stable"; components = [ "rustc" "cargo" "clippy" "rustfmt" "rust-analyzer" ]; }; From 54b61c186725c658dda771c06cba820e11827376 Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Thu, 9 Nov 2023 11:17:57 +0000 Subject: [PATCH 2/3] use poetry setup in devenv --- devenv.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/devenv.nix b/devenv.nix index 4d427c89..ed24e6e0 100644 --- a/devenv.nix +++ b/devenv.nix @@ -26,6 +26,8 @@ enterShell = '' hello cargo --version + python --version + poetry --version ''; # https://devenv.sh/languages/ @@ -38,9 +40,9 @@ languages.python = { enable = true; - - venv.enable = true; - venv.requirements = "-r ${config.env.DEVENV_ROOT}/tket2-py/dev-requirements.txt"; + poetry = { + enable = true; + }; }; # https://devenv.sh/pre-commit-hooks/ From f25eb5362f561aecda713532c54f2ce1d86c3573 Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Thu, 9 Nov 2023 11:18:34 +0000 Subject: [PATCH 3/3] chore: update hugr api change to `instantiate_concrete` -> `instantiate` --- Cargo.toml | 2 +- tket2/src/extension.rs | 6 +++--- tket2/src/ops.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b8324214..8fa4e547 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ license-file = "LICENCE" [workspace.dependencies] tket2 = { path = "./tket2" } -quantinuum-hugr = { git = "https://github.com/CQCL-DEV/hugr", rev = "b71cae6" } +quantinuum-hugr = { git = "https://github.com/CQCL-DEV/hugr", rev = "d0499ad" } portgraph = { version = "0.10" } pyo3 = { version = "0.20" } itertools = { version = "0.11.0" } diff --git a/tket2/src/extension.rs b/tket2/src/extension.rs index 16c20ea0..a89a59bf 100644 --- a/tket2/src/extension.rs +++ b/tket2/src/extension.rs @@ -33,7 +33,7 @@ pub const JSON_PAYLOAD_NAME: SmolStr = SmolStr::new_inline("TKET1 Json Payload") lazy_static! { /// A custom type for the encoded TKET1 operation static ref TKET1_OP_PAYLOAD : CustomType = - TKET1_EXTENSION.get_type(&JSON_PAYLOAD_NAME).unwrap().instantiate_concrete([]).unwrap(); + TKET1_EXTENSION.get_type(&JSON_PAYLOAD_NAME).unwrap().instantiate([]).unwrap(); /// The TKET1 extension, containing the opaque TKET1 operations. pub static ref TKET1_EXTENSION: Extension = { @@ -42,7 +42,7 @@ pub static ref TKET1_EXTENSION: Extension = { res.add_type(LINEAR_BIT_NAME, vec![], "A linear bit.".into(), TypeBound::Any.into()).unwrap(); let json_op_payload_def = res.add_type(JSON_PAYLOAD_NAME, vec![], "Opaque TKET1 operation metadata.".into(), TypeBound::Eq.into()).unwrap(); - let json_op_payload = TypeParam::Opaque(json_op_payload_def.instantiate_concrete([]).unwrap()); + let json_op_payload = TypeParam::Opaque(json_op_payload_def.instantiate([]).unwrap()); res.add_op_custom_sig( JSON_OP_NAME, "An opaque TKET1 operation.".into(), @@ -60,7 +60,7 @@ pub static ref LINEAR_BIT: Type = { Type::new_extension(TKET1_EXTENSION .get_type(&LINEAR_BIT_NAME) .unwrap() - .instantiate_concrete([]) + .instantiate([]) .unwrap()) }; diff --git a/tket2/src/ops.rs b/tket2/src/ops.rs index c0b6a0fd..83b9a270 100644 --- a/tket2/src/ops.rs +++ b/tket2/src/ops.rs @@ -264,7 +264,7 @@ const SYM_OP_ID: SmolStr = SmolStr::new_inline("symbolic_float"); lazy_static! { /// The type of the symbolic expression opaque type arg. pub static ref SYM_EXPR_T: CustomType = - EXTENSION.get_type(&SYM_EXPR_NAME).unwrap().instantiate_concrete([]).unwrap(); + EXTENSION.get_type(&SYM_EXPR_NAME).unwrap().instantiate([]).unwrap(); pub static ref EXTENSION: Extension = { let mut e = Extension::new(EXTENSION_ID); @@ -277,7 +277,7 @@ pub static ref EXTENSION: Extension = { TypeBound::Eq.into(), ) .unwrap(); - let sym_expr_param = TypeParam::Opaque(sym_expr_opdef.instantiate_concrete([]).unwrap()); + let sym_expr_param = TypeParam::Opaque(sym_expr_opdef.instantiate([]).unwrap()); e.add_op_custom_sig_simple( SYM_OP_ID,