From ea0b2fcdb8831d3370be51ea111d1a2c693b929d Mon Sep 17 00:00:00 2001 From: Hiroshi Shinaoka Date: Sun, 22 Sep 2024 19:24:41 +0900 Subject: [PATCH] Restructure notebooks --- pluto_notebooks/{welcome.jl => pluto.jl} | 112 +++-------------------- scripts/common.jl | 4 +- scripts/generate_index.jl | 3 +- 3 files changed, 17 insertions(+), 102 deletions(-) rename pluto_notebooks/{welcome.jl => pluto.jl} (76%) diff --git a/pluto_notebooks/welcome.jl b/pluto_notebooks/pluto.jl similarity index 76% rename from pluto_notebooks/welcome.jl rename to pluto_notebooks/pluto.jl index 961a50f..971eace 100644 --- a/pluto_notebooks/welcome.jl +++ b/pluto_notebooks/pluto.jl @@ -28,103 +28,14 @@ To run this notebook `welcome.jl` locally, copy and paste the following into you ```julia using Pkg; Pkg.activate(temp=true); Pkg.add("Pluto") BASE_URL = "https://raw.githubusercontent.com/tensor4all/T4APlutoExamples/refs/heads/main/pluto_notebooks/" -notebook = "welcome.jl" +notebook = "pluto.jl" url = joinpath(BASE_URL, notebook) using Pluto; Pluto.run(notebook=download(url)) ``` """ -# ╔═╡ 5cf76073-4a83-4d0d-aac0-843dbbafc027 -md""" -# T4A Julia Tutorials - -This documentation provides a comprehensive tutorials/examples -on quantics and tensor cross interpolation (TCI) and their combinations (QTCI). -These technologies allow us to reveal low-rank tensor network representation (TNR) hidden in data or a function, -and perform computation such as Fourier transform and convolution. -Please refer [xfacpaper](https://arxiv.org/abs/2407.02454) for a more detailed introduction of these concepts. - -The T4A group hosts various Julia libraries for performing such operations. -The folowing list is given in the order of low-level to high-level libraries: - -- [TensorCrossInterpolation.jl](https://github.com/tensor4all/TensorCrossInterpolation.jl/) provides implementations of TCI. -- [QuanticsGrids.jl](https://github.com/tensor4all/QuanticsGrids.jl/) provides utilities for handling quantics representations, e.g., creating a quantics grid and transformation between the original coordinate system and the quantics representation. -- [QuanticsTCI.jl](https://github.com/tensor4all/QuanticsTCI.jl/) is a thin wrapper around `TensorCrossInterpolation.jl` and `QuanticsGrids.jl`, providing valuable functionalities for non-expert users' performing quantics TCI (QTCI). -- [TCIITensorConversion.jl](https://github.com/tensor4all/TCIITensorConversion.jl/) provides conversions of tensor trains between `TensorCrossInterpolation.jl` and `ITensors.jl`. -- [Quantics.jl](https://github.com/tensor4all/Quantics.jl/) is an experimental library providing a high-level API for performing operations in QTT. This library is under development and its API may be subject to change. The library is not yet registered in the Julia package registry. - -Additionally, we provide some topics on Julia packages such as: - -- [Plots.jl](plots.ipynb). Basic tutorial for plotting using Plots.jl. - -This documentation provides examples of using these libraries to perform QTCI and other operations. - -## Preparation - Installing Julia - -Install `julia` command using [juliaup](https://github.com/JuliaLang/juliaup). - -On Windows Julia and Juliaup can be installed directly from the Windows store. One can also install exactly the same version by executing -""" - -# ╔═╡ 3f5633ea-85cd-48dd-a533-9d2d57d54bc2 -md""" -```powershell -PS> winget install julia -s msstore -``` -""" - -# ╔═╡ f6c6d410-bc9a-427e-9085-c966acd1509c -md""" -on a command line. - -Juliaup can be installed on Linux or Mac by executing -""" - -# ╔═╡ 8972eee5-606d-4d7d-bb41-5f6c768a0fe4 -md""" -```sh -$ curl -fsSL https://install.julialang.org | sh -s -- --yes -``` -""" +# ╔═╡ c453cd50-2e2d-4402-a017-37a32540dcb2 -# ╔═╡ 96a60509-1189-4925-a1d1-69e7a30f6b52 -md""" -in a shell. - -You can check that `julia` is installed correctly by simply running `julia` in your terminal: - -```julia-repl - _ - _ _ _(_)_ | Documentation: https://docs.julialang.org - (_) | (_) (_) | - _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help. - | | | | | | |/ _` | | - | | |_| | | | (_| | | Version 1.10.5 (2024-08-27) - _/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release -|__/ | - -julia> -``` - -The REPL greets you with a banner and a `julia>` prompt. Let's display \"Hello World\": - -```julia-repl -julia> println(\"Hello World\") -``` - -To see the environment in which Julia is running, you can use `versioninfo()`. - -```julia-repl -julia> versioninfo() -``` - -To exit the interactive session, type `exit()` followed by the return or enter key: - -```julia-repl -julia> exit() -``` - -See the official documentation at [The Julia REPL](https://docs.julialang.org/en/v1/stdlib/REPL/) to learn more.""" # ╔═╡ 19b7809c-5a93-4963-b46a-360a332c476d begin @@ -134,9 +45,12 @@ end # ╔═╡ 7b83cb86-f08a-41b0-b506-6cbe5393d3a3 md""" -## How to open Pluto notebooks locally +## How to open ALL Pluto notebooks locally + -Our tutorials are written in [Pluto.jl](https://plutojl.org/) notebook. To open Pluto notebooks locally, clone our [tutorial repository T4APlutoExamples](https://github.com/tensor4all/T4APlutoExamples) and navigate to directory `T4APlutoExamples`: +The following instructions are for EXPERT users familiar with `Julia` and `git.` + +Our tutorials are written in [Pluto.jl](https://plutojl.org/) notebook. To open all the Pluto notebooks locally, clone our [tutorial repository T4APlutoExamples](https://github.com/tensor4all/T4APlutoExamples) and navigate to directory `T4APlutoExamples`: ```sh $ git clone https://github.com/tensor4all/T4APlutoExamples.git @@ -180,6 +94,9 @@ $(img_main_menu) To open notebooks under `pluto_notebooks` directory, type `pluto_notebooks/welcome.jl` to text area under `Open a notebook` section. Then click `Open` button. """ +# ╔═╡ 00c93734-a3e0-4c45-a60a-93fafba51dc5 + + # ╔═╡ ec419a4f-061c-4d67-a1b6-c123eb763132 md""" ## Specifying Pluto notebook URL directly @@ -527,14 +444,11 @@ version = "17.4.0+2" # ╔═╡ Cell order: # ╟─89ca61fd-6bd0-483f-aad6-e3aa2e35046c +# ╠═c453cd50-2e2d-4402-a017-37a32540dcb2 # ╠═ca3996e3-7a32-41a9-9e3f-f5cb83f3fe5f -# ╟─5cf76073-4a83-4d0d-aac0-843dbbafc027 -# ╟─3f5633ea-85cd-48dd-a533-9d2d57d54bc2 -# ╟─f6c6d410-bc9a-427e-9085-c966acd1509c -# ╟─8972eee5-606d-4d7d-bb41-5f6c768a0fe4 -# ╟─96a60509-1189-4925-a1d1-69e7a30f6b52 # ╟─19b7809c-5a93-4963-b46a-360a332c476d -# ╟─7b83cb86-f08a-41b0-b506-6cbe5393d3a3 +# ╠═7b83cb86-f08a-41b0-b506-6cbe5393d3a3 +# ╠═00c93734-a3e0-4c45-a60a-93fafba51dc5 # ╟─ec419a4f-061c-4d67-a1b6-c123eb763132 # ╟─07854cf9-da58-4c02-a54f-31a24d1f32b3 # ╟─cf22b220-b5d6-483f-a137-ff56d0216158 diff --git a/scripts/common.jl b/scripts/common.jl index a306f5e..0bf6d4a 100644 --- a/scripts/common.jl +++ b/scripts/common.jl @@ -1,12 +1,12 @@ const PLUTO_NOTEBOOKS_DIR = joinpath(dirname(@__DIR__), "pluto_notebooks") const PLUTO_FILE_NAMES = [ - "welcome.jl", "quantics1d.jl", "quantics1d_advanced.jl", "compress.jl", "interfacingwithitensors.jl", "quantics2d.jl", - "plots.jl", "qft.jl", + "pluto.jl", + "plots.jl", ] \ No newline at end of file diff --git a/scripts/generate_index.jl b/scripts/generate_index.jl index ed60294..30ce316 100644 --- a/scripts/generate_index.jl +++ b/scripts/generate_index.jl @@ -36,7 +36,8 @@ function extract_title(filepath::AbstractString) end open(joinpath(PLUTO_NOTEBOOKS_DIR, "index.md"), "w") do io - write(io, "# Notebooks\n") + #write(io, "# Notebooks\n") + write(io, "Please follow the instruction in the top cell of each notebook to run it locally.\n") for f in PLUTO_FILE_NAMES title = extract_title(joinpath(PLUTO_NOTEBOOKS_DIR, f))