Hello PennyLane team,
I’m planning to publish my own algorithm on GitHub and I’m not sure how to respect the Apache 2.0 license when modifying PennyLane’s code. I see two approaches:
-
Subclassing the existing optimizer:
class MyOptimizer(qml.GradientDescentOptimizer):
# my custom changes…
-
Copying + modifying the full source of qml.GradientDescentOptimizer
into my repo and adapting it.
In either case:
- Which license headers should I include in my files?
- Do I just add my own copyright line at the top and keep PennyLane’s original Apache 2.0 notice?
- How should I organize the LICENSE file in the repository root?
I’ve never released open-source code before, so any clear, step-by-step advice would be incredibly helpful.
Thanks for any guidance!!
Hi @QuantumH ,
I’m not a lawyer so please don’t take this as any kind of legal advice.
Overall some things to take into account:
- If you see a PennyLane copyright in files please keep it, don’t remove it.
- If you modified a portion of a PennyLane file please clearly state what has been changed. It might be easier if you add any changes or new functions and classes as new files.
- You’re not obliged to keep the Apache 2.0 license, you chan choose to use a different license for the portions of the code that you developed yourself. The Apache 2.0 license is great for open source software but you can look into others too. When you create a new GitHub repository GitHub asks you if you want to add a license, so just follow the instructions and it should be fairly easy to add one.
Please look online for more official information on this. The tldrlegal website has some additional explanations but please make sure to do your own research online on this.
I hope this helps you get started with this, and congrats on releasing your first open-source project!
Hi @CatalinaAlbornoz, thank you so much – that really helped!
1 Like